From 5af4b79afe5b5d45c9c8ec75d100c4ae56d24353 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Wed, 1 Oct 2014 11:51:25 -0400 Subject: [PATCH 001/459] fix name of redstone repeaters --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 44d8027b..378b73c5 100644 --- a/config.yml +++ b/config.yml @@ -4627,7 +4627,7 @@ production_recipes: material: STONE amount: 128 outputs: - Redstone Torches: + Redstone Repeaters: material: DIODE amount: 96 Produce_Comparators: From f007f27af7409c6476ffffbc8cc549d20b95f445 Mon Sep 17 00:00:00 2001 From: ribagi Date: Fri, 3 Oct 2014 09:33:55 -0700 Subject: [PATCH 002/459] Fixed header of Aspect Factory *Do not put this on live until Nether factories or until someone requires bedrock in the costs* The header was in a wrong position which may prevent the creation of the Aspect Factory. --- config.yml | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/config.yml b/config.yml index 378b73c5..2b9c4926 100644 --- a/config.yml +++ b/config.yml @@ -2589,6 +2589,38 @@ production_factories: amount: 1 display_name: Smaragdus lore: An item used to create a Bastion Block + Aspect_Factory: + name: Arcane Elementizer + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Netherbrick: + material: NETHER_BRICK + amount: 1536 + Redstone: + material: REDSTONE + amount: 1152 + Netherquartz: + material: QUARTZ + amount: 576 + recipes: + - Forge_Aspect_of_Terra + - Forge_Aspect_of_End + - Forge_Aspect_of_Nether + - Craft_Eye_of_Ender + repair_multiple: 26 + repair_inputs: + Nether Brick: + material: NETHER_BRICK + amount: 6 + Redstone: + material: REDSTONE + amount: 5 + Netherquartz: + material: QUARTZ + amount: 2 nether_factory: name: Nether Factory fuel: @@ -7419,38 +7451,6 @@ production_recipes: material: DOUBLE_PLANT amount: 4 durability: 5 - Aspect_Factory: - name: Arcane Elementizer - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Netherbrick: - material: NETHER_BRICK - amount: 1536 - Redstone: - material: REDSTONE - amount: 1152 - Netherquartz: - material: QUARTZ - amount: 576 - recipes: - - Forge_Aspect_of_Terra - - Forge_Aspect_of_End - - Forge_Aspect_of_Nether - - Craft_Eye_of_Ender - repair_multiple: 26 - repair_inputs: - Nether Brick: - material: NETHER_BRICK - amount: 6 - Redstone: - material: REDSTONE - amount: 5 - Netherquartz: - material: QUARTZ - amount: 2 Forge_Aspect_of_Terra: name: Forge Aspect of Terra production_time: 64 From 43efa26f3e0ac33821584523864c50bc9512d02d Mon Sep 17 00:00:00 2001 From: Jacob Date: Wed, 5 Nov 2014 06:58:54 -0600 Subject: [PATCH 003/459] Update config.yml Added droppers to Adv. Mechanism factory --- config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config.yml b/config.yml index fac8aac7..30a17381 100644 --- a/config.yml +++ b/config.yml @@ -1719,6 +1719,7 @@ production_factories: - Produce_Sticky_Pistons - Produce_Jukeboxes - Produce_Hoppers + - Produce_Droppers repair_multiple: 10 repair_inputs: Redstone: @@ -4806,6 +4807,19 @@ production_recipes: Hopper: material: HOPPER amount: 64 + Produce_Droppers: + name: Produce Droppers + inputs: + Cobblestone: + material: COBBLESTONE + amount: 320 + Redstone: + material: REDSTONE + amount: 32 + outputs: + Droppers: + material: DROPPER + amount: 64 Smelt_Gold_Ore: name: Smelt Gold Ore production_time: 3 From e660d3837246ebc199665b176a7ecd977107df40 Mon Sep 17 00:00:00 2001 From: rourke750 Date: Thu, 6 Nov 2014 23:16:13 -0500 Subject: [PATCH 004/459] Create .travis.yml --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..c8e11b17 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: java +install: true +matrix: + include: + - jdk: openjdk6 From e9e0b6cd678a8b8c3f6409b4a1f291bca9b0e65c Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Mon, 15 Dec 2014 15:36:06 -0500 Subject: [PATCH 005/459] updated to citadel 3.0 --- plugin.yml | 2 +- pom.xml | 2 +- .../FactoryMod/Factorys/NetherFactory.java | 17 ++++----- .../listeners/FactoryModListener.java | 36 ++++++++----------- .../listeners/RedstoneListener.java | 21 ++++------- .../managers/NetherFactoryManager.java | 13 +++---- 6 files changed, 40 insertions(+), 51 deletions(-) diff --git a/plugin.yml b/plugin.yml index ac5e00d4..6527f26a 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,4 +1,4 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.2 +version: 1.3 diff --git a/pom.xml b/pom.xml index b35753c9..991c0a44 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.0-SNAPSHOT + 1.3 FactoryMod https://github.com/ttk2/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 9980f0f4..95fbb45a 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -1,13 +1,17 @@ package com.github.igotyou.FactoryMod.Factorys; -import static com.untamedears.citadel.Utility.getReinforcement; -import static com.untamedears.citadel.Utility.isReinforced; +import java.util.ArrayList; +import java.util.List; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; + import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; @@ -15,14 +19,11 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.untamedears.citadel.entity.PlayerReinforcement; - -import java.util.ArrayList; -import java.util.List; public class NetherFactory extends BaseFactory { + private ReinforcementManager rm = Citadel.getReinforcementManager(); private NetherFactoryProperties netherFactoryProperties;//the properties of the production factory private Location netherTeleportPlatform; private Location overworldTeleportPlatform; @@ -160,8 +161,8 @@ public List getTeleportationBlockResponse(Player player, Lo { List responses=new ArrayList(); //does the player have acsess to the nether factory via ciatdel? - if ((!FactoryModPlugin.CITADEL_ENABLED || (FactoryModPlugin.CITADEL_ENABLED && !isReinforced(factoryLocation))) || - (((PlayerReinforcement) getReinforcement(factoryLocation)).isAccessible(player))) + if ((!FactoryModPlugin.CITADEL_ENABLED || (FactoryModPlugin.CITADEL_ENABLED && rm.getReinforcement(factoryLocation) != null)) || + (((PlayerReinforcement) rm.getReinforcement(factoryLocation)).isAccessible(player))) { if (mode == NetherOperationMode.TELEPORT) { diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index c46b8d7a..e2295b76 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -1,8 +1,5 @@ package com.github.igotyou.FactoryMod.listeners; -import static com.untamedears.citadel.Utility.isReinforced; -import static com.untamedears.citadel.Utility.getReinforcement; - import java.util.List; import org.bukkit.Location; @@ -17,24 +14,21 @@ import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerInteractEvent; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; + import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.managers.FactoryModManager; -import com.github.igotyou.FactoryMod.managers.PrintingPressManager; -import com.github.igotyou.FactoryMod.managers.ProductionManager; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.untamedears.citadel.entity.PlayerReinforcement; - -import org.bukkit.event.entity.ExpBottleEvent; -import org.bukkit.event.player.PlayerExpChangeEvent; public class FactoryModListener implements Listener { private FactoryModManager factoryMan; + private ReinforcementManager rm = Citadel.getReinforcementManager(); /** * Constructor @@ -63,7 +57,7 @@ public void blockBreakEvent(BlockBreakEvent e) if (factoryMan.factoryExistsAt(block.getLocation())) { //if the blocks is not reinforced destroy it - if ((FactoryModPlugin.CITADEL_ENABLED && !isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) + if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) { destroyFactoryAt(block); } @@ -99,7 +93,7 @@ public void explosionListener(EntityExplodeEvent e) if (factoryMan.factoryExistsAt(block.getLocation())) { Factory factory = factoryMan.getFactory(block.getLocation()); - if ((FactoryModPlugin.CITADEL_ENABLED && !isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) + if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) { destroyFactoryAt(block); } @@ -151,8 +145,8 @@ public void playerInteractionEvent(PlayerInteractEvent e) if(factoryMan.factoryWholeAt(clicked.getLocation())) { //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) + if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || + (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) { //if there is a production Factory at the clicked location if (factoryMan.factoryExistsAt(clicked.getLocation())) @@ -178,8 +172,8 @@ public void playerInteractionEvent(PlayerInteractEvent e) else { //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) + if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || + (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) { InteractionResponse.messagePlayerResult(player, createFactory(clicked.getLocation(), player)); } @@ -200,8 +194,8 @@ else if (clicked.getType() == Material.FURNACE || clicked.getType() == Material. if(factoryMan.factoryWholeAt(clicked.getLocation())) { //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) + if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || + (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) { InteractionResponse.messagePlayerResults(player,(factoryMan.getFactory(clicked.getLocation())).togglePower()); } @@ -227,8 +221,8 @@ else if (clicked.getType() == Material.CHEST) if(factoryMan.factoryWholeAt(clicked.getLocation())) { //if the player is allowed to interact with that block? - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) + if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || + (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) { if (factoryMan.factoryExistsAt(clicked.getLocation())) { diff --git a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java index f06882c0..4fdea5b4 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java @@ -1,33 +1,26 @@ package com.github.igotyou.FactoryMod.listeners; -import static com.untamedears.citadel.Utility.getReinforcement; -import static com.untamedears.citadel.Utility.isReinforced; - -import java.util.List; - -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.material.Attachable; -import org.bukkit.material.Lever; -import org.bukkit.material.MaterialData; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.managers.FactoryModManager; import com.github.igotyou.FactoryMod.managers.ProductionManager; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.untamedears.citadel.entity.PlayerReinforcement; public class RedstoneListener implements Listener { private FactoryModManager factoryMan; + private ReinforcementManager rm = Citadel.getReinforcementManager(); //this is a lazy fix... private ProductionManager productionMan; @@ -51,8 +44,8 @@ public void leverPlaced(BlockPlaceEvent e) { if (factoryMan.factoryExistsAt(clicked.getLocation())&&factoryMan.factoryWholeAt(clicked.getLocation())) { //if the player is allowed to interact with that block? - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(e.getPlayer()))) + if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || + (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(e.getPlayer()))) { // Allowed } diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 0e46791a..afc6c7c2 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -1,7 +1,5 @@ package com.github.igotyou.FactoryMod.managers; -import static com.untamedears.citadel.Utility.isReinforced; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -9,6 +7,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import org.bukkit.Bukkit; @@ -19,6 +18,9 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; @@ -30,8 +32,6 @@ import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import java.util.Iterator; - //original file: /** * Manager.java @@ -50,6 +50,7 @@ public class NetherFactoryManager implements Manager { + private ReinforcementManager rm = Citadel.getReinforcementManager(); private FactoryModPlugin plugin; private List netherFactorys; private long repairTime; @@ -216,7 +217,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve Location netherLocation1 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+1,startZ); Location netherLocation2 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+2,startZ); Location netherLocation3 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+3,startZ); - if (FactoryModPlugin.CITADEL_ENABLED && (isReinforced(netherLocation) || isReinforced(netherLocation1) || isReinforced(netherLocation2) || isReinforced(netherLocation3))) + if (FactoryModPlugin.CITADEL_ENABLED && (rm.isReinforced(netherLocation) || rm.isReinforced(netherLocation1) || rm.isReinforced(netherLocation2) || rm.isReinforced(netherLocation3))) { for(int scanX = startX-1; scanX <= startX+1 && !locationOk; scanX++) { @@ -229,7 +230,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve netherLocation1 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+1,scanZ); netherLocation2 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+2,scanZ); netherLocation3 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+3,scanZ); - if(!isReinforced(netherLocation) && !isReinforced(netherLocation1) && !isReinforced(netherLocation2) && !isReinforced(netherLocation3)) + if(!rm.isReinforced(netherLocation) && !rm.isReinforced(netherLocation1) && !rm.isReinforced(netherLocation2) && !rm.isReinforced(netherLocation3)) { locationOk = true; From 1d1093f61713fb07b1846bd5dece483567763c76 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Mon, 15 Dec 2014 16:35:40 -0500 Subject: [PATCH 006/459] citadel and namelayer dependency --- plugin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.yml b/plugin.yml index 6527f26a..6186e5b7 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,3 +2,4 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou version: 1.3 +depend: [NameLayer, Citadel] \ No newline at end of file From 49b4a6aaea82bdc8875f6e3c9ef13238d10a19ff Mon Sep 17 00:00:00 2001 From: ribagi Date: Sat, 20 Dec 2014 23:49:16 -0700 Subject: [PATCH 007/459] Change Nether_brick_item in Nether brick factory Change Nether_brick_item in Nether brick factory into Nether_brick and then I div by 4 the output. Nether_brick_item is the item and Nether_brick is the block. After making 150 stacks of blocks I feel the pain. --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 30a17381..55f5f9c5 100644 --- a/config.yml +++ b/config.yml @@ -4472,8 +4472,8 @@ production_recipes: amount: 512 outputs: Nether bricks: - material: NETHER_BRICK_ITEM - amount: 1024 + material: NETHER_BRICK + amount: 256 Bake_clay_blocks: name: Bake Clay Blocks production_time: 32 From 7d87b83528119e8bd56324bead2b4a8a261e72fd Mon Sep 17 00:00:00 2001 From: ribagi Date: Tue, 23 Dec 2014 16:56:32 -0700 Subject: [PATCH 008/459] Added bedrock to disable factory Also fix spelling error. --- config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 55f5f9c5..563841fd 100644 --- a/config.yml +++ b/config.yml @@ -2641,11 +2641,16 @@ nether_factory: amount: 8 display_name: Aspect of Terra lore: A concentrated essence of Terra - Aspect of END: + Aspect of End: material: FLINT amount: 8 display_name: Aspect of End lore: A concentrated essence of the End + Aspect of NOPE: + material: BEDROCK + amount: 8 + display_name: Aspect of NOPE + lore: A concentrated essence of the Nope repair: Diamond block: material: DIAMOND_BLOCK From b285d10c13fa1fa6eb2ca525c51dc8582bd8bfdb Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Wed, 24 Dec 2014 21:26:38 -0500 Subject: [PATCH 009/459] Fixed config Fixed issue with nether factory not giving correct error message. --- config.yml | 7 +------ .../igotyou/FactoryMod/managers/FactoryModManager.java | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 563841fd..f8b00261 100644 --- a/config.yml +++ b/config.yml @@ -94,7 +94,7 @@ nether_general: allow_reinforcement_creation_above_teleport_platform: false allow_block_placement_above_teleport_platform: true teleport_platform_invunerable: false - regenerate_teleport_block_on_teleport: false + regenerate_teleport_block_on_teleport: true remove_blocks_above_teleport_platform_on_teleport: true printing_presses: fuel: @@ -2646,11 +2646,6 @@ nether_factory: amount: 8 display_name: Aspect of End lore: A concentrated essence of the End - Aspect of NOPE: - material: BEDROCK - amount: 8 - display_name: Aspect of NOPE - lore: A concentrated essence of the Nope repair: Diamond block: material: DIAMOND_BLOCK diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 80cd259e..7482bad7 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -64,8 +64,8 @@ private void initializeManagers() //if (FactoryModPlugin.PRODUCTION_ENEABLED) //{ initializeProductionManager(); - initializeNetherFactoryManager(); initializePrintingPressManager(); + initializeNetherFactoryManager(); //} } From 442acfd59edd7dd181231476a3eeeba967b07637 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Wed, 24 Dec 2014 21:27:14 -0500 Subject: [PATCH 010/459] gah increase version --- plugin.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index ac5e00d4..3b8e782e 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,4 +1,4 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.2 +version: 1.2.1 diff --git a/pom.xml b/pom.xml index b35753c9..4ce4cb00 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.0-SNAPSHOT + 1.2.1 FactoryMod https://github.com/ttk2/FactoryMod From 286e8d0342d35227a06dd9897a94eab54684f298 Mon Sep 17 00:00:00 2001 From: danquist Date: Sat, 27 Dec 2014 14:59:40 -0600 Subject: [PATCH 011/459] Disable vanilla portals Uses the config to disable vanilla nether portals --- .../listeners/FactoryModListener.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index c46b8d7a..5288f090 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -4,18 +4,24 @@ import static com.untamedears.citadel.Utility.getReinforcement; import java.util.List; +import java.util.Set; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; @@ -31,6 +37,7 @@ import org.bukkit.event.entity.ExpBottleEvent; import org.bukkit.event.player.PlayerExpChangeEvent; +import org.bukkit.inventory.ItemStack; public class FactoryModListener implements Listener { @@ -411,4 +418,15 @@ else if((southType.getId()== 61 || southType.getId()== 62) && northType.getId()= return response; } + @EventHandler(priority = EventPriority.NORMAL) + public void handlePortalTelportEvent(PlayerPortalEvent e) { + if (e.isCancelled()) { + return; + } + + // Disable normal nether portal teleportation + if (FactoryModPlugin.DISABLE_PORTALS) { + e.setCancelled(true); + } + } } From 2e95620feec9d986693e3211d5044e0493872a89 Mon Sep 17 00:00:00 2001 From: danquist Date: Sat, 27 Dec 2014 15:06:24 -0600 Subject: [PATCH 012/459] Magic number fix alex told me to do this to fix the proximity exception... --- .../igotyou/FactoryMod/managers/NetherFactoryManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 0e46791a..05dec224 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -186,7 +186,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve if (!factoryExistsAt(factoryLocation)) { double scalingFactor = getScalingFactor(factoryLocation); - if (scalingFactor < 10000) + if (scalingFactor < 500) { constructionMaterials = constructionMaterials.getMultiple(scalingFactor); boolean hasMaterials = constructionMaterials.allIn(chestInventory); From 6c75e9497f7c882376af01b89b2d3cb7146df4d6 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sat, 27 Dec 2014 21:32:23 -0500 Subject: [PATCH 013/459] final update --- FactoryMod_NetherBackend_9.3.14.jar | Bin 113479 -> 0 bytes config.yml | 10 ++++---- plugin.yml | 2 +- pom.xml | 24 ++++++++++++++---- .../listeners/FactoryModListener.java | 14 ++++++++++ .../managers/FactoryModManager.java | 2 +- .../managers/NetherFactoryManager.java | 2 +- 7 files changed, 41 insertions(+), 13 deletions(-) delete mode 100644 FactoryMod_NetherBackend_9.3.14.jar diff --git a/FactoryMod_NetherBackend_9.3.14.jar b/FactoryMod_NetherBackend_9.3.14.jar deleted file mode 100644 index eef58607b8ec5dd9c605cfdd1828ce6abdac93ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 113479 zcmZ6SV~}Vum#*8kZQHhO_i5X|KsVU`ro#O9D*W#PDF5FAQ2%<3>}*Xf%;-F9 ztgn66oeo73I!*I&W{ts0MlptJoy~N&RCQEQcrW*Q%m;eE9a(>y7kN}= z^yPFpO>6d8VyEp_+n^1sNscXL{#$1;B5f7F!LWRqfk`nw5s5&w!)cx1KQb|=QpDQ%DxWO@_O z1dM4jZTY5qc4N^WBHTHQ;Coa(vu(u7fl>dmVwRmWa1uQVorbDMTv}=IYtW6KS%mq@ z`7VxCBQo%g{%UqDmxZz}iNECdTAA~w%ggUXqnO8SrlHeIQ8yxf$&2-Cf^Dh}b4{Pd z(4mNHa}#Q+XzxO@(mSR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c@7=QVm1N=IZ{7nHR diff --git a/config.yml b/config.yml index 30a17381..cbc35b43 100644 --- a/config.yml +++ b/config.yml @@ -94,7 +94,7 @@ nether_general: allow_reinforcement_creation_above_teleport_platform: false allow_block_placement_above_teleport_platform: true teleport_platform_invunerable: false - regenerate_teleport_block_on_teleport: false + regenerate_teleport_block_on_teleport: true remove_blocks_above_teleport_platform_on_teleport: true printing_presses: fuel: @@ -2641,7 +2641,7 @@ nether_factory: amount: 8 display_name: Aspect of Terra lore: A concentrated essence of Terra - Aspect of END: + Aspect of End: material: FLINT amount: 8 display_name: Aspect of End @@ -4472,8 +4472,8 @@ production_recipes: amount: 512 outputs: Nether bricks: - material: NETHER_BRICK_ITEM - amount: 1024 + material: NETHER_BRICK + amount: 256 Bake_clay_blocks: name: Bake Clay Blocks production_time: 32 @@ -7556,4 +7556,4 @@ production_recipes: outputs: Eye of Ender: material: EYE_OF_ENDER - amount: 256 + amount: 256 \ No newline at end of file diff --git a/plugin.yml b/plugin.yml index 6186e5b7..880eb6a6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.3 +version: ${project.version} depend: [NameLayer, Citadel] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 991c0a44..992fe740 100644 --- a/pom.xml +++ b/pom.xml @@ -6,9 +6,9 @@ com.github.igotyou FactoryMod jar - 1.3 + 1.3-${build.number} FactoryMod - https://github.com/ttk2/FactoryMod + https://github.com/Civcraft/FactoryMod 1.7 @@ -33,13 +33,19 @@ org.bukkit bukkit - 1.7.2-R0.3 + 1.7.10-R0.1 provided - com.untamedears + vg.civcraft.mc.namelayer + NameLayer + 2.1.1 + provided + + + vg.civcraft.mc.civcraft Citadel - [2.5,) + 3.0.12 provided @@ -49,5 +55,13 @@ bukkit-repo http://repo.bukkit.org/content/groups/public/ + + NameLayer-repo + http://192.99.169.83:8080/plugin/repository/project/NameLayer-master/Build/20/repository/ + + + Citadel-repo + http://192.99.169.83:8080/plugin/repository/project/Citadel-master/Build/38/repository/ + diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index e2295b76..afa788e8 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -7,12 +7,14 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPortalEvent; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; @@ -405,4 +407,16 @@ else if((southType.getId()== 61 || southType.getId()== 62) && northType.getId()= return response; } + @EventHandler(priority = EventPriority.NORMAL) + public void handlePortalTelportEvent(PlayerPortalEvent e) { + if (e.isCancelled()) { + return; + } + + // Disable normal nether portal teleportation + if (FactoryModPlugin.DISABLE_PORTALS) { + e.setCancelled(true); + } + } + } diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 80cd259e..7482bad7 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -64,8 +64,8 @@ private void initializeManagers() //if (FactoryModPlugin.PRODUCTION_ENEABLED) //{ initializeProductionManager(); - initializeNetherFactoryManager(); initializePrintingPressManager(); + initializeNetherFactoryManager(); //} } diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index afc6c7c2..1b9c9a21 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -187,7 +187,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve if (!factoryExistsAt(factoryLocation)) { double scalingFactor = getScalingFactor(factoryLocation); - if (scalingFactor < 10000) + if (scalingFactor < 500) { constructionMaterials = constructionMaterials.getMultiple(scalingFactor); boolean hasMaterials = constructionMaterials.allIn(chestInventory); From 614af864bb3715a27ad173fe34e700aba6999914 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sat, 27 Dec 2014 21:55:32 -0500 Subject: [PATCH 014/459] should fix the pom --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 992fe740..24731ba8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ org.bukkit bukkit - 1.7.10-R0.1 + 1.7.9-R0.1 provided @@ -45,7 +45,7 @@ vg.civcraft.mc.civcraft Citadel - 3.0.12 + 3.0.12-40 provided @@ -61,7 +61,7 @@ Citadel-repo - http://192.99.169.83:8080/plugin/repository/project/Citadel-master/Build/38/repository/ + http://192.99.169.83:8080/plugin/repository/project/Citadel-master/Build/40/repository/ From de895103ca9f8848d7b7ec3d124842f2faa0ba08 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sat, 27 Dec 2014 21:58:22 -0500 Subject: [PATCH 015/459] derp --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24731ba8..cff71679 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ provided - vg.civcraft.mc.civcraft + vg.civcraft.mc.citadel Citadel 3.0.12-40 provided From d2f5a24f44f437f327c1f69c8f3e1fdadcd4bf8e Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sat, 27 Dec 2014 23:03:06 -0500 Subject: [PATCH 016/459] Possible fix for nether portals --- .../FactoryMod/listeners/FactoryModListener.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index afa788e8..51a66dc2 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -15,6 +15,8 @@ import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; @@ -419,4 +421,16 @@ public void handlePortalTelportEvent(PlayerPortalEvent e) { } } + @EventHandler(priority = EventPriority.NORMAL) + public void playerTeleportEvent(PlayerTeleportEvent e) { + if (e.isCancelled() || e.getCause() != TeleportCause.NETHER_PORTAL) { + return; + } + + // Disable normal nether portal teleportation + if (FactoryModPlugin.DISABLE_PORTALS) { + e.setCancelled(true); + } + } + } From f85a4772c34e1c604464e5ff7ef7b2576ab2fdd5 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 28 Dec 2014 17:04:11 -0500 Subject: [PATCH 017/459] Teleports entities to the nether --- plugin.yml | 2 +- pom.xml | 2 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 23 +++++++++++-------- .../FactoryMod/Factorys/NetherFactory.java | 15 +++++++++++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/plugin.yml b/plugin.yml index d31c9c04..4e3cc12d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,5 +2,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: ${project.version} +version: 1.3.1 depend: [NameLayer, Citadel] \ No newline at end of file diff --git a/pom.xml b/pom.xml index cff71679..8beaed13 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3-${build.number} + 1.3.1-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index b43331f3..0aed2723 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -7,17 +7,19 @@ import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.inventory.Recipe; import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; +import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.ShapedRecipe; +import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.inventory.meta.Repairable; -import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; import com.github.igotyou.FactoryMod.interfaces.Properties; @@ -28,14 +30,11 @@ import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; - public class FactoryModPlugin extends JavaPlugin { @@ -83,6 +82,7 @@ public class FactoryModPlugin extends JavaPlugin public void onEnable() { + plugin = this; //load the config.yml initConfig(); //create the main manager @@ -462,4 +462,9 @@ public PrintingPressProperties getPrintingPressProperties() { public NetherFactoryProperties getNetherFactoryProperties() { return netherFactoryProperties; } + + private static FactoryModPlugin plugin; + public static FactoryModPlugin getPlugin(){ + return plugin; + } } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 95fbb45a..cdcb49c3 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -3,8 +3,10 @@ import java.util.ArrayList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -157,7 +159,7 @@ else if (mode == NetherOperationMode.TELEPORT) } } - public List getTeleportationBlockResponse(Player player, Location clickedBlock) + public List getTeleportationBlockResponse(final Player player, Location clickedBlock) { List responses=new ArrayList(); //does the player have acsess to the nether factory via ciatdel? @@ -199,6 +201,17 @@ else if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.NET Location destination = new Location(overworldTeleportPlatform.getWorld(), overworldTeleportPlatform.getX(), overworldTeleportPlatform.getY(), overworldTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); destination.add(0.5, 1.5, 0.5); player.teleport(destination); + final Entity ent = player.getVehicle(); + if (ent != null){ + ent.teleport(destination); + Bukkit.getScheduler().runTask(FactoryModPlugin.getPlugin(), new Runnable(){ + + @Override + public void run() { + ent.setPassenger(player); + } + }); + } if (netherFactoryProperties.getUseFuelOnTeleport()) { getFuel().removeFrom(getPowerSourceInventory()); From 39703e93ab77e3692a80ca085d44237df7bdb347 Mon Sep 17 00:00:00 2001 From: danquist Date: Sun, 28 Dec 2014 18:31:22 -0600 Subject: [PATCH 018/459] Fix portal teleportation End portal teleportation was getting disabled --- .../github/igotyou/FactoryMod/listeners/FactoryModListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 5288f090..400106b1 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -425,7 +425,7 @@ public void handlePortalTelportEvent(PlayerPortalEvent e) { } // Disable normal nether portal teleportation - if (FactoryModPlugin.DISABLE_PORTALS) { + if (e.getCause() == TeleportCause.NETHER_PORTAL && FactoryModPlugin.DISABLE_PORTALS) { e.setCancelled(true); } } From c484eac063178c72f6f5d5af5f364735b17f030b Mon Sep 17 00:00:00 2001 From: "Dr. Andrew Jawa" Date: Fri, 2 Jan 2015 13:49:10 -0500 Subject: [PATCH 019/459] Fixed typo in Craft Eye of Ender Recipe Typ0 was 265 for both blaze power and ender pearl, changed to 256. --- config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 73db8736..7623fc51 100644 --- a/config.yml +++ b/config.yml @@ -7549,11 +7549,11 @@ production_recipes: inputs: Blaze Powder: material: BLAZE_POWDER - amount: 265 + amount: 256 Ender Pearl: material: ENDER_PEARL - amount: 265 + amount: 256 outputs: Eye of Ender: material: EYE_OF_ENDER - amount: 256 + amount: 256 From c31a4775c48cfc6aae1b90ec4492304d1e023f3e Mon Sep 17 00:00:00 2001 From: danquist Date: Mon, 5 Jan 2015 20:52:35 -0600 Subject: [PATCH 020/459] Fix for NullPointerException Fixes NullPointerException if the factory furnace gets broken while the factory is running --- .../github/igotyou/FactoryMod/Factorys/BaseFactory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java index 1f651a3f..00cdfaee 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java @@ -425,7 +425,12 @@ public Location getPowerSourceLocation() */ public boolean isFuelAvailable() { - return getFuel().allIn(getPowerSourceInventory()); + Inventory inv = getPowerSourceInventory(); + if (inv == null) { + return false; + } else { + return getFuel().allIn(inv); + } } /** From 902fae3cc02845283d4acc43ba4c7a9aa4d36b81 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Thu, 8 Jan 2015 10:26:23 -0500 Subject: [PATCH 021/459] fix entities going through the portal --- .../igotyou/FactoryMod/listeners/FactoryModListener.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 7d8798e4..37b7d40f 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -13,6 +13,7 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; @@ -433,4 +434,11 @@ public void playerTeleportEvent(PlayerTeleportEvent e) { } } + @EventHandler(priority = EventPriority.NORMAL) + public void entityTeleportEvent(EntityPortalEvent event){ + if (FactoryModPlugin.DISABLE_PORTALS) { + e.setCancelled(true); + } + } + } From 7df2809c5ed2d8cd02e5fefaa48394ec19b88809 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Thu, 8 Jan 2015 11:27:54 -0500 Subject: [PATCH 022/459] increase version num --- plugin.yml | 2 +- pom.xml | 2 +- .../github/igotyou/FactoryMod/listeners/FactoryModListener.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.yml b/plugin.yml index 4e3cc12d..234c5459 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,5 +2,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.3.1 +version: 1.3.2 depend: [NameLayer, Citadel] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8beaed13..371e8dbb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3.1-${build.number} + 1.3.2-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 37b7d40f..6af08f58 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -437,7 +437,7 @@ public void playerTeleportEvent(PlayerTeleportEvent e) { @EventHandler(priority = EventPriority.NORMAL) public void entityTeleportEvent(EntityPortalEvent event){ if (FactoryModPlugin.DISABLE_PORTALS) { - e.setCancelled(true); + event.setCancelled(true); } } From 081cf2fb9fd5ec29be8341676a1daea99a8d021d Mon Sep 17 00:00:00 2001 From: "Dr. Andrew Jawa" Date: Thu, 15 Jan 2015 09:25:26 -0500 Subject: [PATCH 023/459] Fix type in Produce_Hoppers Was name: Produce_Hoppers Changed to: Produce Hoppers --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 7623fc51..136ac717 100644 --- a/config.yml +++ b/config.yml @@ -4794,7 +4794,7 @@ production_recipes: material: JUKEBOX amount: 64 Produce_Hoppers: - name: Produce_Hoppers + name: Produce Hoppers production_time: 16 inputs: Chest: From 160fbf3cf0f7f2121bee3ec98317abcd0d24dca0 Mon Sep 17 00:00:00 2001 From: spaceFountain Date: Sun, 25 Jan 2015 10:49:15 -0500 Subject: [PATCH 024/459] fixed the check for citadel access --- .../github/igotyou/FactoryMod/Factorys/NetherFactory.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index cdcb49c3..4247d003 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -162,9 +162,8 @@ else if (mode == NetherOperationMode.TELEPORT) public List getTeleportationBlockResponse(final Player player, Location clickedBlock) { List responses=new ArrayList(); - //does the player have acsess to the nether factory via ciatdel? - if ((!FactoryModPlugin.CITADEL_ENABLED || (FactoryModPlugin.CITADEL_ENABLED && rm.getReinforcement(factoryLocation) != null)) || - (((PlayerReinforcement) rm.getReinforcement(factoryLocation)).isAccessible(player))) + //does the player have access to the nether factory via Citadel? + if (!FactoryModPlugin.CITADEL_ENABLED || rm.getReinforcement(factoryLocation) == null || (((PlayerReinforcement) rm.getReinforcement(factoryLocation)).isAccessible(player))) { if (mode == NetherOperationMode.TELEPORT) { @@ -241,7 +240,7 @@ public void run() { } else { - //is the player potentialy holding a security note/ticket? + //is the player potentially holding a security note/ticket? ItemStack itemInHand = player.getItemInHand(); if (itemInHand.getType() == Material.PAPER) { From 28d6896153533f0f84f6747de15247f477633f9b Mon Sep 17 00:00:00 2001 From: spaceFountain Date: Sun, 25 Jan 2015 11:07:19 -0500 Subject: [PATCH 025/459] Updated version --- plugin.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.yml b/plugin.yml index 234c5459..8a7f6727 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou - -version: 1.3.2 -depend: [NameLayer, Citadel] \ No newline at end of file + +version: 1.3.3 +depend: [NameLayer, Citadel] From 5ac3b0e86c88d99beb25fabccd535d44dc4fbfb8 Mon Sep 17 00:00:00 2001 From: spaceFountain Date: Sun, 25 Jan 2015 11:07:48 -0500 Subject: [PATCH 026/459] Updated version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 371e8dbb..3ab8afdf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3.2-${build.number} + 1.3.3-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod From 7f3cd7e64baf1cf48039eab04a12e60fd492f1fc Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 1 Feb 2015 15:47:25 -0500 Subject: [PATCH 027/459] added simple logging of current load ups --- plugin.yml | 3 +-- pom.xml | 2 +- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 2 ++ .../github/igotyou/FactoryMod/managers/FactoryModManager.java | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin.yml b/plugin.yml index 8a7f6727..9b24ec27 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou - -version: 1.3.3 +version: 1.3.4 depend: [NameLayer, Citadel] diff --git a/pom.xml b/pom.xml index 3ab8afdf..493a354b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3.3-${build.number} + 1.3.4-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 0aed2723..f19bdf94 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -113,6 +113,7 @@ public void registerEvents() public void initConfig() { + sendConsoleMessage("Initiaiting FactoryMod Config."); productionProperties = new HashMap(); productionRecipes = new HashMap(); FileConfiguration config = getConfig(); @@ -301,6 +302,7 @@ public void initConfig() ConfigurationSection configNetherFactory=config.getConfigurationSection("nether_factory"); printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); + sendConsoleMessage("Finished initializing FactoryMod Config."); } private List getEnchantments(ConfigurationSection configEnchantments) diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 7482bad7..eccdbcd7 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -45,12 +45,14 @@ public class FactoryModManager */ public FactoryModManager(FactoryModPlugin plugin) { + FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); this.plugin = plugin; FactoryModManager.factoryMan = this; initializeManagers(); loadManagers(); periodicSaving(); + FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); } /** From dd887c22effc392d1bb27786c4556a781e368b19 Mon Sep 17 00:00:00 2001 From: spaceFountain Date: Tue, 3 Feb 2015 17:55:14 -0500 Subject: [PATCH 028/459] added checks for books without titles --- .../FactoryMod/Factorys/PrintingPress.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index fb0a4bce..c5415626 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -479,12 +479,15 @@ private NamedItemStack getPlateResult() { if (meta instanceof BookMeta) { // Found a book BookMeta bookData = (BookMeta) meta; - String title = bookData.getTitle(); - String author = bookData.getAuthor(); + String title = bookData.hasTitle() ? bookData.getTitle() : ""; + String author = bookData.hasAuthor() ? bookData.getAuthor() : ""; if (author == null) { author = ""; } - List pages = new ArrayList(bookData.getPages()); + if (title == null) { + title = ""; + } + List pages = new ArrayList((int)(bookData.hasPages() ? bookData.getPages() : 0)); NamedItemStack plates = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); BookMeta plateMeta = (BookMeta) plates.getItemMeta(); @@ -537,13 +540,22 @@ private class PrintResult { if (match.matches()) { if (meta instanceof BookMeta) { BookMeta bookData = (BookMeta) meta; - title = bookData.getTitle(); - author = bookData.getAuthor(); + if (bookData.hasTitle()) + title = bookData.getTitle(); + if (title == null) + title = ""; + + if (bookData.hasAuthor()) + author = bookData.getAuthor(); if (author == null) { author = ""; } - watermark = Integer.parseInt(match.group(1)); - pages = new ArrayList(bookData.getPages()); + watermark = Integer.parseInt(match.group(1)); + if (bookData.hasPages()) + pages = new ArrayList(bookData.getPages()); + else { + pages = new ArrayList(0); + } valid = true; break; } From fc4f5d7a5e24ced8e8619fa6feb265030b3ffe59 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 8 Feb 2015 10:24:36 -0500 Subject: [PATCH 029/459] Fix nether factories not telling you in disrepair --- .../github/igotyou/FactoryMod/Factorys/NetherFactory.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 4247d003..b2e1c5f0 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -253,6 +253,7 @@ public void run() { { if (active) { + if (!isBroken()||isRepairing()){ if (isFuelAvailable()) { Location playerLocation = player.getLocation(); @@ -307,6 +308,9 @@ else if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.NET { responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is missing fuel! ("+getFuel().getMultiple(1).toString()+")")); } + }else{ + responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is in disrepair.")); + } } else { @@ -615,4 +619,4 @@ public NetherOperationMode getNext() { return NetherOperationMode.byId(nextId); } } -} +} \ No newline at end of file From 080e29817566275b5c35fcbdcf2afc25bc557768 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 8 Feb 2015 10:54:35 -0500 Subject: [PATCH 030/459] missed a spot --- src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index b2e1c5f0..29ded37f 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -169,6 +169,7 @@ public List getTeleportationBlockResponse(final Player play { if (active) { + if (!isBroken()||isRepairing()){ if (isFuelAvailable() || !netherFactoryProperties.getUseFuelOnTeleport()) { Location playerLocation = player.getLocation(); @@ -226,6 +227,9 @@ public void run() { { responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is missing fuel! ("+getFuel().getMultiple(1).toString()+")")); } + }else{ + responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is in disrepair.")); + } } else { From 27cf765d6abea17579079e740e0bb5f85c5e4fb9 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sat, 21 Feb 2015 01:11:34 -0500 Subject: [PATCH 031/459] basic logging of factory create/remove and file load/save --- .../managers/FactoryModManager.java | 4 ++ .../managers/NetherFactoryManager.java | 26 ++++++--- .../managers/PrintingPressManager.java | 57 +++++++++---------- .../managers/ProductionManager.java | 33 +++++++---- 4 files changed, 71 insertions(+), 49 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index eccdbcd7..3343959a 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -153,6 +153,7 @@ public Manager getManager(Class managerType) */ private static void load(Manager managerInterface, File file) { + FactoryModPlugin.sendConsoleMessage("Loading factory manager interface " + Manager.class.getName() + " from file " + file.getPath()); try { managerInterface.load(file); @@ -181,6 +182,8 @@ private static void load(Manager managerInterface, File file) */ private static void save(Manager manager, File file) { + FactoryModPlugin.sendConsoleMessage("Saving factory manager interface " + Manager.class.getName() + " to file " + file.getPath()); + try { File newFile = new File(file.getAbsolutePath() + ".new"); @@ -314,6 +317,7 @@ public Manager getManager(Location location) { public InteractionResponse createFactory(Location centralLocation, Location inventoryLocation, Location powerLocation) { + FactoryModPlugin.sendConsoleMessage("Attempting to create factory centered at " + centralLocation); InteractionResponse response = null; for (Manager manager : managers) { diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 1b9c9a21..ef2913fc 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -196,7 +196,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve boolean markerFound = false; Location markerLocation = factoryLocation.clone(); int blockY = markerLocation.getBlockY(); - for (int centerY = blockY-plugin.NETHER_MARKER_MAX_DISTANCE; centerY <= blockY+plugin.NETHER_MARKER_MAX_DISTANCE && !markerFound; centerY++) + for (int centerY = blockY - FactoryModPlugin.NETHER_MARKER_MAX_DISTANCE; centerY <= blockY + FactoryModPlugin.NETHER_MARKER_MAX_DISTANCE && !markerFound; centerY++) { markerLocation.setY(centerY); Location oneUp = markerLocation.clone(); @@ -308,10 +308,12 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(netherFactory.getOverworldTeleportPlatform()) )) { netherFactorys.add(netherFactory); + FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { + FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } @@ -352,23 +354,31 @@ public boolean factoryWholeAt(Location factoryLocation) public void removeFactory(Factory factory) { - netherFactorys.remove((NetherFactory)factory); + if(!(factory instanceof NetherFactory)) { + FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); + return; + } + + NetherFactory netherFactory = (NetherFactory)factory; + netherFactorys.remove(netherFactory); + FactoryModPlugin.sendConsoleMessage("Nether factory removed: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); } public void updateRepair(long time) { - for (NetherFactory factory: netherFactorys) + for (NetherFactory factory : netherFactorys) { - factory.updateRepair(time/((double)FactoryModPlugin.REPAIR_PERIOD)); + factory.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); } - long currentTime=System.currentTimeMillis(); - Iterator itr=netherFactorys.iterator(); + long currentTime = System.currentTimeMillis(); + Iterator itr = netherFactorys.iterator(); while(itr.hasNext()) { - NetherFactory factory=itr.next(); - if(currentTime>(factory.getTimeDisrepair()+FactoryModPlugin.DISREPAIR_PERIOD)) + NetherFactory factory = itr.next(); + if(currentTime > (factory.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { itr.remove(); + FactoryModPlugin.sendConsoleMessage("Nether factory removed due to disrepair: " + factory.factoryName() + " at " + factory.getCenterLocation()); } } } diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 464cdfaa..2e8c2de2 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -1,42 +1,31 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStreamReader; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.OutputStreamWriter; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Iterator; import java.util.List; -import java.util.Map; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import java.util.Iterator; //original file: /** @@ -57,13 +46,13 @@ public class PrintingPressManager implements Manager { private FactoryModPlugin plugin; - private List producers; + private List presses; private long repairTime; public PrintingPressManager(FactoryModPlugin plugin) { this.plugin = plugin; - producers = new ArrayList(); + presses = new ArrayList(); //Set maintenance clock to 0 updateFactorys(); } @@ -77,8 +66,8 @@ public void save(File file) throws IOException ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); int version = 1; oos.writeInt(version); - oos.writeInt(producers.size()); - for (PrintingPress production : producers) + oos.writeInt(presses.size()); + for (PrintingPress production : presses) { //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number @@ -180,7 +169,7 @@ public void updateFactorys() @Override public void run() { - for (PrintingPress production: producers) + for (PrintingPress production: presses) { production.update(); } @@ -215,22 +204,24 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve public InteractionResponse addFactory(Factory factory) { - PrintingPress production = (PrintingPress) factory; - if (production.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(production.getCenterLocation())) - || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) + PrintingPress press = (PrintingPress) factory; + if (press.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(press.getCenterLocation())) + || !factoryExistsAt(press.getInventoryLocation()) || !factoryExistsAt(press.getPowerSourceLocation())) { - producers.add(production); + presses.add(press); + FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.factoryName() + " at " + press.getCenterLocation()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { + FactoryModPlugin.sendConsoleMessage("Printing press failed to create: " + press.factoryName() + " at " + press.getCenterLocation()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } public PrintingPress getFactory(Location factoryLocation) { - for (PrintingPress production : producers) + for (PrintingPress production : presses) { if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) || production.getPowerSourceLocation().equals(factoryLocation)) @@ -261,23 +252,31 @@ public boolean factoryWholeAt(Location factoryLocation) public void removeFactory(Factory factory) { - producers.remove((ProductionFactory)factory); + if(!(factory instanceof PrintingPress)) { + FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); + return; + } + + PrintingPress press = (PrintingPress)factory; + presses.remove(press); + FactoryModPlugin.sendConsoleMessage("Printing press removed: " + press.factoryName() + " at " + press.getCenterLocation()); } public void updateRepair(long time) { - for (PrintingPress production: producers) + for (PrintingPress press : presses) { - production.updateRepair(time/((double)FactoryModPlugin.REPAIR_PERIOD)); + press.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); } - long currentTime=System.currentTimeMillis(); - Iterator itr=producers.iterator(); + long currentTime = System.currentTimeMillis(); + Iterator itr = presses.iterator(); while(itr.hasNext()) { - PrintingPress producer=itr.next(); - if(currentTime>(producer.getTimeDisrepair()+FactoryModPlugin.DISREPAIR_PERIOD)) + PrintingPress press = itr.next(); + if(currentTime > (press.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { itr.remove(); + FactoryModPlugin.sendConsoleMessage("Printing press removed due to disrepair: " + press.factoryName() + " at " + press.getCenterLocation()); } } } diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index 0085443f..08a7b27f 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -25,14 +26,12 @@ import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; -import com.github.igotyou.FactoryMod.interfaces.Recipe; import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import java.util.Iterator; //original file: /** @@ -197,7 +196,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve { if (!factoryExistsAt(factoryLocation)) { - HashMap properties = plugin.productionProperties; + HashMap properties = FactoryModPlugin.productionProperties; Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); @@ -229,7 +228,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve { if (!factoryExistsAt(factoryLocation)) { - HashMap properties = plugin.productionProperties; + HashMap properties = FactoryModPlugin.productionProperties; Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); @@ -268,10 +267,12 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) { producers.add(production); + FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.factoryName() + " at " + production.getCenterLocation()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { + FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + production.factoryName() + " at " + production.getCenterLocation()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } @@ -309,23 +310,31 @@ public boolean factoryWholeAt(Location factoryLocation) public void removeFactory(Factory factory) { - producers.remove((ProductionFactory)factory); + if(!(factory instanceof ProductionFactory)) { + FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); + return; + } + + ProductionFactory producer = (ProductionFactory)factory; + producers.remove(producer); + FactoryModPlugin.sendConsoleMessage("Production factory removed: " + producer.factoryName() + " at " + producer.getCenterLocation()); } public void updateRepair(long time) { - for (ProductionFactory production: producers) + for (ProductionFactory production : producers) { - production.updateRepair(time/((double)FactoryModPlugin.REPAIR_PERIOD)); + production.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); } - long currentTime=System.currentTimeMillis(); - Iterator itr=producers.iterator(); + long currentTime = System.currentTimeMillis(); + Iterator itr = producers.iterator(); while(itr.hasNext()) { - ProductionFactory producer=itr.next(); - if(currentTime>(producer.getTimeDisrepair()+FactoryModPlugin.DISREPAIR_PERIOD)) + ProductionFactory producer = itr.next(); + if(currentTime > (producer.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { itr.remove(); + FactoryModPlugin.sendConsoleMessage("Production factory removed due to disrepair: " + producer.factoryName() + " at " + producer.getCenterLocation()); } } } From 21bb85b960e6b2ba4f2565b35ab2ef8063e92473 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sat, 21 Feb 2015 13:52:56 -0500 Subject: [PATCH 032/459] factory creation logging and cleanup --- .../listeners/FactoryModListener.java | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 6af08f58..d5e5cfb7 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -64,6 +64,17 @@ public void blockBreakEvent(BlockBreakEvent e) //if the blocks is not reinforced destroy it if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) { + if(e.getPlayer() == null) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") + .append(e.getEventName()).append(" at ").append(block.getLocation()) + .toString()); + } + else + { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") + .append(e.getEventName()).append(" by ").append(e.getPlayer().getUniqueId()).append(" at ").append(block.getLocation()) + .toString()); + } destroyFactoryAt(block); } } @@ -97,9 +108,11 @@ public void explosionListener(EntityExplodeEvent e) { if (factoryMan.factoryExistsAt(block.getLocation())) { - Factory factory = factoryMan.getFactory(block.getLocation()); if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block exploded: ") + .append(e.getEventName()).append(" by ").append(e.getEntityType()).append(" at ").append(block.getLocation()) + .toString()); destroyFactoryAt(block); } } @@ -119,6 +132,9 @@ public void burnListener(BlockBurnEvent e) { if (factoryMan.factoryExistsAt(block.getLocation())) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block burned: ") + .append(e.getEventName()).append(" at ").append(block.getLocation()) + .toString()); destroyFactoryAt(block); } } @@ -379,13 +395,13 @@ private InteractionResponse createFactory(Location loc, Player player) InteractionResponse response=new InteractionResponse(InteractionResult.FAILURE, "Blocks are not arranged correctly for a factory."); if(! factoryMan.factoryExistsAt(westLocation) && ! factoryMan.factoryExistsAt(eastLocation)) { - if((westType.getId()== 61 || westType.getId() == 62) && eastType.getId()== 54) + if((westType == Material.FURNACE || westType == Material.BURNING_FURNACE) && eastType == Material.CHEST) { - return factoryMan.createFactory(loc, eastLocation, westLocation); + return createFactory(player, loc, eastLocation, westLocation); } - else if ((eastType.getId()== 61 || eastType.getId()== 62) && westType.getId()== 54) + else if ((eastType == Material.FURNACE || eastType == Material.BURNING_FURNACE) && westType == Material.CHEST) { - return factoryMan.createFactory(loc, westLocation, eastLocation); + return createFactory(player, loc, westLocation, eastLocation); } } else @@ -394,13 +410,14 @@ else if ((eastType.getId()== 61 || eastType.getId()== 62) && westType.getId()== } if(! factoryMan.factoryExistsAt(southLocation) && !factoryMan.factoryExistsAt(northLocation)) { - if((northType.getId()== 61 || northType.getId()== 62) && southType.getId()== 54) + + if((northType == Material.FURNACE || northType == Material.BURNING_FURNACE) && southType == Material.CHEST) { - return factoryMan.createFactory(loc, southLocation, northLocation); + return createFactory(player, loc, southLocation, northLocation); } - else if((southType.getId()== 61 || southType.getId()== 62) && northType.getId()== 54) + else if((southType == Material.FURNACE || southType == Material.BURNING_FURNACE) && northType == Material.CHEST) { - return factoryMan.createFactory(loc, northLocation, southLocation); + return createFactory(player, loc, northLocation, southLocation); } } else @@ -410,6 +427,14 @@ else if((southType.getId()== 61 || southType.getId()== 62) && northType.getId()= return response; } + private InteractionResponse createFactory(Player player, Location center, Location inventory, Location power) { + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") + .append(player.getUniqueId()).append(" at ").append(center) + .toString()); + return factoryMan.createFactory(center, inventory, power); + } + @EventHandler(priority = EventPriority.NORMAL) public void handlePortalTelportEvent(PlayerPortalEvent e) { if (e.isCancelled()) { From b984a7292e10fd8759758371fc2447e8034891ab Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Thu, 26 Feb 2015 10:01:16 -0500 Subject: [PATCH 033/459] allow entities to go to the nether --- .../FactoryMod/Factorys/NetherFactory.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 29ded37f..463dc541 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -185,8 +185,19 @@ public List getTeleportationBlockResponse(final Player play removeBlocksAboveTeleportPlatform(netherTeleportPlatform); } Location destination = new Location(netherTeleportPlatform.getWorld(), netherTeleportPlatform.getX(), netherTeleportPlatform.getY(), netherTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); - destination.add(0.5, 1.5, 0.5); + destination.add(0.5, 1.5, 0.5); + final Entity ent = player.getVehicle(); player.teleport(destination); + if (ent != null){ + ent.teleport(destination); + Bukkit.getScheduler().runTask(FactoryModPlugin.getPlugin(), new Runnable(){ + + @Override + public void run() { + ent.setPassenger(player); + } + }); + } if (netherFactoryProperties.getUseFuelOnTeleport()) { getFuel().removeFrom(getPowerSourceInventory()); @@ -200,8 +211,8 @@ else if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.NET } Location destination = new Location(overworldTeleportPlatform.getWorld(), overworldTeleportPlatform.getX(), overworldTeleportPlatform.getY(), overworldTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); destination.add(0.5, 1.5, 0.5); - player.teleport(destination); final Entity ent = player.getVehicle(); + player.teleport(destination); if (ent != null){ ent.teleport(destination); Bukkit.getScheduler().runTask(FactoryModPlugin.getPlugin(), new Runnable(){ From 6aacd56ade3caa5d9404c6a8b0937b1665cb4d48 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sat, 28 Feb 2015 01:56:08 -0500 Subject: [PATCH 034/459] #46 factory logging enhancements --- .../FactoryMod/Factorys/PrintingPress.java | 25 ++++++++++++----- .../listeners/FactoryModListener.java | 19 ++++++++++--- .../managers/FactoryModManager.java | 5 ++-- .../managers/NetherFactoryManager.java | 22 ++++++++++++--- .../managers/PrintingPressManager.java | 20 +++++++++++--- .../managers/ProductionManager.java | 27 +++++++++++++------ .../{PrettyLore.java => StringUtils.java} | 12 ++++++++- 7 files changed, 100 insertions(+), 30 deletions(-) rename src/com/github/igotyou/FactoryMod/utility/{PrettyLore.java => StringUtils.java} (83%) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index c5415626..b052b64e 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -13,20 +13,23 @@ import org.bukkit.inventory.meta.BookMeta; import org.bukkit.inventory.meta.ItemMeta; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.FactoryObject; -import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.PrettyLore; +import com.github.igotyou.FactoryMod.utility.StringUtils; public class PrintingPress extends BaseFactory { private PrintingPressProperties printingPressProperties; + + public PrintingPressProperties getProperties() { + return printingPressProperties; + } + private OperationMode mode; + public OperationMode getMode() { return mode; } @@ -135,6 +138,8 @@ public ItemList getInputs() { inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); } break; + default: + break; } return inputs; } @@ -149,6 +154,8 @@ public ItemList getOutputs() { outputs.add(plates); } break; + default: + break; } return outputs; } @@ -160,6 +167,8 @@ public ItemList getRepairs() { case REPAIR: inputs.addAll(printingPressProperties.getRepairMaterials()); break; + default: + break; } return inputs; } @@ -215,6 +224,8 @@ public void fuelConsumed() { case PRINT_SECURITY: printSecurityUpdate(); break; + default: + break; } } @@ -622,10 +633,10 @@ private List filterPageLore(String lore) { lore = lore.replaceAll("[ \r\n]+", " "); // Limit length - lore = PrettyLore.limitLengthEllipsis(lore, PAGE_LORE_LENGTH_LIMIT); + lore = StringUtils.limitLengthEllipsis(lore, PAGE_LORE_LENGTH_LIMIT); // Split in to lines based on length - List lines = PrettyLore.splitLines(lore, PAGE_LORE_LINE_LIMIT); + List lines = StringUtils.splitLines(lore, PAGE_LORE_LINE_LIMIT); return lines; } diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index d5e5cfb7..97884205 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -28,6 +28,7 @@ import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.managers.FactoryModManager; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public class FactoryModListener implements Listener @@ -429,9 +430,21 @@ else if((southType == Material.FURNACE || southType == Material.BURNING_FURNACE) private InteractionResponse createFactory(Player player, Location center, Location inventory, Location power) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") - .append(player.getUniqueId()).append(" at ").append(center) - .toString()); + if(rm.isReinforced(center)) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") + .append(player.getUniqueId()) + .append(" with group ") + .append(((PlayerReinforcement)rm.getReinforcement(center)).getGroup().getName()) + .append(" at ") + .append(StringUtils.formatCoords(center)) + .toString()); + } else { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") + .append(player.getUniqueId()) + .append(" at ") + .append(StringUtils.formatCoords(center)) + .toString()); + } return factoryMan.createFactory(center, inventory, power); } diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 3343959a..baf1cc86 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -153,7 +153,6 @@ public Manager getManager(Class managerType) */ private static void load(Manager managerInterface, File file) { - FactoryModPlugin.sendConsoleMessage("Loading factory manager interface " + Manager.class.getName() + " from file " + file.getPath()); try { managerInterface.load(file); @@ -182,7 +181,6 @@ private static void load(Manager managerInterface, File file) */ private static void save(Manager manager, File file) { - FactoryModPlugin.sendConsoleMessage("Saving factory manager interface " + Manager.class.getName() + " to file " + file.getPath()); try { @@ -317,7 +315,6 @@ public Manager getManager(Location location) { public InteractionResponse createFactory(Location centralLocation, Location inventoryLocation, Location powerLocation) { - FactoryModPlugin.sendConsoleMessage("Attempting to create factory centered at " + centralLocation); InteractionResponse response = null; for (Manager manager : managers) { @@ -327,6 +324,8 @@ public InteractionResponse createFactory(Location centralLocation, return response; } } + + FactoryModPlugin.sendConsoleMessage("The factory could not be created: " + response.getInteractionMessage()); return response; } } diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index ef2913fc..b8143dd9 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -31,6 +31,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.StringUtils; //original file: /** @@ -308,12 +309,12 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(netherFactory.getOverworldTeleportPlatform()) )) { netherFactorys.add(netherFactory); - FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.getProperties().getName()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { - FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + netherFactory.getProperties().getName()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } @@ -360,8 +361,15 @@ public void removeFactory(Factory factory) } NetherFactory netherFactory = (NetherFactory)factory; + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Nether factory removed: ") + .append(netherFactory.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(netherFactory.getCenterLocation())) + .toString()); + netherFactorys.remove(netherFactory); - FactoryModPlugin.sendConsoleMessage("Nether factory removed: " + netherFactory.factoryName() + " at " + netherFactory.getCenterLocation()); + } public void updateRepair(long time) @@ -377,8 +385,14 @@ public void updateRepair(long time) NetherFactory factory = itr.next(); if(currentTime > (factory.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Nether factory removed due to disrepair: ") + .append(factory.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(factory.getCenterLocation())) + .toString()); + itr.remove(); - FactoryModPlugin.sendConsoleMessage("Nether factory removed due to disrepair: " + factory.factoryName() + " at " + factory.getCenterLocation()); + } } } diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 2e8c2de2..66ef5f9b 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -26,6 +26,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.StringUtils; //original file: /** @@ -209,12 +210,12 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(press.getInventoryLocation()) || !factoryExistsAt(press.getPowerSourceLocation())) { presses.add(press); - FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.factoryName() + " at " + press.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.getProperties().getName()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { - FactoryModPlugin.sendConsoleMessage("Printing press failed to create: " + press.factoryName() + " at " + press.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Printing press failed to create: " + press.getProperties().getName()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } @@ -258,8 +259,14 @@ public void removeFactory(Factory factory) } PrintingPress press = (PrintingPress)factory; + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Printing press removed: ") + .append(press.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(press.getCenterLocation())) + .toString()); + presses.remove(press); - FactoryModPlugin.sendConsoleMessage("Printing press removed: " + press.factoryName() + " at " + press.getCenterLocation()); } public void updateRepair(long time) @@ -275,8 +282,13 @@ public void updateRepair(long time) PrintingPress press = itr.next(); if(currentTime > (press.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Printing press removed due to disrepair: ") + .append(press.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(press.getCenterLocation())) + .toString()); + itr.remove(); - FactoryModPlugin.sendConsoleMessage("Printing press removed due to disrepair: " + press.factoryName() + " at " + press.getCenterLocation()); } } } diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index 08a7b27f..df45c94d 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -9,7 +9,6 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -32,6 +31,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.StringUtils; //original file: /** @@ -196,7 +196,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve { if (!factoryExistsAt(factoryLocation)) { - HashMap properties = FactoryModPlugin.productionProperties; + Map properties = FactoryModPlugin.productionProperties; Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); @@ -228,7 +228,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve { if (!factoryExistsAt(factoryLocation)) { - HashMap properties = FactoryModPlugin.productionProperties; + Map properties = FactoryModPlugin.productionProperties; Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); @@ -267,12 +267,12 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) { producers.add(production); - FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.factoryName() + " at " + production.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.getProductionFactoryProperties().getName()); return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { - FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + production.factoryName() + " at " + production.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + production.getProductionFactoryProperties().getName()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } @@ -316,8 +316,14 @@ public void removeFactory(Factory factory) } ProductionFactory producer = (ProductionFactory)factory; + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Production factory removed: ") + .append(producer.getProductionFactoryProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(producer.getCenterLocation())) + .toString()); + producers.remove(producer); - FactoryModPlugin.sendConsoleMessage("Production factory removed: " + producer.factoryName() + " at " + producer.getCenterLocation()); } public void updateRepair(long time) @@ -333,8 +339,13 @@ public void updateRepair(long time) ProductionFactory producer = itr.next(); if(currentTime > (producer.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) { - itr.remove(); - FactoryModPlugin.sendConsoleMessage("Production factory removed due to disrepair: " + producer.factoryName() + " at " + producer.getCenterLocation()); + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Production factory removed due to disrepair: ") + .append(producer.getProductionFactoryProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(producer.getCenterLocation())) + .toString()); + + itr.remove(); } } } diff --git a/src/com/github/igotyou/FactoryMod/utility/PrettyLore.java b/src/com/github/igotyou/FactoryMod/utility/StringUtils.java similarity index 83% rename from src/com/github/igotyou/FactoryMod/utility/PrettyLore.java rename to src/com/github/igotyou/FactoryMod/utility/StringUtils.java index 69dbe58f..3e0fe3f3 100644 --- a/src/com/github/igotyou/FactoryMod/utility/PrettyLore.java +++ b/src/com/github/igotyou/FactoryMod/utility/StringUtils.java @@ -3,7 +3,17 @@ import java.util.ArrayList; import java.util.List; -public class PrettyLore { +import org.bukkit.Location; + +public class StringUtils { + + /** + * Formats a Location's coordinates as "world (x y z)" + */ + public static String formatCoords(Location loc) { + return String.format("%s (%d %d %d)", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockX(), loc.getBlockZ()); + } + public static List splitLines(String paragraph, int lineLength) { List lines = new ArrayList(); int lineStart = 0; From 3a725e2cb2e56886acabd889118b006c770b59e5 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Mon, 2 Mar 2015 21:14:52 -0500 Subject: [PATCH 035/459] #46 final factory logging enhancements --- .../FactoryMod/Factorys/BaseFactory.java | 15 ++++++++++---- .../listeners/FactoryModListener.java | 20 +++++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java index 00cdfaee..5cbee54b 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java @@ -23,6 +23,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public abstract class BaseFactory extends FactoryObject implements Factory { @@ -434,14 +435,20 @@ public boolean isFuelAvailable() } /** - * Called by the block listener when the player(or a entity) destroys the fatory - * Drops the build materials if the config says it shouls + * Called by the block listener when the player(or a entity) destroys the factory + * Drops the build materials if the config says it should */ public void destroy(Location destroyLocation) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory destroyed: ") + .append(subFactoryType) + .append(" at ") + .append(StringUtils.formatCoords(getCenterLocation())) + .toString()); + powerOff(); - currentRepair=getMaxRepair(); - timeDisrepair=System.currentTimeMillis(); + currentRepair = getMaxRepair(); + timeDisrepair = System.currentTimeMillis(); } /* * Repairs the factory diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 97884205..aa683e9d 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -67,13 +67,19 @@ public void blockBreakEvent(BlockBreakEvent e) { if(e.getPlayer() == null) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") - .append(e.getEventName()).append(" at ").append(block.getLocation()) + .append(e.getBlock().getType()) + .append(" at ") + .append(StringUtils.formatCoords(block.getLocation())) .toString()); } else { FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") - .append(e.getEventName()).append(" by ").append(e.getPlayer().getUniqueId()).append(" at ").append(block.getLocation()) + .append(e.getBlock().getType()) + .append(" by ") + .append(e.getPlayer().getUniqueId()) + .append(" at ") + .append(StringUtils.formatCoords(block.getLocation())) .toString()); } destroyFactoryAt(block); @@ -112,7 +118,11 @@ public void explosionListener(EntityExplodeEvent e) if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block exploded: ") - .append(e.getEventName()).append(" by ").append(e.getEntityType()).append(" at ").append(block.getLocation()) + .append(block.getType()) + .append(" by ") + .append(e.getEntityType()) + .append(" at ") + .append(StringUtils.formatCoords(block.getLocation())) .toString()); destroyFactoryAt(block); } @@ -134,7 +144,9 @@ public void burnListener(BlockBurnEvent e) if (factoryMan.factoryExistsAt(block.getLocation())) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block burned: ") - .append(e.getEventName()).append(" at ").append(block.getLocation()) + .append(block.getType()) + .append(" at ") + .append(StringUtils.formatCoords(block.getLocation())) .toString()); destroyFactoryAt(block); } From 3b3e339fbc55e08fed10d56d74451b82f5285d68 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 7 Mar 2015 00:04:10 -0500 Subject: [PATCH 036/459] Printing Press better reporting pass 1: adding significant edge case logging. Will be a bit verbose; needs feedback on existing default logging level. --- .../FactoryMod/Factorys/BaseFactory.java | 10 +- .../FactoryMod/Factorys/PrintingPress.java | 96 ++++++++++++++++--- 2 files changed, 90 insertions(+), 16 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java index 5cbee54b..b0142915 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java @@ -3,6 +3,9 @@ import java.util.ArrayList; import java.util.List; +import java.util.logging.Logger; +import java.util.logging.Level; + import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -34,6 +37,8 @@ public abstract class BaseFactory extends FactoryObject implements Factory { protected double currentRepair; protected long timeDisrepair;//The time at which the factory went into disrepair + private Logger log = Logger.getLogger(BaseFactory.class.getName()); + public BaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, FactoryType factoryType, String subFactoryType) { @@ -177,10 +182,13 @@ public List togglePower() //[Requires one of the following: Amount Name, Amount Name.] ItemList needAll=new ItemList(); - needAll.addAll(getAllInputs().getDifference(getInventory())); + ItemList allInputs = getAllInputs(); + needAll.addAll(allInputs.getDifference(getInventory())); if(!needAll.isEmpty()) { response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); + } else if (allInputs == null || allInputs.isEmpty()) { + log.log(Level.WARNING, "getAllInputs() returned null or empty; recipe is returning no expectation of input!"); } return response; } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index b052b64e..71524711 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -6,6 +6,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.logging.Logger; +import java.util.logging.Level; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.inventory.Inventory; @@ -23,6 +26,8 @@ public class PrintingPress extends BaseFactory { private PrintingPressProperties printingPressProperties; + + private static Logger log = Logger.getLogger(PrintingPress.class.getName()); public PrintingPressProperties getProperties() { return printingPressProperties; @@ -73,9 +78,6 @@ public PrintingPress(Location factoryLocation, this.containedPaper = containedPaper; this.containedBindings = containedBindings; this.containedSecurityMaterials = containedSecurityMaterials; - this.containedPaper = 0; - this.containedBindings = 0; - this.containedSecurityMaterials = 0; this.processQueue = processQueue; this.processQueueOffset = 0; this.lockedResultCode = lockedResultCode; @@ -115,6 +117,8 @@ public double getProductionTime() { int pageCount = 1; if (plates != null) { pageCount = Math.max(1, ((BookMeta) plates.getItemMeta()).getPageCount()); + } else { + log.info("getProductionTime(): plates == null"); } pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); return printingPressProperties.getSetPlateTime() * pageCount; @@ -136,6 +140,8 @@ public ItemList getInputs() { int pageCount = ((BookMeta) plates.getItemMeta()).getPageCount(); pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); + } else { + log.info("getInputs(): plates == null"); } break; default: @@ -152,6 +158,8 @@ public ItemList getOutputs() { NamedItemStack plates = getPlateResult(); if (plates != null) { outputs.add(plates); + } else { + log.info("getOutputs(): Plates results are null!"); } break; default: @@ -443,6 +451,13 @@ public List getCentralBlockResponse() return responses; } + /** + * On interaction with the factory chest, return context-appropriate information + * concerning the current mode, relative to the inputs and outputs. + * + * @return A {@link List} of {@link InteractionResponse} objects containing + * details on the current mode. + */ public List getChestResponse() { List responses=new ArrayList(); @@ -454,31 +469,57 @@ public List getChestResponse() responses.add(new InteractionResponse(InteractionResult.SUCCESS, printingPressProperties.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); //RecipeName: X seconds(Y ticks)[ - XX% done.] responses.add(new InteractionResponse(InteractionResult.SUCCESS, mode.getDescription())); + + // Never call the same function more than once, especially when this complex. + ItemList getInputs = getInputs(); //[Inputs: amount Name, amount Name.] - if(!getInputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs().toString()+".")); + if(getInputs != null && !getInputs.isEmpty()) { + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs.toString()+".")); + } else { + log.log(Level.WARNING, "getChestResponse(): Inputs is null or empty!"); } + //[Outputs: amount Name, amount Name.] - if(!getOutputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs().toString()+".")); + ItemList getOutputs = getOutputs(); + if(getOutputs != null && !getOutputs.isEmpty()) { + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs.toString()+".")); + } else { + log.log(Level.WARNING, "getChestResponse(): Outputs is null or empty!"); } + //[Will repair XX% of the factory] - if(!getRepairs().isEmpty()&&maintenanceActive) - { - int amountAvailable=getRepairs().amountAvailable(getInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/printingPressProperties.getMaxRepair()*100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); + ItemList getRepairs = getRepairs(); + if(getRepairs != null && !getRepairs.isEmpty() && maintenanceActive) { + int amountAvailable = getRepairs.amountAvailable(getInventory()); + int amountRepaired = amountAvailable > currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; + int percentRepaired = (int) (( (double) amountRepaired) / printingPressProperties.getMaxRepair() * 100); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Will repair " + + String.valueOf(percentRepaired) + "% of the factory with " + + getRepairs.getMultiple(amountRepaired).toString() + ".")); } return responses; } + /** + * Generates a new PrintResult object based on the current production state of the factory, + * reflecting the active mode's output. This does not include plates, which are handled + * separately. + * + * @return {@link PrintResult} object reflecting the current state production state of the + * factory. + */ private PrintResult getPrintResult() { return new PrintResult(); } + /** + * Generates a NamedItemStack containing a 'plate' -- a signed book with lore that + * uniquely reflects the book given as input. This plate can then be used to produce + * copies of the book, security notes, pamphlets, and the like. + * + * @return {@link NamedItemStack} of a Signed Book with lore containing the contents of + * the given input book, and other important metadata. + */ private NamedItemStack getPlateResult() { for (ItemStack stack : getInventory().getContents()) { if (stack == null) { @@ -486,8 +527,10 @@ private NamedItemStack getPlateResult() { } if (stack.getType().equals(Material.BOOK_AND_QUILL) || stack.getType().equals(Material.WRITTEN_BOOK)) { + log.info("getPlateResult(): Found a book in the factory to use as plate source."); ItemMeta meta = stack.getItemMeta(); if (meta instanceof BookMeta) { + log.info("getPlateResult(): Book found has Metadata associated."); // Found a book BookMeta bookData = (BookMeta) meta; String title = bookData.hasTitle() ? bookData.getTitle() : ""; @@ -511,9 +554,12 @@ private NamedItemStack getPlateResult() { plateMeta.setLore(lore); plates.setItemMeta(plateMeta); return plates; + } else { + log.log(Level.WARNING, "getPlateResult(): Book found, but no associated metadata."); } } } + log.log(Level.WARNING, "getPlateResult(): No book found for plate source."); return null; } @@ -526,6 +572,12 @@ private class PrintResult { private int watermark; private boolean valid; + /** + * Initializes a PrintResult leveraging the contents and state of the + * {@link PrintingPress}. Attempts to find a valid Print plate in the factory, then + * extracts the information from the Plate necessary to produce books, + * pamphlets, or security notes. + */ PrintResult() { Pattern printPlateRE = Pattern.compile("^Print plates #([0-9]{4})$"); Inventory inventory = getInventory(); @@ -543,13 +595,17 @@ private class PrintResult { if (stack.getType().equals(Material.BOOK_AND_QUILL) || stack.getType().equals(Material.WRITTEN_BOOK)) { + log.info("PrintResult(): Found a book item."); ItemMeta meta = stack.getItemMeta(); List lore = meta.getLore(); if (lore != null && !lore.isEmpty()) { + log.info("PrintResult(): Found a lore item attached to the book."); String firstLore = lore.get(0); Matcher match = printPlateRE.matcher(firstLore); if (match.matches()) { + log.info("PrintResult(): Lore matches a print plate."); if (meta instanceof BookMeta) { + log.info("PrintResult(): Book has Associated Book Meta."); BookMeta bookData = (BookMeta) meta; if (bookData.hasTitle()) title = bookData.getTitle(); @@ -569,11 +625,21 @@ private class PrintResult { } valid = true; break; + } else { + log.log(Level.WARNING, "PrintResult(): No Book Meta found!"); } + } else { + log.log(Level.WARNING, "PrintResult(): Lore indicates the book is not a print plate."); } + } else { + log.log(Level.WARNING, "PrintResult(): No lore item found with the book."); } } } + + if (!valid) { + log.log(Level.WARNING, "PrintResult(): No valid plate found in the factory."); + } } public boolean isValid() { From 956af1c5c99fa46367ade5085d7103da5d6e8e52 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 7 Mar 2015 19:34:43 -0500 Subject: [PATCH 037/459] Addressing Class Cast exception in stack trace; bug introduced in commit dd887c22effc392... --- .../github/igotyou/FactoryMod/Factorys/PrintingPress.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index 71524711..9bcf964c 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -541,7 +541,12 @@ private NamedItemStack getPlateResult() { if (title == null) { title = ""; } - List pages = new ArrayList((int)(bookData.hasPages() ? bookData.getPages() : 0)); + List pages = new ArrayList(); + if (bookData.hasPages()) { + pages.addAll(bookData.getPages()); + } else { + log.info("getPlateResult(): Book found has no pages."); + } NamedItemStack plates = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); BookMeta plateMeta = (BookMeta) plates.getItemMeta(); From b5713438c7780a8365976e92dbdc5141988029d5 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 7 Mar 2015 20:29:04 -0500 Subject: [PATCH 038/459] Addressing divide by zero bugs and empty book issue that causes it. Might have missed something, but thanks to Erocs should have the big ones covered. --- .../FactoryMod/Factorys/PrintingPress.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index 9bcf964c..0ea626da 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -138,8 +138,10 @@ public ItemList getInputs() { NamedItemStack plates = getPlateResult(); if (plates != null) { int pageCount = ((BookMeta) plates.getItemMeta()).getPageCount(); - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); + if (pageCount > 0) { + pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); + inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); + } } else { log.info("getInputs(): plates == null"); } @@ -239,9 +241,12 @@ public void fuelConsumed() { public void printBooksUpdate() { // Output finished results + + PrintResult printResult = getPrintResult(); + int finished = processQueue[processQueueOffset]; if (finished > 0) { - NamedItemStack result = getPrintResult().toBook(); + NamedItemStack result = printResult.toBook(); ItemList set = new ItemList(); set.add(result); set = set.getMultiple(finished); @@ -253,12 +258,12 @@ public void printBooksUpdate() { boolean hasPages = pages.allIn(getInventory()); boolean inputStall = false; - int pageCount = getPrintResult().pageCount(); + int pageCount = printResult.pageCount(); pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); if (hasPages) { // Check bindings - int expectedBindings = (int) Math.floor((double) (containedPaper + printingPressProperties.getPagesPerLot()) / (double) pageCount); + int expectedBindings = pageCount == 0 ? containedPaper + printingPressProperties.getPagesPerLot() : (int) Math.floor((double) (containedPaper + printingPressProperties.getPagesPerLot()) / (double) pageCount); boolean hasBindings = true; ItemList allBindings = new ItemList(); if (expectedBindings > containedBindings) { @@ -285,7 +290,7 @@ public void printBooksUpdate() { } // Put materials in queue - int booksInPages = containedPaper / pageCount; + int booksInPages = pageCount == 0 ? containedPaper : containedPaper / pageCount; int copiesIn = Math.min(booksInPages, containedBindings); containedPaper -= copiesIn * pageCount; containedBindings -= copiesIn; @@ -545,7 +550,8 @@ private NamedItemStack getPlateResult() { if (bookData.hasPages()) { pages.addAll(bookData.getPages()); } else { - log.info("getPlateResult(): Book found has no pages."); + pages.add(""); + log.info("getPlateResult(): Book found has no pages; adding blank."); } NamedItemStack plates = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); @@ -627,6 +633,7 @@ private class PrintResult { pages = new ArrayList(bookData.getPages()); else { pages = new ArrayList(0); + pages.add(""); // Blank page. } valid = true; break; From 30ea950cb70e05644d5c3c32977540b028e1e0af Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 9 Mar 2015 23:02:58 -0400 Subject: [PATCH 039/459] Altering the log levels to trace for the majority of the PrintingPress messaging to reduce spamminess in the main log. --- .../FactoryMod/Factorys/BaseFactory.java | 2 +- .../FactoryMod/Factorys/PrintingPress.java | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java index b0142915..a224bbbe 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java @@ -188,7 +188,7 @@ public List togglePower() { response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); } else if (allInputs == null || allInputs.isEmpty()) { - log.log(Level.WARNING, "getAllInputs() returned null or empty; recipe is returning no expectation of input!"); + log.warning("getAllInputs() returned null or empty; recipe is returning no expectation of input!"); } return response; } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index 0ea626da..ebc8dcd6 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -118,7 +118,7 @@ public double getProductionTime() { if (plates != null) { pageCount = Math.max(1, ((BookMeta) plates.getItemMeta()).getPageCount()); } else { - log.info("getProductionTime(): plates == null"); + log.finer("getProductionTime(): plates == null"); } pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); return printingPressProperties.getSetPlateTime() * pageCount; @@ -143,7 +143,7 @@ public ItemList getInputs() { inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); } } else { - log.info("getInputs(): plates == null"); + log.finer("getInputs(): plates == null"); } break; default: @@ -161,7 +161,7 @@ public ItemList getOutputs() { if (plates != null) { outputs.add(plates); } else { - log.info("getOutputs(): Plates results are null!"); + log.finer("getOutputs(): Plates results are null!"); } break; default: @@ -481,7 +481,7 @@ public List getChestResponse() if(getInputs != null && !getInputs.isEmpty()) { responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs.toString()+".")); } else { - log.log(Level.WARNING, "getChestResponse(): Inputs is null or empty!"); + log.fine("getChestResponse(): Inputs is null or empty!"); } //[Outputs: amount Name, amount Name.] @@ -489,7 +489,7 @@ public List getChestResponse() if(getOutputs != null && !getOutputs.isEmpty()) { responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs.toString()+".")); } else { - log.log(Level.WARNING, "getChestResponse(): Outputs is null or empty!"); + log.fine("getChestResponse(): Outputs is null or empty!"); } //[Will repair XX% of the factory] @@ -532,10 +532,10 @@ private NamedItemStack getPlateResult() { } if (stack.getType().equals(Material.BOOK_AND_QUILL) || stack.getType().equals(Material.WRITTEN_BOOK)) { - log.info("getPlateResult(): Found a book in the factory to use as plate source."); + log.finer("getPlateResult(): Found a book in the factory to use as plate source."); ItemMeta meta = stack.getItemMeta(); if (meta instanceof BookMeta) { - log.info("getPlateResult(): Book found has Metadata associated."); + log.finer("getPlateResult(): Book found has Metadata associated."); // Found a book BookMeta bookData = (BookMeta) meta; String title = bookData.hasTitle() ? bookData.getTitle() : ""; @@ -551,7 +551,7 @@ private NamedItemStack getPlateResult() { pages.addAll(bookData.getPages()); } else { pages.add(""); - log.info("getPlateResult(): Book found has no pages; adding blank."); + log.finer("getPlateResult(): Book found has no pages; adding blank."); } NamedItemStack plates = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); @@ -566,11 +566,11 @@ private NamedItemStack getPlateResult() { plates.setItemMeta(plateMeta); return plates; } else { - log.log(Level.WARNING, "getPlateResult(): Book found, but no associated metadata."); + log.warning("getPlateResult(): Book found, but no associated metadata."); } } } - log.log(Level.WARNING, "getPlateResult(): No book found for plate source."); + log.warning("getPlateResult(): No book found for plate source."); return null; } @@ -606,17 +606,17 @@ private class PrintResult { if (stack.getType().equals(Material.BOOK_AND_QUILL) || stack.getType().equals(Material.WRITTEN_BOOK)) { - log.info("PrintResult(): Found a book item."); + log.finer("PrintResult(): Found a book item."); ItemMeta meta = stack.getItemMeta(); List lore = meta.getLore(); if (lore != null && !lore.isEmpty()) { - log.info("PrintResult(): Found a lore item attached to the book."); + log.finer("PrintResult(): Found a lore item attached to the book."); String firstLore = lore.get(0); Matcher match = printPlateRE.matcher(firstLore); if (match.matches()) { - log.info("PrintResult(): Lore matches a print plate."); + log.finer("PrintResult(): Lore matches a print plate."); if (meta instanceof BookMeta) { - log.info("PrintResult(): Book has Associated Book Meta."); + log.finer("PrintResult(): Book has Associated Book Meta."); BookMeta bookData = (BookMeta) meta; if (bookData.hasTitle()) title = bookData.getTitle(); @@ -638,19 +638,19 @@ private class PrintResult { valid = true; break; } else { - log.log(Level.WARNING, "PrintResult(): No Book Meta found!"); + log.fine("PrintResult(): No Book Meta found!"); } } else { - log.log(Level.WARNING, "PrintResult(): Lore indicates the book is not a print plate."); + log.fine("PrintResult(): Lore indicates the book is not a print plate."); } } else { - log.log(Level.WARNING, "PrintResult(): No lore item found with the book."); + log.fine("PrintResult(): No lore item found with the book."); } } } if (!valid) { - log.log(Level.WARNING, "PrintResult(): No valid plate found in the factory."); + log.fine("PrintResult(): No valid plate found in the factory."); } } From 1c3e965d7d807068dc51e09cbec544c504203724 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Mon, 9 Mar 2015 23:59:59 -0400 Subject: [PATCH 040/459] #46 logging gag during load --- .../igotyou/FactoryMod/managers/NetherFactoryManager.java | 5 ++++- .../igotyou/FactoryMod/managers/PrintingPressManager.java | 5 ++++- .../igotyou/FactoryMod/managers/ProductionManager.java | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index b8143dd9..578b9146 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -55,6 +55,7 @@ public class NetherFactoryManager implements Manager private FactoryModPlugin plugin; private List netherFactorys; private long repairTime; + private boolean isLogging = true; public NetherFactoryManager(FactoryModPlugin plugin) { @@ -117,6 +118,7 @@ public void save(File file) throws IOException public void load(File file) throws IOException { + isLogging = false; try { repairTime=System.currentTimeMillis(); FileInputStream fileInputStream = new FileInputStream(file); @@ -155,6 +157,7 @@ public void load(File file) throws IOException } catch (IOException e) { e.printStackTrace(); } + isLogging = true; } public void updateFactorys() @@ -309,7 +312,7 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(netherFactory.getOverworldTeleportPlatform()) )) { netherFactorys.add(netherFactory); - FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.getProperties().getName()); + if (isLogging) { FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.getProperties().getName()); } return new InteractionResponse(InteractionResult.SUCCESS, ""); } else diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 66ef5f9b..4efa2c64 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -49,6 +49,7 @@ public class PrintingPressManager implements Manager private FactoryModPlugin plugin; private List presses; private long repairTime; + private boolean isLogging = true; public PrintingPressManager(FactoryModPlugin plugin) { @@ -114,6 +115,7 @@ public void save(File file) throws IOException public void load(File file) throws IOException { + isLogging = false; try { repairTime=System.currentTimeMillis(); FileInputStream fileInputStream = new FileInputStream(file); @@ -161,6 +163,7 @@ public void load(File file) throws IOException } catch (IOException e) { e.printStackTrace(); } + isLogging = true; } public void updateFactorys() @@ -210,7 +213,7 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(press.getInventoryLocation()) || !factoryExistsAt(press.getPowerSourceLocation())) { presses.add(press); - FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.getProperties().getName()); + if (isLogging) { FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.getProperties().getName()); } return new InteractionResponse(InteractionResult.SUCCESS, ""); } else diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index df45c94d..d116bfff 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -54,6 +54,7 @@ public class ProductionManager implements Manager private FactoryModPlugin plugin; private List producers; private long repairTime; + private boolean isLogging = true; public ProductionManager(FactoryModPlugin plugin) { @@ -133,7 +134,8 @@ public void save(File file) throws IOException public void load(File file) throws IOException { - repairTime=System.currentTimeMillis(); + isLogging = false; + repairTime = System.currentTimeMillis(); FileInputStream fileInputStream = new FileInputStream(file); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream)); String line; @@ -175,6 +177,7 @@ public void load(File file) throws IOException } } fileInputStream.close(); + isLogging = true; } public void updateFactorys() @@ -267,7 +270,7 @@ public InteractionResponse addFactory(Factory factory) || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) { producers.add(production); - FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.getProductionFactoryProperties().getName()); + if(isLogging) { FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.getProductionFactoryProperties().getName()); } return new InteractionResponse(InteractionResult.SUCCESS, ""); } else From 4529095199fae2e2350f289209ea3749e0bf5e28 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Tue, 17 Mar 2015 22:56:51 -0400 Subject: [PATCH 041/459] #11 (WIP) moving production factory io into persistence package and cleanup of all file handling --- .../igotyou/FactoryMod/FactoryModPlugin.java | 446 ++++++++++-------- .../FactoryMod/interfaces/Manager.java | 8 +- .../managers/FactoryModManager.java | 99 +--- .../managers/NetherFactoryManager.java | 8 + .../managers/PrintingPressManager.java | 8 + .../managers/ProductionManager.java | 138 +----- .../igotyou/FactoryMod/utility/ItemList.java | 9 +- 7 files changed, 318 insertions(+), 398 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index f19bdf94..31c8f82c 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,9 +1,8 @@ package com.github.igotyou.FactoryMod; -import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -34,52 +33,135 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; public class FactoryModPlugin extends JavaPlugin { - FactoryModManager manager; - public static HashMap productionProperties; - public static HashMap productionRecipes; - public PrintingPressProperties printingPressProperties; - public NetherFactoryProperties netherFactoryProperties; - + /* Special Values */ public static final String VERSION = "v1.0"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; - public static final String PRODUCTION_SAVES_FILE = "productionSaves"; // The production saves file name - public static final int TICKS_PER_SECOND = 20; //The number of ticks per second - public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; - - public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; - public static boolean DISABLE_PORTALS; - public static int NETHER_SCALE; - public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; - public static boolean ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM; - public static boolean TELEPORT_PLATFORM_INVUNERABLE; - public static boolean REGENERATE_TELEPORT_BLOCK_ON_TELEPORT; - public static boolean REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT; - public static String WORLD_NAME; - public static String NETHER_NAME; + public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name + public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name + public static final int TICKS_PER_SECOND = 20; //ideal number of ticks per second + public static final int TICKS_PER_MIN = 20; //ideal number of ticks per minute + public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) + public static final int MINUTES_PER_YEAR = 60 * 60 * 24 * 365; //number of minutes per year (31.5M) + private static final String CONFIG_FILE = "config.yml"; // the config file name + private static final NamedItemStack DEFAULT_FUEL = new NamedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item + /* General Properties */ + + /** + * How frequently in ticks factory states are updated (Default 20) + */ public static int PRODUCER_UPDATE_CYCLE; - public static boolean PRODUCTION_ENEABLED; + /** + * How often in minutes the managers should save their factories to file (Default 15) + */ public static int SAVE_CYCLE; + /** + * Number of days after a factory falls into disrepair until it is removed (Default 14) + */ + public static long DISREPAIR_PERIOD; + /** + * Number of days for a factory to fully degrade from 100% to 0% health (Default 28) + */ + public static long REPAIR_PERIOD; + /** + * Factory center block material (Default WORKBENCH) + */ public static Material CENTRAL_BLOCK_MATERIAL; + /** + * The item used to interact with factoies (Default STICK) + */ + public static Material FACTORY_INTERACTION_MATERIAL; + /** + * Whether the build materials are returned upon destruction of a factory (Default false) + */ public static boolean RETURN_BUILD_MATERIALS; + /** + * Whether Citadel is enabled (Default true) + */ public static boolean CITADEL_ENABLED; - public static Material FACTORY_INTERACTION_MATERIAL; + /** + * Whether factories are permanently removed upon the destruction of their blocks (Default false) + */ public static boolean DESTRUCTIBLE_FACTORIES; - public static int NETHER_MARKER_MAX_DISTANCE; - public static Material NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL; - public static Material NETHER_FACTORY_MARKER_MATERIAL; + /** + * Whether XP orb drops are disabled (Default false) + */ public static boolean DISABLE_EXPERIENCE; - public static long DISREPAIR_PERIOD; - public static long REPAIR_PERIOD; + /** + * Whether factories are triggered by redstone signals (Default true) + */ public static boolean REDSTONE_START_ENABLED; + /** + * Whether factory running state is output to a lever (Default true) + */ public static boolean LEVER_OUTPUT_ENABLED; + /* Nether Properties */ + + /** + * The name of the overworld dimension (Default world) + */ + public static String WORLD_NAME; + /** + * The name of the nether dimension (Default world_nether) + */ + public static String NETHER_NAME; + /** + * Overworld to nether distance ratio (Default 8) + */ + public static int NETHER_SCALE; + /** + * Disable vanilla nether portal operation (Default true) + */ + public static boolean DISABLE_PORTALS; + /** + * The material of the nether factory teleport platform (Default OBSIDIAN) + */ + public static Material NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL; + /** + * Allow reinforcement above nether factory teleport platforms (Default false) + */ + public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; + /** + * Allow placing of blocks above nether factory teleport platform (Default false) + */ + public static boolean ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM; + /** + * Whether teleport platforms are unbreakable (Default false) + */ + public static boolean TELEPORT_PLATFORM_INVUNERABLE; + /** + * Whether the teleport platform is generated when a player is about to teleport (Default false) + */ + public static boolean REGENERATE_TELEPORT_BLOCK_ON_TELEPORT; + /** + * Whether the blocks above a portal are destroyed, ignoring Citadel, when a player is about to teleport (Default false) + */ + public static boolean REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT; + /** + * The material of the nether factory marker block (Default COAL_BLOCK) + */ + public static Material NETHER_FACTORY_MARKER_MATERIAL; + /** + * Maximum distance between nether factory and marker (Default 64) + */ + public static int NETHER_MARKER_MAX_DISTANCE; + + public static Map productionProperties; + public static Map productionRecipes; + + public FactoryModManager manager; + public PrintingPressProperties printingPressProperties; + public NetherFactoryProperties netherFactoryProperties; + public void onEnable() { plugin = this; @@ -113,127 +195,109 @@ public void registerEvents() public void initConfig() { - sendConsoleMessage("Initiaiting FactoryMod Config."); - productionProperties = new HashMap(); - productionRecipes = new HashMap(); + sendConsoleMessage("Initializing FactoryMod Config."); + + productionProperties = Maps.newHashMap(); + productionRecipes = Maps.newHashMap(); + FileConfiguration config = getConfig(); if(getConfig().getDefaults().getBoolean("copy_defaults", true)) { - saveResource("config.yml",true); + saveResource(CONFIG_FILE, true); } this.saveDefaultConfig(); reloadConfig(); config = getConfig(); - //what should the nether scaling be for the nether factorys? - NETHER_SCALE = config.getInt("nether_general.nether_scale",8); - //Should we Disable regular portals? - DISABLE_PORTALS = config.getBoolean("nether_general.disable_portals", true); - //Allow reinforcement above nether factory teleport platforms. - ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_reinforcement_creation_above_teleport_platform", false); - //Allow people to place blocks above nether factory teleport platforms. - ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_block_placement_above_teleport_platform", false); - //Make teleport platforms unbreakable - TELEPORT_PLATFORM_INVUNERABLE = config.getBoolean("nether_general.teleport_platform_invunerable",false); - //Right before a player get's teleported, should the teleport platform be regenerated? - REGENERATE_TELEPORT_BLOCK_ON_TELEPORT = config.getBoolean("nether_general.regenerate_teleport_block_on_teleport", false); - //Right before a player get's teleported, should the blocks above the portal be destroyed(ignotes citadel)? - REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT = config.getBoolean("nether_general.remove_blocks_above_teleport_platform_on_teleport", false); - //what's the name of the overworld? - WORLD_NAME = config.getString("nether_general.world_name", "world"); - //what's the name of the overworld? - NETHER_NAME = config.getString("nether_general.nether_name", "world_nether"); - //how often should the managers save? - SAVE_CYCLE = config.getInt("general.save_cycle",15)*60*20; - //what's the material of the center block of factorys? - CENTRAL_BLOCK_MATERIAL = Material.getMaterial(config.getString("general.central_block")); - //what's the material of the nether portal teleportation platforms? - NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL = Material.getMaterial(config.getString("nether_general.teleport_platform_material_nether_factory")); - //what's the material of the marker blocks for nether factorys? - NETHER_FACTORY_MARKER_MATERIAL = Material.getMaterial(config.getString("nether_general.marker_material_nether_factory")); - //how far from the factory can the marker be? - NETHER_MARKER_MAX_DISTANCE = config.getInt("nether_general.marker_max_distance"); - //Return the build materials upon destruction of factory. - RETURN_BUILD_MATERIALS = config.getBoolean("general.return_build_materials",false); - //is citadel enabled? - CITADEL_ENABLED = config.getBoolean("general.citadel_enabled",true); - //what's the tool that we use to interact with the factorys? - FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material","STICK")); - //If factories are removed upon destruction of their blocks - DESTRUCTIBLE_FACTORIES=config.getBoolean("general.destructible_factories",false); - //Check if XP drops should be disabled - DISABLE_EXPERIENCE=config.getBoolean("general.disable_experience",false); - //How frequently factories are updated - PRODUCER_UPDATE_CYCLE = config.getInt("production_general.update_cycle",20); - //Period of days before a factory is removed after it falls into disrepair - DISREPAIR_PERIOD= config.getLong("general.disrepair_period",14)*24*60*60*1000; - //The length of time it takes a factory to go to 0% health - REPAIR_PERIOD = config.getLong("production_general.repair_period",28)*24*60*60*1000; - //Disable recipes which result in the following items - //Do we output the running state with a lever? - LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled",true); - //Do we allow factories to be started with redstone? - REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled",true); - int g = 0; - Iterator disabledRecipes=config.getStringList("crafting.disable").iterator(); - while(disabledRecipes.hasNext()) + + NETHER_SCALE = config.getInt("nether_general.nether_scale", 8); + DISABLE_PORTALS = config.getBoolean("nether_general.disable_portals", true); + ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_reinforcement_creation_above_teleport_platform", false); + ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_block_placement_above_teleport_platform", false); + TELEPORT_PLATFORM_INVUNERABLE = config.getBoolean("nether_general.teleport_platform_invunerable", false); + REGENERATE_TELEPORT_BLOCK_ON_TELEPORT = config.getBoolean("nether_general.regenerate_teleport_block_on_teleport", false); + REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT = config.getBoolean("nether_general.remove_blocks_above_teleport_platform_on_teleport", false); + WORLD_NAME = config.getString("nether_general.world_name", "world"); + NETHER_NAME = config.getString("nether_general.nether_name", "world_nether"); + SAVE_CYCLE = config.getInt("general.save_cycle", 15) * TICKS_PER_MIN; + CENTRAL_BLOCK_MATERIAL = Material.getMaterial(config.getString("general.central_block", Material.WORKBENCH.name())); + NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL = Material.getMaterial(config.getString("nether_general.teleport_platform_material_nether_factory", Material.OBSIDIAN.name())); + NETHER_FACTORY_MARKER_MATERIAL = Material.getMaterial(config.getString("nether_general.marker_material_nether_factory", Material.COAL_BLOCK.name())); + NETHER_MARKER_MAX_DISTANCE = config.getInt("nether_general.marker_max_distance", 64); + RETURN_BUILD_MATERIALS = config.getBoolean("general.return_build_materials", false); + CITADEL_ENABLED = config.getBoolean("general.citadel_enabled", true); + FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material", Material.STICK.name())); + DESTRUCTIBLE_FACTORIES = config.getBoolean("general.destructible_factories", false); + DISABLE_EXPERIENCE = config.getBoolean("general.disable_experience", false); + PRODUCER_UPDATE_CYCLE = config.getInt("production_general.update_cycle", 20); + DISREPAIR_PERIOD = config.getLong("general.disrepair_period", 14) * MILLIS_PER_DAY; + REPAIR_PERIOD = config.getLong("production_general.repair_period", 28) * MILLIS_PER_DAY; + LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled", true); + REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled", true); + + List disabledRecipes = config.getStringList("crafting.disable"); + for (String disable : disabledRecipes) { - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disabledRecipes.next())); + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disable)); List tempList = getServer().getRecipesFor(recipeItemStack); - for (int itterator = 0; itterator < tempList.size(); itterator ++) + for (Recipe rec : tempList) { - removeRecipe(tempList.get(itterator)); - g++; + removeRecipe(rec); } - } + //Enable the following recipes - ConfigurationSection configCraftingEnable=config.getConfigurationSection("crafting.enable"); - for (String recipeName:configCraftingEnable.getKeys(false)) + ConfigurationSection configCraftingEnable = config.getConfigurationSection("crafting.enable"); + for (String recipeName : configCraftingEnable.getKeys(false)) { ConfigurationSection configSection=configCraftingEnable.getConfigurationSection(recipeName); Recipe recipe; - List shape=configSection.getStringList("shape"); - NamedItemStack output=getItems(configSection.getConfigurationSection("output")).get(0); + List shape = configSection.getStringList("shape"); + NamedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); + if(shape.isEmpty()) { - ShapelessRecipe shapelessRecipe=new ShapelessRecipe(output); + ShapelessRecipe shapelessRecipe = new ShapelessRecipe(output); + for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) { - shapelessRecipe.addIngredient(input.getAmount(),input.getType(),input.getDurability()); + shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); } - recipe=shapelessRecipe; + + recipe = shapelessRecipe; } else { - ShapedRecipe shapedRecipe=new ShapedRecipe(output); + ShapedRecipe shapedRecipe = new ShapedRecipe(output); shapedRecipe.shape(shape.toArray(new String[shape.size()])); - for(String inputKey:configSection.getConfigurationSection("inputs").getKeys(false)) + + for(String inputKey : configSection.getConfigurationSection("inputs").getKeys(false)) { - ItemStack input=getItems(configSection.getConfigurationSection("inputs."+inputKey)).get(0); + ItemStack input = getItems(configSection.getConfigurationSection("inputs." + inputKey)).get(0); shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); } - recipe=shapedRecipe; + + recipe = shapedRecipe; } Bukkit.addRecipe(recipe); } //Import recipes from config.yml - ConfigurationSection configProdRecipes=config.getConfigurationSection("production_recipes"); + ConfigurationSection configProdRecipes = config.getConfigurationSection("production_recipes"); //Temporary Storage array to store where recipes should point to each other - HashMap outputRecipes=new HashMap(); - Iterator recipeTitles=configProdRecipes.getKeys(false).iterator(); - while (recipeTitles.hasNext()) + Map> outputRecipes = Maps.newHashMap(); + + for (String title : configProdRecipes.getKeys(false)) { //Section header in recipe file, also serves as unique identifier for the recipe //All spaces are replaced with udnerscores so they don't disrupt saving format //There should be a check for uniqueness of this identifier... - String title=recipeTitles.next(); - ConfigurationSection configSection=configProdRecipes.getConfigurationSection(title); - title=title.replaceAll(" ","_"); + ConfigurationSection configSection = configProdRecipes.getConfigurationSection(title); + title = title.replaceAll(" ", "_"); //Display name of the recipe, Deafult of "Default Name" - String recipeName = configSection.getString("name","Default Name"); + String recipeName = configSection.getString("name", "Default Name"); //Production time of the recipe, default of 1 - int productionTime=configSection.getInt("production_time",2); + //TODO: fix config according to default 1 + int productionTime = configSection.getInt("production_time", 2); //Inputs of the recipe, empty of there are no inputs ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); //Inputs of the recipe, empty of there are no inputs @@ -241,65 +305,63 @@ public void initConfig() //Outputs of the recipe, empty of there are no inputs ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); //Enchantments of the recipe, empty of there are no inputs - List enchantments=getEnchantments(configSection.getConfigurationSection("enchantments")); + List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); //Whether this recipe can only be used once boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title,recipeName,productionTime,inputs,upgrades,outputs,enchantments,useOnce,new ItemList()); - productionRecipes.put(title,recipe); + ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantments, useOnce, new ItemList()); + productionRecipes.put(title, recipe); //Store the titles of the recipes that this should point to - ArrayList currentOutputRecipes=new ArrayList(); + List currentOutputRecipes = Lists.newArrayList(); currentOutputRecipes.addAll(configSection.getStringList("output_recipes")); - outputRecipes.put(recipe,currentOutputRecipes); + outputRecipes.put(recipe, currentOutputRecipes); } + //Once ProductionRecipe objects have been created correctly insert different pointers - Iterator recipeIterator=outputRecipes.keySet().iterator(); - while (recipeIterator.hasNext()) + for (ProductionRecipe recipe : outputRecipes.keySet()) { - ProductionRecipe recipe=recipeIterator.next(); - Iterator outputIterator=outputRecipes.get(recipe).iterator(); - while(outputIterator.hasNext()) + for( String output : outputRecipes.get(recipe)) { - recipe.addOutputRecipe(productionRecipes.get(outputIterator.next())); + recipe.addOutputRecipe(productionRecipes.get(output)); } } //Import factories from config.yml - ConfigurationSection configProdFactories=config.getConfigurationSection("production_factories"); - Iterator factoryTitles=configProdFactories.getKeys(false).iterator(); - while(factoryTitles.hasNext()) + ConfigurationSection configProdFactories = config.getConfigurationSection("production_factories"); + for (String title : configProdFactories.getKeys(false)) { - String title=factoryTitles.next(); - ConfigurationSection configSection=configProdFactories.getConfigurationSection(title); - title=title.replaceAll(" ","_"); - String factoryName=configSection.getString("name","Default Name"); + ConfigurationSection configSection = configProdFactories.getConfigurationSection(title); + title = title.replaceAll(" ", "_"); + String factoryName = configSection.getString("name", "Default Name"); //Uses overpowered getItems method for consistency, should always return a list of size=1 //If no fuel is found, default to charcoal - ItemList fuel=getItems(configSection.getConfigurationSection("fuel")); + ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); if(fuel.isEmpty()) { - fuel=new ItemList(); - fuel.add(new NamedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); + fuel = new ItemList(); + fuel.add(DEFAULT_FUEL); } - int fuelTime=configSection.getInt("fuel_time",2); - ItemList inputs=getItems(configSection.getConfigurationSection("inputs")); - ItemList repairs=getItems(configSection.getConfigurationSection("repair_inputs")); - List factoryRecipes=new ArrayList(); - Iterator ouputRecipeIterator=configSection.getStringList("recipes").iterator(); - while (ouputRecipeIterator.hasNext()) + //TODO: default fuel time should be 1 + int fuelTime = configSection.getInt("fuel_time", 2); + ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); + ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); + + List factoryRecipes = Lists.newArrayList(); + for (String recipe : configSection.getStringList("recipes")) { - factoryRecipes.add(productionRecipes.get(ouputRecipeIterator.next())); + factoryRecipes.add(productionRecipes.get(recipe)); } - int repair=configSection.getInt("repair_multiple",0); + + int repair = configSection.getInt("repair_multiple",0); //Create repair recipe - productionRecipes.put(title+"REPAIR",new ProductionRecipe(title+"REPAIR","Repair Factory",1,repairs)); - factoryRecipes.add(productionRecipes.get(title+"REPAIR")); + productionRecipes.put(title + "REPAIR", new ProductionRecipe(title + "REPAIR", "Repair Factory", 1, repairs)); + factoryRecipes.add(productionRecipes.get(title + "REPAIR")); ProductionProperties productionProperty = new ProductionProperties(inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); productionProperties.put(title, productionProperty); } - ConfigurationSection configPrintingPresses=config.getConfigurationSection("printing_presses"); - ConfigurationSection configNetherFactory=config.getConfigurationSection("nether_factory"); + ConfigurationSection configPrintingPresses = config.getConfigurationSection("printing_presses"); + ConfigurationSection configNetherFactory = config.getConfigurationSection("nether_factory"); printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); sendConsoleMessage("Finished initializing FactoryMod Config."); @@ -307,20 +369,18 @@ public void initConfig() private List getEnchantments(ConfigurationSection configEnchantments) { - List enchantments=new ArrayList(); - if(configEnchantments!=null) + List enchantments = Lists.newArrayList(); + if(configEnchantments != null) { - Iterator names=configEnchantments.getKeys(false).iterator(); - while (names.hasNext()) + for (String name : configEnchantments.getKeys(false)) { - String name=names.next(); - ConfigurationSection configEnchantment=configEnchantments.getConfigurationSection(name); - String type=configEnchantment.getString("type"); - if (type!=null) + ConfigurationSection configEnchantment = configEnchantments.getConfigurationSection(name); + String type = configEnchantment.getString("type"); + if (type != null) { - int level=configEnchantment.getInt("level",1); - double probability=configEnchantment.getDouble("probability",1.0); - ProbabilisticEnchantment enchantment=new ProbabilisticEnchantment(name,type,level,probability); + int level = configEnchantment.getInt("level", 1); + double probability = configEnchantment.getDouble("probability", 1.0); + ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment(name, type, level, probability); enchantments.add(enchantment); } } @@ -328,23 +388,20 @@ private List getEnchantments(ConfigurationSection conf return enchantments; } - private List getPotionEffects( - ConfigurationSection configurationSection) { - List potionEffects = new ArrayList(); - if(configurationSection!=null) + private List getPotionEffects(ConfigurationSection configurationSection) { + List potionEffects = Lists.newArrayList(); + if(configurationSection != null) { - Iterator names=configurationSection.getKeys(false).iterator(); - while (names.hasNext()) + for (String name : configurationSection.getKeys(false)) { - String name=names.next(); - ConfigurationSection configEffect=configurationSection.getConfigurationSection(name); - String type=configEffect.getString("type"); - if (type!=null) + ConfigurationSection configEffect = configurationSection.getConfigurationSection(name); + String type = configEffect.getString("type"); + if (type != null) { PotionEffectType effect = PotionEffectType.getByName(type); if (effect != null) { - int duration=configEffect.getInt("duration",200); - int amplifier=configEffect.getInt("amplifier",0); + int duration = configEffect.getInt("duration", 200); + int amplifier = configEffect.getInt("amplifier", 0); potionEffects.add(new PotionEffect(effect, duration, amplifier)); } } @@ -355,14 +412,14 @@ private List getPotionEffects( public ItemList getItems(ConfigurationSection configItems) { - ItemList items=new ItemList(); - if(configItems!=null) + ItemList items = new ItemList(); + if(configItems != null) { - for(String commonName:configItems.getKeys(false)) + for(String commonName : configItems.getKeys(false)) { - ConfigurationSection configItem= configItems.getConfigurationSection(commonName); - String materialName=configItem.getString("material"); + ConfigurationSection configItem = configItems.getConfigurationSection(commonName); + String materialName = configItem.getString("material"); Material material = Material.getMaterial(materialName); //only proceeds if an acceptable material name was provided if (material == null) @@ -371,66 +428,77 @@ public ItemList getItems(ConfigurationSection configItems) } else { - int amount=configItem.getInt("amount",1); - short durability=(short)configItem.getInt("durability",0); - int repairCost=(short)configItem.getInt("repair_cost",0); - String displayName=configItem.getString("display_name"); - String lore=configItem.getString("lore"); + int amount = configItem.getInt("amount", 1); + short durability = (short)configItem.getInt("durability", 0); + int repairCost = (short)configItem.getInt("repair_cost", 0); + String displayName = configItem.getString("display_name"); + String lore = configItem.getString("lore"); List compulsoryEnchantments = getEnchantments(configItem.getConfigurationSection("enchantments")); List storedEnchantments = getEnchantments(configItem.getConfigurationSection("stored_enchantments")); List potionEffects = getPotionEffects(configItem.getConfigurationSection("potion_effects")); - items.add(createItemStack(material,amount,durability,displayName,lore,commonName,repairCost,compulsoryEnchantments,storedEnchantments,potionEffects)); + items.add(createItemStack(material, amount, durability, displayName, lore, commonName, repairCost, compulsoryEnchantments, storedEnchantments, potionEffects)); } } } + return items; } - private NamedItemStack createItemStack(Material material,int stackSize,short durability,String name,String loreString,String commonName,int repairCost,List compulsoryEnchants,List storedEnchants, List potionEffects) + private NamedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, + List compulsoryEnchants, List storedEnchants, List potionEffects) { NamedItemStack namedItemStack= new NamedItemStack(material, stackSize, durability,commonName); - if(name!=null||loreString!=null||compulsoryEnchants.size()>0||storedEnchants.size()>0||potionEffects.size()>0||repairCost > 0) + if(name != null || loreString != null || compulsoryEnchants.size() > 0 || storedEnchants.size() > 0 || potionEffects.size() > 0 || repairCost > 0) { - ItemMeta meta=namedItemStack.getItemMeta(); - if (name!=null) + ItemMeta meta = namedItemStack.getItemMeta(); + + if (name != null) { meta.setDisplayName(name); - if (meta instanceof Repairable && repairCost > 0) + } + + if (meta instanceof Repairable && repairCost > 0) { ((Repairable) meta).setRepairCost(repairCost); - if (loreString!=null) - { - List lore = new ArrayList(); + } + + if (loreString!=null) { + List lore = Lists.newArrayList(); lore.add(loreString); meta.setLore(lore); } + for (ProbabilisticEnchantment enchant : compulsoryEnchants) { meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), false); } + if (meta instanceof EnchantmentStorageMeta) { EnchantmentStorageMeta esm = (EnchantmentStorageMeta) meta; for (ProbabilisticEnchantment enchant : storedEnchants) { esm.addStoredEnchant(enchant.getEnchantment(), enchant.getLevel(), false); } } + if (meta instanceof PotionMeta) { PotionMeta pm = (PotionMeta) meta; for (PotionEffect effect : potionEffects) { pm.addCustomEffect(effect, true); } } + namedItemStack.setItemMeta(meta); } + return namedItemStack; } private void removeRecipe(Recipe removalRecipe) { - Iterator itterator = getServer().recipeIterator(); - while (itterator.hasNext()) + Iterator it = getServer().recipeIterator(); + while (it.hasNext()) { - Recipe recipe = itterator.next(); + Recipe recipe = it.next(); if (recipe.getResult().getType() == removalRecipe.getResult().getType()) { - itterator.remove(); + it.remove(); } } } diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java index 2282d153..d1a12180 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java +++ b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java @@ -5,6 +5,7 @@ import org.bukkit.Location; +import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.InteractionResponse; //original file: @@ -22,9 +23,14 @@ * @author igotyou * */ - +//TODO: use generic for better type inference public interface Manager { + + /** + * @return the plugin instance + */ + public FactoryModPlugin getPlugin(); /** * Saves the machine objects list of this manager to file diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index baf1cc86..45834fce 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -1,20 +1,18 @@ package com.github.igotyou.FactoryMod.managers; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.event.Listener; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.google.common.collect.Lists; //original file: /** * MachinesManager.java @@ -32,13 +30,12 @@ */ public class FactoryModManager { - List listeners; List managers; - FactoryModPlugin plugin; //The plugin object - - public static FactoryModManager factoryMan; - + /** + * The plugin instance + */ + FactoryModPlugin plugin; /** * Constructor @@ -46,59 +43,13 @@ public class FactoryModManager public FactoryModManager(FactoryModPlugin plugin) { FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); - this.plugin = plugin; - FactoryModManager.factoryMan = this; - initializeManagers(); + this.plugin = plugin; + managers = Lists.newArrayList( new ProductionManager(plugin), new PrintingPressManager(plugin), new NetherFactoryManager(plugin) ); loadManagers(); periodicSaving(); - FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); - } - - /** - * Initializes the necassary managers for enabled factorys - */ - private void initializeManagers() - { - managers = new ArrayList(); - listeners = new ArrayList(); - - //if (FactoryModPlugin.PRODUCTION_ENEABLED) - //{ - initializeProductionManager(); - initializePrintingPressManager(); - initializeNetherFactoryManager(); - //} - } - - - /** - * Initializes the Ore Gin Manager - */ - private void initializeProductionManager() - { - ProductionManager productionnMan = new ProductionManager(plugin); - - managers.add(productionnMan); - } - /** - * Initializes the Printing Press Manager - */ - private void initializePrintingPressManager() - { - PrintingPressManager printingMan = new PrintingPressManager(plugin); - managers.add(printingMan); - } - - /** - * Initialized the NetherFactory manager - */ - private void initializeNetherFactoryManager() - { - NetherFactoryManager netherMan = new NetherFactoryManager(plugin); - - managers.add(netherMan); + FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); } /** @@ -157,23 +108,10 @@ private static void load(Manager managerInterface, File file) { managerInterface.load(file); } - catch (FileNotFoundException exception) - { - FactoryModPlugin.sendConsoleMessage(file.getName() + " does not exist! Creating file!"); - } catch (IOException exception) { throw new RuntimeException("Failed to load " + file.getPath(), exception); } - - try - { - managerInterface.save(file); - } - catch (IOException exception) - { - throw new RuntimeException("Failed to create " + file.getPath(), exception); - } } /** @@ -181,28 +119,9 @@ private static void load(Manager managerInterface, File file) */ private static void save(Manager manager, File file) { - try { - File newFile = new File(file.getAbsolutePath() + ".new"); - File bakFile = new File(file.getAbsolutePath() + ".bak"); - - manager.save(newFile); - - if (bakFile.exists()) - { - bakFile.delete(); - } - - if (file.exists() && !file.renameTo(bakFile)) - { - throw new IOException("Failed to rename " + file.getAbsolutePath() + " to " + bakFile.getAbsolutePath()); - } - - if (!newFile.renameTo(file)) - { - throw new IOException("Failed to rename " + newFile.getAbsolutePath() + " to " + file.getAbsolutePath()); - } + manager.save(file); } catch (IOException exception) { diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 578b9146..e6a108be 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -70,6 +70,9 @@ public void save(File file) throws IOException //Takes difference between last repair update and current one and scales repair accordingly updateRepair(System.currentTimeMillis()-repairTime); repairTime=System.currentTimeMillis(); + + BackupManager.backup(file); + FileOutputStream fileOutputStream = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); int version = 1; @@ -430,6 +433,11 @@ public double getScalingFactor(Location location) } } return scalingFactor; + } + + @Override + public FactoryModPlugin getPlugin() { + return plugin; } } diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 4efa2c64..494939e4 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -64,6 +64,9 @@ public void save(File file) throws IOException //Takes difference between last repair update and current one and scales repair accordingly updateRepair(System.currentTimeMillis()-repairTime); repairTime=System.currentTimeMillis(); + + BackupManager.backup(file); + FileOutputStream fileOutputStream = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); int version = 1; @@ -301,4 +304,9 @@ public String getSavesFileName() return FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE; } + @Override + public FactoryModPlugin getPlugin() { + return plugin; + } + } diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index d116bfff..d025c656 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -1,19 +1,10 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import org.bukkit.Location; import org.bukkit.Material; @@ -25,13 +16,15 @@ import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.google.common.collect.Lists; //original file: /** @@ -53,130 +46,40 @@ public class ProductionManager implements Manager { private FactoryModPlugin plugin; private List producers; + private FactoryDao mDao; + private File mSaveFile; private long repairTime; private boolean isLogging = true; + @SuppressWarnings("unchecked") public ProductionManager(FactoryModPlugin plugin) { this.plugin = plugin; - producers = new ArrayList(); + mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); + producers = Lists.newArrayList(); //Set maintenance clock to 0 updateFactorys(); + //TODO: use type inference to avoid cast + mDao = (FactoryDao) PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } public void save(File file) throws IOException { //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis()-repairTime); - repairTime=System.currentTimeMillis(); - FileOutputStream fileOutputStream = new FileOutputStream(file); - BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream)); - for (ProductionFactory production : producers) - { - //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number - - Location centerlocation = production.getCenterLocation(); - Location inventoryLoctation = production.getInventoryLocation(); - Location powerLocation = production.getPowerSourceLocation(); - - - - bufferedWriter.append(production.getSubFactoryType()); - bufferedWriter.append(" "); - - List recipes=production.getRecipes(); - for (int i = 0; i < recipes.size(); i++) - { - bufferedWriter.append(String.valueOf(recipes.get(i).getTitle())); - bufferedWriter.append(","); - } - bufferedWriter.append(" "); - - bufferedWriter.append(centerlocation.getWorld().getName()); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(centerlocation.getBlockX())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(centerlocation.getBlockY())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(centerlocation.getBlockZ())); - bufferedWriter.append(" "); - - bufferedWriter.append(Integer.toString(inventoryLoctation.getBlockX())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(inventoryLoctation.getBlockY())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(inventoryLoctation.getBlockZ())); - bufferedWriter.append(" "); - - bufferedWriter.append(Integer.toString(powerLocation.getBlockX())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(powerLocation.getBlockY())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(powerLocation.getBlockZ())); - bufferedWriter.append(" "); - - bufferedWriter.append(Boolean.toString(production.getActive())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(production.getProductionTimer())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(production.getEnergyTimer())); - bufferedWriter.append(" "); - bufferedWriter.append(Integer.toString(production.getCurrentRecipeNumber())); - bufferedWriter.append(" "); - bufferedWriter.append(Double.toString(production.getCurrentRepair())); - bufferedWriter.append(" "); - bufferedWriter.append(String.valueOf(production.getTimeDisrepair())); - bufferedWriter.append("\n"); - } - bufferedWriter.flush(); - fileOutputStream.close(); + updateRepair(System.currentTimeMillis() - repairTime); + repairTime = System.currentTimeMillis(); + + BackupManager.backup(mSaveFile); + mDao.writeFactories(producers); } public void load(File file) throws IOException { isLogging = false; repairTime = System.currentTimeMillis(); - FileInputStream fileInputStream = new FileInputStream(file); - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream)); - String line; - while ((line = bufferedReader.readLine()) != null) - { - String parts[] = line.split(" "); - - //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number - String subFactoryType = parts[0]; - String recipeNames[] = parts[1].split(","); - - Location centerLocation = new Location(plugin.getServer().getWorld(parts[2]), Integer.parseInt(parts[3]), Integer.parseInt(parts[4]), Integer.parseInt(parts[5])); - Location inventoryLocation = new Location(plugin.getServer().getWorld(parts[2]), Integer.parseInt(parts[6]), Integer.parseInt(parts[7]), Integer.parseInt(parts[8])); - Location powerLocation = new Location(plugin.getServer().getWorld(parts[2]), Integer.parseInt(parts[9]), Integer.parseInt(parts[10]), Integer.parseInt(parts[11])); - boolean active = Boolean.parseBoolean(parts[12]); - int productionTimer = Integer.parseInt(parts[13]); - int energyTimer = Integer.parseInt(parts[14]); - int currentRecipeNumber = Integer.parseInt(parts[15]); - double currentRepair = Double.parseDouble(parts[16]); - long timeDisrepair = Long.parseLong(parts[17]); - if(FactoryModPlugin.productionProperties.containsKey(subFactoryType)) - { - Set recipes=new HashSet(); - - // TODO: Give default recipes for subfactory type - ProductionProperties properties = FactoryModPlugin.productionProperties.get(subFactoryType); - recipes.addAll(properties.getRecipes()); - - for(String name:recipeNames) - { - if(FactoryModPlugin.productionRecipes.containsKey(name)) - { - recipes.add(FactoryModPlugin.productionRecipes.get(name)); - } - } - - ProductionFactory production = new ProductionFactory(centerLocation, inventoryLocation, powerLocation, subFactoryType, active, productionTimer, energyTimer, new ArrayList(recipes), currentRecipeNumber, currentRepair,timeDisrepair); - addFactory(production); - } + for(ProductionFactory factory : mDao.readFactories()) { + addFactory(factory); } - fileInputStream.close(); isLogging = true; } @@ -355,7 +258,12 @@ public void updateRepair(long time) public String getSavesFileName() { - return FactoryModPlugin.PRODUCTION_SAVES_FILE; + return mSaveFile.getName(); + } + + @Override + public FactoryModPlugin getPlugin() { + return plugin; } } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index 68807640..01cf325e 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -4,25 +4,28 @@ */ package com.github.igotyou.FactoryMod.utility; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Random; + import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; + /** * * @author Brian Landry */ public class ItemList extends ArrayList { + + private static final long serialVersionUID = -5975973806251278120L; + public boolean exactlyIn(Inventory inventory) { boolean returnValue=true; From dfbf9ebeb4a8469fa0eacb4818d970ece630686b Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Thu, 19 Mar 2015 00:29:46 -0400 Subject: [PATCH 042/459] #11 new persistence package --- .../FactoryMod/persistence/FactoryDao.java | 25 +++ .../FactoryMod/persistence/FactoryReader.java | 11 ++ .../FactoryMod/persistence/FactoryWriter.java | 11 ++ .../FactoryMod/persistence/FileBackup.java | 28 +++ .../persistence/PersistenceFactory.java | 33 ++++ .../persistence/ProductionCsvReader.java | 168 ++++++++++++++++++ .../persistence/ProductionCsvWriter.java | 115 ++++++++++++ 7 files changed, 391 insertions(+) create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FileBackup.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java new file mode 100644 index 00000000..6679066f --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java @@ -0,0 +1,25 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.interfaces.Factory; + +public class FactoryDao { + + private FactoryReader mReader; + private FactoryWriter mWriter; + + FactoryDao(FactoryReader reader, FactoryWriter writer) { + mReader = reader; + mWriter = writer; + } + + public List readFactories() { + return mReader.read(); + } + + public void writeFactories(List factories) { + mWriter.write(factories); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java new file mode 100644 index 00000000..7f1ba60b --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java @@ -0,0 +1,11 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.interfaces.Factory; + +public interface FactoryReader { + + public List read(); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java new file mode 100644 index 00000000..18a69019 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java @@ -0,0 +1,11 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.interfaces.Factory; + +public interface FactoryWriter { + + public void write(List factories); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java b/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java new file mode 100644 index 00000000..85b209f7 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java @@ -0,0 +1,28 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.File; +import java.io.IOException; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.google.common.io.Files; + +public class FileBackup { + + private static String BACKUP_EXT = ".bak"; + + public static synchronized void backup(File file) { + + File backup = new File(file.getAbsolutePath() + BACKUP_EXT); + + if(backup.exists()) { + backup.delete(); + } + + try { + Files.copy(file, backup); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage("ERROR: Could not copy file to backup!" + file.getName()); + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java new file mode 100644 index 00000000..94364063 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -0,0 +1,33 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.File; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; +import com.github.igotyou.FactoryMod.managers.PrintingPressManager; +import com.github.igotyou.FactoryMod.managers.ProductionManager; + +public class PersistenceFactory { + + //TODO: use type inference for return + public static FactoryDao getFactoryDao(Manager factoryManager, File saveFile, String saveFormat) { + + if(saveFormat.toLowerCase().equals("txt")) { + if(factoryManager instanceof ProductionManager) { + return new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); + } else if(factoryManager instanceof PrintingPressManager) { + //TODO: add printing press support + } else if(factoryManager instanceof NetherFactoryManager) { + //TODO: add nether factory support + } + FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); + return null; + } + + FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + saveFormat); + return null; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java new file mode 100644 index 00000000..c34f6538 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java @@ -0,0 +1,168 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.bukkit.Location; +import org.bukkit.World; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.common.io.Files; + +public class ProductionCsvReader implements FactoryReader{ + + /** + * The plugin instance + */ + FactoryModPlugin mPlugin; + + /** + * The CSV file being read + */ + File mFile; + + public ProductionCsvReader(FactoryModPlugin plugin, File file) { + mPlugin = plugin; + mFile = file; + } + + private enum LineTokens { + SUBTYPE, + RECIPE_LIST, + WORLD, + CENTER_X, + CENTER_Y, + CENTER_Z, + INV_X, + INV_Y, + INV_Z, + POWER_X, + POWER_Y, + POWER_Z, + IS_ACTIVE, + PROD_TIMER, + ENERGY_TIMER, + RECIPE_NUMBER, + REPAIR, + DISREPAIR_TIME, + MAX + } + + @Override + public synchronized List read() { + + List factories = Lists.newArrayList(); + + if(!mFile.exists() || mFile.isDirectory()) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") + .append(mFile.getName()).append(" is not a valid file!").toString()); + return factories; + } + + BufferedReader reader; + + try { + reader = Files.newReader(mFile, Charset.defaultCharset()); + } catch (FileNotFoundException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); + return factories; + } + String line; + int lineNum = 0; + + try { + for (; (line = reader.readLine()) != null; ++lineNum) + { + String[] tokens = line.split(" "); + + if(tokens.length != LineTokens.MAX.ordinal()) { + logFactoryError(lineNum, "Unexpected number of tokens: " + tokens.length); + break; + } + + try { + String subFactoryType = tokens[LineTokens.SUBTYPE.ordinal()]; + String recipeNames[] = tokens[LineTokens.RECIPE_LIST.ordinal()].split(","); + + World world = mPlugin.getServer().getWorld(tokens[LineTokens.WORLD.ordinal()]); + Location centerLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.CENTER_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.CENTER_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.CENTER_Z.ordinal()])); + Location inventoryLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.INV_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.INV_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.INV_Z.ordinal()])); + Location powerLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.POWER_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.POWER_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.POWER_Z.ordinal()])); + + boolean active = Boolean.parseBoolean(tokens[LineTokens.IS_ACTIVE.ordinal()]); + int productionTimer = Integer.parseInt(tokens[LineTokens.PROD_TIMER.ordinal()]); + int energyTimer = Integer.parseInt(tokens[LineTokens.ENERGY_TIMER.ordinal()]); + int currentRecipeNumber = Integer.parseInt(tokens[LineTokens.RECIPE_NUMBER.ordinal()]); + double currentRepair = Double.parseDouble(tokens[LineTokens.REPAIR.ordinal()]); + long timeDisrepair = Long.parseLong(tokens[LineTokens.DISREPAIR_TIME.ordinal()]); + + if(FactoryModPlugin.productionProperties.containsKey(subFactoryType)) + { + Set recipes = Sets.newHashSet(); + + // TODO: Give default recipes for subfactory type + ProductionProperties properties = FactoryModPlugin.productionProperties.get(subFactoryType); + recipes.addAll(properties.getRecipes()); + + for(String name : recipeNames) + { + if(FactoryModPlugin.productionRecipes.containsKey(name)) + { + recipes.add(FactoryModPlugin.productionRecipes.get(name)); + } + } + + factories.add(new ProductionFactory( + centerLocation, inventoryLocation, powerLocation, + subFactoryType, active, productionTimer, energyTimer, + new ArrayList(recipes), + currentRecipeNumber, currentRepair, timeDisrepair)); + } else { + logFactoryError(lineNum, "Unexpected factory type: " + subFactoryType); + break; + } + } catch (NumberFormatException e) { + logFactoryError(lineNum, "Expected token was not an integer"); + } + } + } catch (IOException e) { + logFactoryError(lineNum, "Could not read file, aborting"); + } + + try { + reader.close(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not close stream reading from ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + } + + return factories; + } + + private void logFactoryError(int lineNum, String error) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Parse error at line ") + .append(lineNum).append(" of ").append(mFile.getName()).append(": ").append(error).toString()); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java new file mode 100644 index 00000000..b7319b1a --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java @@ -0,0 +1,115 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.List; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.google.common.io.Files; + +public class ProductionCsvWriter implements FactoryWriter { + + File mFile; + + public ProductionCsvWriter(File file) { + mFile = file; + } + + @Override + public synchronized void write(List factories) { + + if(!mFile.exists()) { + try { + mFile.createNewFile(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + return; + } + } + + BufferedWriter writer; + + try { + writer = Files.newWriter(mFile, Charset.defaultCharset()); + } catch (FileNotFoundException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for writing: ").append(e.getMessage()).toString()); + return; + } + + for (ProductionFactory factory : factories) + { + Location centerlocation = factory.getCenterLocation(); + Location inventoryLoctation = factory.getInventoryLocation(); + Location powerLocation = factory.getPowerSourceLocation(); + + try { + writer.append(factory.getSubFactoryType()); + writer.append(" "); + + for (ProductionRecipe recipe : factory.getRecipes()) + { + writer.append(String.valueOf(recipe.getTitle())); + writer.append(","); + } + writer.append(" "); + + writer.append(centerlocation.getWorld().getName()); + writer.append(" "); + writer.append(Integer.toString(centerlocation.getBlockX())); + writer.append(" "); + writer.append(Integer.toString(centerlocation.getBlockY())); + writer.append(" "); + writer.append(Integer.toString(centerlocation.getBlockZ())); + writer.append(" "); + + writer.append(Integer.toString(inventoryLoctation.getBlockX())); + writer.append(" "); + writer.append(Integer.toString(inventoryLoctation.getBlockY())); + writer.append(" "); + writer.append(Integer.toString(inventoryLoctation.getBlockZ())); + writer.append(" "); + + writer.append(Integer.toString(powerLocation.getBlockX())); + writer.append(" "); + writer.append(Integer.toString(powerLocation.getBlockY())); + writer.append(" "); + writer.append(Integer.toString(powerLocation.getBlockZ())); + writer.append(" "); + + writer.append(Boolean.toString(factory.getActive())); + writer.append(" "); + writer.append(Integer.toString(factory.getProductionTimer())); + writer.append(" "); + writer.append(Integer.toString(factory.getEnergyTimer())); + writer.append(" "); + writer.append(Integer.toString(factory.getCurrentRecipeNumber())); + writer.append(" "); + writer.append(Double.toString(factory.getCurrentRepair())); + writer.append(" "); + writer.append(String.valueOf(factory.getTimeDisrepair())); + writer.newLine(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") + .append(mFile.getName()).append(" for factory ").append(factories.indexOf(factory)).append(": ").append(e.getMessage()).toString()); + } + } + + try { + writer.flush(); + writer.close(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + } + + } +} From 8f7f31cd529552a8b42969d083b5e5a737d20666 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 22 Mar 2015 00:01:14 -0400 Subject: [PATCH 043/459] Typo and X in place of Y on location output. --- .../github/igotyou/FactoryMod/managers/FactoryModManager.java | 2 +- src/com/github/igotyou/FactoryMod/utility/StringUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index baf1cc86..3cf948f7 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -45,7 +45,7 @@ public class FactoryModManager */ public FactoryModManager(FactoryModPlugin plugin) { - FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); + FactoryModPlugin.sendConsoleMessage("Initiating FactoryMod Managers."); this.plugin = plugin; FactoryModManager.factoryMan = this; diff --git a/src/com/github/igotyou/FactoryMod/utility/StringUtils.java b/src/com/github/igotyou/FactoryMod/utility/StringUtils.java index 3e0fe3f3..d97345cc 100644 --- a/src/com/github/igotyou/FactoryMod/utility/StringUtils.java +++ b/src/com/github/igotyou/FactoryMod/utility/StringUtils.java @@ -11,7 +11,7 @@ public class StringUtils { * Formats a Location's coordinates as "world (x y z)" */ public static String formatCoords(Location loc) { - return String.format("%s (%d %d %d)", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockX(), loc.getBlockZ()); + return String.format("%s (%d %d %d)", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } public static List splitLines(String paragraph, int lineLength) { From 49d39db699fb4c35ef7bb89ad8eb054326b86726 Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 24 Mar 2015 15:52:20 -0400 Subject: [PATCH 044/459] Wood Potato Nerf Resubmitting this to right repo since I'm bad --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 136ac717..fb669717 100644 --- a/config.yml +++ b/config.yml @@ -2689,7 +2689,7 @@ production_recipes: amount: 5 Baked Potato: material: BAKED_POTATO - amount: 1280 + amount: 1920 outputs: Exp Bottle: material: EXP_BOTTLE From 9386656d1a6c35693c66d19d565071244b475ee7 Mon Sep 17 00:00:00 2001 From: Austin Fuller Date: Sat, 28 Mar 2015 14:11:59 -0500 Subject: [PATCH 045/459] Added recipes for Smooth Double Stone Slab and Smooth Double Sandstone Slab --- config.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/config.yml b/config.yml index fb669717..c7a2a979 100644 --- a/config.yml +++ b/config.yml @@ -206,6 +206,33 @@ crafting: output: Double Stone Slab: material: DOUBLE_STEP + Slab to Smooth Double Stone Slab: + inputs: + s: + Stone Slab: + material: STEP + shape: + - ss + - ss + output: + Smooth Slab: + material: DOUBLE_STEP + durability: 8 + amount: 2 + Sandstone Slab to Smooth Double Sandstone Slab: + inputs: + s: + Sandstone Slab: + material: STEP + durability: 1 + shape: + - ss + - ss + output: + Smooth Double Sandstone Slab: + material: DOUBLE_STEP + durability: 9 + amount: 2 production_factories: Bakery: name: Bakery From cf7f5417c370f394d3e6780b2fa61f37d7056657 Mon Sep 17 00:00:00 2001 From: Akiyama64 Date: Wed, 13 May 2015 11:13:53 -0400 Subject: [PATCH 046/459] Adding Allium to Biolab This is a copy of this pull https://github.com/ttk2/FactoryMod/pull/85 In honor of this thread http://www.reddit.com/r/Civcraft/comments/35etth/alliums/ , since alliums and flower forests do not exist on Civcraft, let's make a recipe for it in the Biolab, please. --- config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config.yml b/config.yml index c7a2a979..9f768fe4 100644 --- a/config.yml +++ b/config.yml @@ -1933,6 +1933,7 @@ production_factories: - Mutate_Dark_Oak_Saplings - Mutate_Podzol - Mutate_Grassless_Dirt + - Sequencing_Allium - Sequencing_Sunflower - Sequencing_Lilac - Sequencing_Double_Tallgrass @@ -7427,6 +7428,21 @@ production_recipes: material: SPONGE amount: 32 display_name: Bastion + Sequencing_Allium: + name: Sequencing Allium + inputs: + Poppy: + material: RED_ROSE + amount: 8 + Blue Orchid: + material: RED_ROSE + amount: 8 + durablity: 1 + outputs: + Allium: + material: RED_ROSE + amount: 4 + durability: 2 Sequencing_Sunflower: name: Sequencing Sunflower inputs: From 87ab0a41578b05110d5b21dd5d478d50c729923e Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Fri, 15 May 2015 19:04:27 -0400 Subject: [PATCH 047/459] add set cost for anvils --- config.yml | 2 ++ pom.xml | 20 ++++--------- .../listeners/FactoryModListener.java | 28 +++++++++++++++++++ 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/config.yml b/config.yml index c7a2a979..233362c7 100644 --- a/config.yml +++ b/config.yml @@ -79,6 +79,8 @@ general: citadel_enabled: true factory_interaction_material: STICK disable_experience: true + should_default_anvil_cost: false + set_default_anvil_cost: 37 production_general: update_cycle: 20 repair_period: 28 diff --git a/pom.xml b/pom.xml index 493a354b..1932bbd7 100644 --- a/pom.xml +++ b/pom.xml @@ -31,9 +31,9 @@ - org.bukkit - bukkit - 1.7.9-R0.1 + org.spigotmc + Spigot1.8.3 + 1.8.3 provided @@ -51,17 +51,9 @@ - - bukkit-repo - http://repo.bukkit.org/content/groups/public/ - - - NameLayer-repo - http://192.99.169.83:8080/plugin/repository/project/NameLayer-master/Build/20/repository/ - - - Citadel-repo - http://192.99.169.83:8080/plugin/repository/project/Citadel-master/Build/40/repository/ + + Jenkins-repo + http://civcraft.co:8080/plugin/repository/everything/ diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index aa683e9d..07d9c079 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,9 +2,13 @@ import java.util.List; +import net.minecraft.server.v1_8_R2.ItemStack; + +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -14,10 +18,15 @@ import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityPortalEvent; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCreativeEvent; +import org.bukkit.event.inventory.InventoryInteractEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.AnvilInventory; +import org.bukkit.inventory.Inventory; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; @@ -491,4 +500,23 @@ public void entityTeleportEvent(EntityPortalEvent event){ } } + @EventHandler(priority = EventPriority.NORMAL) + public void anvilRepairEvent(InventoryClickEvent event){ + if (!FactoryModPlugin.SHOULD_SET_ANVIL_COST) + return; + if (event instanceof InventoryCreativeEvent) + return; + Inventory inv = event.getClickedInventory(); + if (!(inv instanceof AnvilInventory)) + return; + + org.bukkit.inventory.ItemStack stack = inv.getItem(2); + if (stack == null) + return; + + ItemStack s = CraftItemStack.asNMSCopy(stack); + s.setRepairCost(FactoryModPlugin.GET_SET_ANVIL_COST); + inv.setItem(3, (CraftItemStack.asBukkitCopy(s))); + } + } From 79d4108e1fd5e3fa39a903da0b6091239b96e859 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Fri, 15 May 2015 19:06:23 -0400 Subject: [PATCH 048/459] Woops this is needed... --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index f19bdf94..3a3f38d7 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -79,6 +79,8 @@ public class FactoryModPlugin extends JavaPlugin public static long REPAIR_PERIOD; public static boolean REDSTONE_START_ENABLED; public static boolean LEVER_OUTPUT_ENABLED; + public static boolean SHOULD_SET_ANVIL_COST; + public static int GET_SET_ANVIL_COST; public void onEnable() { @@ -173,6 +175,9 @@ public void initConfig() LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled",true); //Do we allow factories to be started with redstone? REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled",true); + //Set anvil repair cost + SHOULD_SET_ANVIL_COST = config.getBoolean("general.should_default_anvil_cost", false); + GET_SET_ANVIL_COST = config.getInt("general.set_default_anvil_cost", 37); int g = 0; Iterator disabledRecipes=config.getStringList("crafting.disable").iterator(); while(disabledRecipes.hasNext()) From 95875dfcdf94639af30207d7df854fb58a0c5a71 Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sat, 16 May 2015 11:23:11 -0400 Subject: [PATCH 049/459] allow durability values to be added --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 3a3f38d7..9b43e55f 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -182,7 +182,11 @@ public void initConfig() Iterator disabledRecipes=config.getStringList("crafting.disable").iterator(); while(disabledRecipes.hasNext()) { - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disabledRecipes.next())); + String mat = disabledRecipes.next(); + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); + int dur = config.getInt("crafting.disable." + mat + ".durability", 0); + short s = (short) dur; + recipeItemStack.setDurability(s); List tempList = getServer().getRecipesFor(recipeItemStack); for (int itterator = 0; itterator < tempList.size(); itterator ++) { From 0fa37ac2a27fa6efadb49f0de976ef7a0aaab827 Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sat, 16 May 2015 11:38:12 -0400 Subject: [PATCH 050/459] add disabled recipes for three new 1.8 blocks --- config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.yml b/config.yml index 233362c7..720dcc47 100644 --- a/config.yml +++ b/config.yml @@ -169,6 +169,15 @@ printing_presses: crafting: disable: + CHISSELED_STONE_BRICK: + material: SMOOTH_BRICK + durability: 3 + MOSSY_COBBLE: + material: SMOOTH_BRICK + durability: 1 + CRACKED_STONE_BRICK: + material: SMOOTH_BRICK + durability: 2 enable: XP to Emerald: inputs: From 9affd4e53e5ee792558467aace2d6a3f692df0ab Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sat, 16 May 2015 11:38:52 -0400 Subject: [PATCH 051/459] Update FactoryModPlugin.java --- .../github/igotyou/FactoryMod/FactoryModPlugin.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 9b43e55f..3ecb8676 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -179,12 +179,13 @@ public void initConfig() SHOULD_SET_ANVIL_COST = config.getBoolean("general.should_default_anvil_cost", false); GET_SET_ANVIL_COST = config.getInt("general.set_default_anvil_cost", 37); int g = 0; - Iterator disabledRecipes=config.getStringList("crafting.disable").iterator(); - while(disabledRecipes.hasNext()) + Set disabledRecipes=config.getConfigurationSection("crafting.disable").getKeys(false); + Iterator ir = disabledRecipes.iterator(); + while(ir.hasNext()) { - String mat = disabledRecipes.next(); - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); - int dur = config.getInt("crafting.disable." + mat + ".durability", 0); + String con = ir.next(); + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(config.getString(con + ".material"))); + int dur = config.getInt("crafting.disable." + con + ".durability", 0); short s = (short) dur; recipeItemStack.setDurability(s); List tempList = getServer().getRecipesFor(recipeItemStack); From f99d4a1c7569b9891ac173d9001ffb3e734c672a Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sat, 16 May 2015 11:40:56 -0400 Subject: [PATCH 052/459] Added missing import --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 3ecb8676..26521f02 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Material; From 66ced8aef141b53466f28d09ab2283c18ccd86c5 Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sat, 16 May 2015 11:55:13 -0400 Subject: [PATCH 053/459] Lets try this --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 26521f02..c8dfb3a9 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -185,7 +185,8 @@ public void initConfig() while(ir.hasNext()) { String con = ir.next(); - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(config.getString(con + ".material"))); + String mat = config.getString("crafting.disable." + con + ".material"); + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); int dur = config.getInt("crafting.disable." + con + ".durability", 0); short s = (short) dur; recipeItemStack.setDurability(s); From ee97ffb288501afa6ab8bf88c82aca2c02c4aac4 Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Sun, 17 May 2015 16:13:57 +0300 Subject: [PATCH 054/459] Fix for a bug with removing recipes --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index c8dfb3a9..02a8da6e 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -440,7 +440,7 @@ private void removeRecipe(Recipe removalRecipe) while (itterator.hasNext()) { Recipe recipe = itterator.next(); - if (recipe.getResult().getType() == removalRecipe.getResult().getType()) + if (recipe.getResult().equals(removalRecipe.getResult())) { itterator.remove(); } From 05adaa635b0f7a74ae652e71e1bdc044358a8749 Mon Sep 17 00:00:00 2001 From: Akiyama64 Date: Wed, 20 May 2015 18:34:34 -0700 Subject: [PATCH 055/459] Fixing syntax of Allium recipe Misspelling fixed, and spaces reorganized. Should work, YAMLint says. Thank you, ProgrammerDan, for finding the extra space. --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index b98c3a82..47610927 100644 --- a/config.yml +++ b/config.yml @@ -7441,14 +7441,14 @@ production_recipes: display_name: Bastion Sequencing_Allium: name: Sequencing Allium - inputs: + inputs: Poppy: material: RED_ROSE - amount: 8 + amount: 8 Blue Orchid: material: RED_ROSE - amount: 8 - durablity: 1 + amount: 8 + durability: 1 outputs: Allium: material: RED_ROSE From 8b2ac7bcf2e9a47078986a000b4201a52dd8107b Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 21 May 2015 20:18:36 -0400 Subject: [PATCH 056/459] Depth Strider and Aqua Affinity gold armor Adds depth strider enchants 1-3 to gold boot factory enchant list and aqua affinity to gold helmet factory enchant list. --- config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config.yml b/config.yml index 47610927..9f7120cd 100644 --- a/config.yml +++ b/config.yml @@ -5675,6 +5675,10 @@ production_recipes: type: PROTECTION_PROJECTILE level: 4 probability: 0.4 + Aqua Affinity 1: + type: WATER_WORKER + level: 1 + probability: 0.3 Dye_Brown_Wool_Black: name: Dye Brown Wool Black inputs: @@ -5786,6 +5790,18 @@ production_recipes: type: PROTECTION_PROJECTILE level: 4 probability: 0.4 + Depth Strider 1: + type: DEPTH_STRIDER + level: 1 + probability: 0.5 + Depth Strider 2: + type: DEPTH_STRIDER + level: 2 + probability: 0.4 + Depth Strider 3: + type: DEPTH_STRIDER + level: 3 + probability: 0.3 Dye_Gray_Wool_Yellow: name: Dye Gray Wool Yellow inputs: From 19bde1ca8f853710046f58a93fc19c8cefbb7f76 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Fri, 22 May 2015 00:18:17 -0400 Subject: [PATCH 057/459] Added repair factory to factorymod --- config.yml | 50 +++ plugin.yml | 2 +- pom.xml | 2 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 10 +- .../igotyou/FactoryMod/FactoryObject.java | 1 + .../FactoryMod/Factorys/RepairFactory.java | 285 ++++++++++++++++++ .../listeners/FactoryModListener.java | 30 -- .../managers/FactoryModManager.java | 10 + .../managers/RepairFactoryManager.java | 193 ++++++++++++ .../properties/ProductionProperties.java | 1 + .../properties/RepairFactoryProperties.java | 92 ++++++ 11 files changed, 643 insertions(+), 33 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java create mode 100644 src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java create mode 100644 src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java diff --git a/config.yml b/config.yml index 47610927..8e0dadfc 100644 --- a/config.yml +++ b/config.yml @@ -71,6 +71,56 @@ # data: 0 (data value of the item stack # display_name: (display name of the item, null by default) # lore: (lore of the item, null by default) +######################################################################### +#Example for RepairFactory +#repair_factory: +# fuel: +# Charcoal: +# material: 'COAL' +# amount: 1 +# durability: 1 +# fuel_time: 5 +# repair_multiple: 1 +# name: 'Repair Factory' +# production_time: 20 +# costs: +# construction: +# A_DIAMOND: +# material: 'DIAMOND_BLOCK' +# amount: 1 +# repair: +# AA_DIAMOND: +# material: 'DIAMOND_BLOCK' +# amount: 1 +# RECIPE: +# AA_DIAMOND: +# material: 'DIAMOND_BLOCK' +# amount: 1 + + +repair_factory: + fuel: + Charcoal: + material: 'COAL' + amount: 1 + durability: 1 + fuel_time: 5 + repair_multiple: 1 + name: 'Repair Factory' + production_time: 20 + costs: + construction: + A_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 + repair: + AA_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 + RECIPE: + AAA_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 copy_defaults: false general: central_block: WORKBENCH diff --git a/plugin.yml b/plugin.yml index 9b24ec27..648d1ac7 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.3.4 +version: 1.3.5 depend: [NameLayer, Citadel] diff --git a/pom.xml b/pom.xml index 1932bbd7..496419ab 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3.4-${build.number} + 1.3.5-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 02a8da6e..3d32eed1 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -31,6 +31,7 @@ import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; @@ -45,6 +46,7 @@ public class FactoryModPlugin extends JavaPlugin public static HashMap productionRecipes; public PrintingPressProperties printingPressProperties; public NetherFactoryProperties netherFactoryProperties; + public RepairFactoryProperties repairFactoryProperties; public static final String VERSION = "v1.0"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin @@ -54,6 +56,7 @@ public class FactoryModPlugin extends JavaPlugin public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; + public static final String REPAIR_FACTORY_SAVE_FILE = "repairSaves"; public static boolean DISABLE_PORTALS; public static int NETHER_SCALE; public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; @@ -196,7 +199,6 @@ public void initConfig() removeRecipe(tempList.get(itterator)); g++; } - } //Enable the following recipes ConfigurationSection configCraftingEnable=config.getConfigurationSection("crafting.enable"); @@ -312,8 +314,10 @@ public void initConfig() ConfigurationSection configPrintingPresses=config.getConfigurationSection("printing_presses"); ConfigurationSection configNetherFactory=config.getConfigurationSection("nether_factory"); + ConfigurationSection configRepairFactory=config.getConfigurationSection("repair_factory"); printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); + repairFactoryProperties = RepairFactoryProperties.fromConfig(this, configRepairFactory); sendConsoleMessage("Finished initializing FactoryMod Config."); } @@ -477,6 +481,10 @@ public NetherFactoryProperties getNetherFactoryProperties() { return netherFactoryProperties; } + public RepairFactoryProperties getRepairFactoryProperties() { + return repairFactoryProperties; + } + private static FactoryModPlugin plugin; public static FactoryModPlugin getPlugin(){ return plugin; diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java index 30b72d21..2e1c6bde 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ b/src/com/github/igotyou/FactoryMod/FactoryObject.java @@ -33,6 +33,7 @@ public enum FactoryType { PRODUCTION, PRINTING_PRESS, + REPAIR_FACTORY, NETHER_FACTORY } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java new file mode 100644 index 00000000..6479effe --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -0,0 +1,285 @@ +package com.github.igotyou.FactoryMod.Factorys; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.server.v1_8_R2.ItemStack; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; +import com.github.igotyou.FactoryMod.managers.RepairFactoryManager; +import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +public class RepairFactory extends BaseFactory{ + + private ReinforcementManager rm = Citadel.getReinforcementManager(); + private RepairFactoryProperties rfp; + private RepairFactoryMode mode; + + // Constructor for when initial creation of factory. + public RepairFactory(Location factoryLocation, + Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, RepairFactoryProperties repairFactoryProperties, RepairFactoryManager repairFactoryManager) { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, + FactoryType.REPAIR_FACTORY, "Repair Factory"); + this.rfp = repairFactoryProperties; + this.mode = RepairFactoryMode.REPAIR; + } + + public RepairFactory(Location factoryLocation, + Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, RepairFactoryProperties repairFactoryProperties, RepairFactoryManager repairFactoryManager, + RepairFactoryMode mode, double currentRepair, long timeDisrepair) { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.REPAIR_FACTORY, active, + "Repair Factory", 0, 0, currentRepair, timeDisrepair); + this.rfp = repairFactoryProperties; + this.mode = mode; + } + + @Override + public boolean isRepairing() { + return mode == RepairFactoryMode.REPAIR; + } + + @Override + public ItemList getFuel() { + return rfp.getFuel(); + } + + @Override + public void update() + { + if (mode == RepairFactoryMode.REPAIR){ + //if factory is turned on + if (active){ + //if the materials required to produce the current recipe are in the factory inventory + if (checkHasMaterials()){ + //if the factory has been working for less than the required time for the recipe + if (currentProductionTimer < getProductionTime()){ + //if the factory power source inventory has enough fuel for at least 1 energyCycle + if (isFuelAvailable()){ + //if the time since fuel was last consumed is equal to how often fuel needs to be consumed + if (currentEnergyTimer == getEnergyTime()-1){ + //remove one fuel. + getFuel().removeFrom(getPowerSourceInventory()); + //0 seconds since last fuel consumption + currentEnergyTimer = 0; + fuelConsumed(); + } + else { + currentEnergyTimer++; + } + //increment the production timer + currentProductionTimer ++; + postUpdate(); + } + //if there is no fuel Available turn off the factory + else { + powerOff(); + } + } + //if the production timer has reached the recipes production time remove input from chest, and add output material + else if (currentProductionTimer >= getProductionTime()){ + //Repairs the factory + repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); + + currentProductionTimer = 0; + powerOff(); + } + } + else { + powerOff(); + } + } + } + else if (mode == RepairFactoryMode.RESET_ITEMS) { + if (active){ + //if the materials required to produce the current recipe are in the factory inventory + if (checkHasMaterials()){ + //if the factory has been working for less than the required time for the recipe + if (currentProductionTimer < getProductionTime()){ + //if the factory power source inventory has enough fuel for at least 1 energyCycle + if (isFuelAvailable()){ + //if the time since fuel was last consumed is equal to how often fuel needs to be consumed + if (currentEnergyTimer == getEnergyTime()-1){ + //remove one fuel. + getFuel().removeFrom(getPowerSourceInventory()); + //0 seconds since last fuel consumption + currentEnergyTimer = 0; + fuelConsumed(); + } + else { + currentEnergyTimer++; + } + //increment the production timer + currentProductionTimer ++; + postUpdate(); + } + //if there is no fuel Available turn off the factory + else { + powerOff(); + } + } + //if the production timer has reached the recipes production time remove input from chest, and add output material + else if (currentProductionTimer >= getProductionTime()){ + consumeInputs(); // consumes the items needed. + + // Sets all the items to the miniumum needed repair cost. + recipeFinished(); + + currentProductionTimer = 0; + powerOff(); + } + } + else { + powerOff(); + } + } + } + } + + @Override + public double getEnergyTime() { + return rfp.getEnergyTime(); + } + + @Override + public double getProductionTime() { + return rfp.getProductionTime(); + } + + @Override + public ItemList getInputs() { + return rfp.getRecipeMaterials(); + } + + @Override + public ItemList getOutputs() { + return new ItemList(); + } + + @Override + public ItemList getRepairs() { + return rfp.getRepairMaterials(); + } + + @Override + protected void recipeFinished() { + getInputs().removeOneFrom(getInventory()); + org.bukkit.inventory.ItemStack[] contents = getInventory().getContents(); + for (int x = 0; x < contents.length; x++){ + org.bukkit.inventory.ItemStack stack = contents[x]; + if (stack == null) + continue; + ItemStack s = CraftItemStack.asNMSCopy(stack); + s.setRepairCost(1); + getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); + } + } + + @Override + public int getMaxRepair() { + return rfp.getRepair(); + } + + @Override + public List getCentralBlockResponse() { + List responses=new ArrayList(); + if (!active) { + RepairFactoryMode mode = this.mode.getNext(); + this.mode = mode; + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to " + this.mode.getDescription() + ".")); + } else { + responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); + } + return responses; + } + + @Override + public List getChestResponse(){ + List responses=new ArrayList(); + String status=active ? "On" : "Off"; + double time = 0; + int maxRepair = getMaxRepair(); + boolean maintenanceActive = maxRepair!=0; + String response = "Current costs are : "; // the response specific to the mode. + if (mode.getId() == 0){ + time = getEnergyTime(); + response += getRepairs().toString(); + } + else if (mode.getId() == 1){ + time = getProductionTime(); + response += getInputs().toString(); + } + String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/time)+"% done." : ""; + int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, rfp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); + + if(!getRepairs().isEmpty()&&maintenanceActive) + { + int amountAvailable=getRepairs().amountAvailable(getInventory()); + int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; + int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); + } + + return responses; + } + + public enum RepairFactoryMode { + REPAIR(0, "Repair Factory"), + RESET_ITEMS(1, "Reset Items"); + + private static final int MAX_ID = 2; + private int id; + private String description; + + private RepairFactoryMode(int id, String description){ + this.id = id; + this.description = description; + } + + public static RepairFactoryMode byId(int id){ + for (RepairFactoryMode mode: RepairFactoryMode.values()) + if (mode.getId() == id) + return mode; + return null; + } + + public String getDescription() { + return description; + } + + public int getId() { + return id; + } + + public RepairFactoryMode getNext(){ + int nextId = (getId() + 1) % MAX_ID; + return byId(nextId); + } + } + + public RepairFactoryMode getMode(){ + return mode; + } + + public RepairFactoryProperties getProperties(){ + return rfp; + } +} diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 07d9c079..baab613f 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,13 +2,9 @@ import java.util.List; -import net.minecraft.server.v1_8_R2.ItemStack; - -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -18,16 +14,10 @@ import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityPortalEvent; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryCreativeEvent; -import org.bukkit.event.inventory.InventoryInteractEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -import org.bukkit.inventory.AnvilInventory; -import org.bukkit.inventory.Inventory; - import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; @@ -499,24 +489,4 @@ public void entityTeleportEvent(EntityPortalEvent event){ event.setCancelled(true); } } - - @EventHandler(priority = EventPriority.NORMAL) - public void anvilRepairEvent(InventoryClickEvent event){ - if (!FactoryModPlugin.SHOULD_SET_ANVIL_COST) - return; - if (event instanceof InventoryCreativeEvent) - return; - Inventory inv = event.getClickedInventory(); - if (!(inv instanceof AnvilInventory)) - return; - - org.bukkit.inventory.ItemStack stack = inv.getItem(2); - if (stack == null) - return; - - ItemStack s = CraftItemStack.asNMSCopy(stack); - s.setRepairCost(FactoryModPlugin.GET_SET_ANVIL_COST); - inv.setItem(3, (CraftItemStack.asBukkitCopy(s))); - } - } diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 3cf948f7..99f8925f 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -67,6 +67,7 @@ private void initializeManagers() //{ initializeProductionManager(); initializePrintingPressManager(); + initializeRepairFactoryManager(); initializeNetherFactoryManager(); //} } @@ -101,6 +102,15 @@ private void initializeNetherFactoryManager() managers.add(netherMan); } + /** + * Initializes the RepairFactory manager + */ + private void initializeRepairFactoryManager(){ + RepairFactoryManager repairMan = new RepairFactoryManager(plugin); + + managers.add(repairMan); + } + /** * When plugin disabled, this is called. */ diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java new file mode 100644 index 00000000..5f1731f8 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -0,0 +1,193 @@ +package com.github.igotyou.FactoryMod.managers; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; +import com.github.igotyou.FactoryMod.interfaces.Factory; +import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; + +public class RepairFactoryManager implements Manager{ + + private FactoryModPlugin plugin; + private ReinforcementManager rm = Citadel.getReinforcementManager(); + private List repairFactories; + private boolean isLogging = true; + private long repairTime; + + public RepairFactoryManager(FactoryModPlugin plugin){ + this.plugin = plugin; + repairFactories = new ArrayList(); + updateFactorys(); + } + + @Override + public void save(File file) throws IOException { + repairTime=System.currentTimeMillis(); + FileOutputStream fileOutputStream = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); + int version = 1; + oos.writeInt(version); + oos.writeInt(repairFactories.size()); + for (RepairFactory factory: repairFactories){ + Location centerLocation = factory.getCenterLocation(); + Location inventoryLocation = factory.getInventoryLocation(); + Location powerLocation = factory.getPowerSourceLocation(); + + oos.writeUTF(centerLocation.getWorld().getName()); + + oos.writeInt(centerLocation.getBlockX()); + oos.writeInt(centerLocation.getBlockY()); + oos.writeInt(centerLocation.getBlockZ()); + + oos.writeInt(inventoryLocation.getBlockX()); + oos.writeInt(inventoryLocation.getBlockY()); + oos.writeInt(inventoryLocation.getBlockZ()); + + oos.writeInt(powerLocation.getBlockX()); + oos.writeInt(powerLocation.getBlockY()); + oos.writeInt(powerLocation.getBlockZ()); + + oos.writeInt(factory.getMode().getId()); + oos.writeDouble(factory.getCurrentRepair()); + oos.writeLong(factory.getTimeDisrepair()); + } + oos.flush(); + fileOutputStream.close(); + } + + @Override + public void load(File file) throws IOException { + isLogging = false; + try { + repairTime=System.currentTimeMillis(); + FileInputStream fileInputStream = new FileInputStream(file); + ObjectInputStream ois = new ObjectInputStream(fileInputStream); + int version = ois.readInt(); + assert(version == 1); + int count = ois.readInt(); + int i = 0; + for (i = 0; i < count; i++) + { + String worldName = ois.readUTF(); + World world = Bukkit.getWorld(worldName); + + Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + + RepairFactoryMode mode = RepairFactoryMode.byId(ois.readInt()); + double currentRepair = ois.readDouble(); + long timeDisrepair = ois.readLong(); + + RepairFactory factory = new RepairFactory(centerLocation, inventoryLocation, powerLocation, false, plugin.getRepairFactoryProperties(), + this, mode, currentRepair, timeDisrepair); + addFactory(factory); + } + fileInputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void updateFactorys() { + + } + + @Override + public InteractionResponse createFactory(Location factoryLocation, + Location inventoryLocation, Location powerLocation) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InteractionResponse addFactory(Factory factory) { + RepairFactory repairFactory = (RepairFactory) factory; + if (repairFactory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && + (!factoryExistsAt(repairFactory.getCenterLocation()) + || !factoryExistsAt(repairFactory.getInventoryLocation()) + || !factoryExistsAt(repairFactory.getPowerSourceLocation()))) + { + repairFactories.add(repairFactory); + if (isLogging){ + FactoryModPlugin.sendConsoleMessage("Repair Factory crreated: " + repairFactory.getProperties().getName()); + } + return new InteractionResponse(InteractionResult.SUCCESS, ""); + } + else { + FactoryModPlugin.sendConsoleMessage("Repair Factory failed to create: " + repairFactory.getProperties().getName()); + return new InteractionResponse(InteractionResult.FAILURE, ""); + } + } + + @Override + public Factory getFactory(Location factoryLocation) { + for (RepairFactory factory: repairFactories){ + if (factory.getCenterLocation().equals(factoryLocation) + || factory.getInventoryLocation().equals(factoryLocation) + || factory.getPowerSourceLocation().equals(factoryLocation)) + return factory; + } + return null; + } + + @Override + public boolean factoryExistsAt(Location factoryLocation) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean factoryWholeAt(Location factoryLocation) { + boolean returnValue = false; + if (getFactory(factoryLocation) != null) + { + returnValue = true; + } + return returnValue; + } + + @Override + public void removeFactory(Factory factory) { + if (!(factory instanceof RepairFactory)){ + FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); + return; + } + + RepairFactory repairFactory = (RepairFactory) factory; + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Repair factory removed: ") + .append(repairFactory.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(repairFactory.getCenterLocation())) + .toString()); + + repairFactories.remove(repairFactory); + } + + @Override + public String getSavesFileName() { + return FactoryModPlugin.REPAIR_FACTORY_SAVE_FILE; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java index 4172b3aa..702afc6b 100644 --- a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java @@ -57,4 +57,5 @@ public String getName() { return name; } + } diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java new file mode 100644 index 00000000..78651f2e --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -0,0 +1,92 @@ +package com.github.igotyou.FactoryMod.properties; + +import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +public class RepairFactoryProperties { + + private ItemList constructionMaterials; + private ItemList fuel; + private ItemList repairMaterials; + private ItemList recipeMaterials; + private int energyTime; + private String name; + private int repair; + private double repairTime; + private double productionTime; + + public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, + ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, + double productionTime, ItemList recipeMaterials){ + this.constructionMaterials = constructionMaterials; + this.fuel = fuel; + this.repairMaterials = repairMaterials; + this.energyTime = energyTime; + this.name = name; + this.repair = repair; + this.repairTime = repairTime; + this.productionTime = productionTime; + this.recipeMaterials = recipeMaterials; + } + + public int getRepair() { + return repair; + } + + public ItemList getConstructionMaterials(){ + return constructionMaterials; + } + + public ItemList getFuel(){ + return fuel; + } + + public ItemList getRepairMaterials(){ + return repairMaterials; + } + + public ItemList getRecipeMaterials(){ + return recipeMaterials; + } + + public int getEnergyTime() + { + return energyTime; + } + + public String getName() + { + return name; + } + + public double getRepairTime() + { + return repairTime; + } + + public double getProductionTime(){ + return productionTime; + } + + public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){ + ItemList rfFuel = plugin.getItems(section.getConfigurationSection("fuel")); + if (rfFuel.isEmpty()){ + rfFuel = new ItemList(); + rfFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal")); + } + ConfigurationSection costs = section.getConfigurationSection("costs"); + ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); + ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); + ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + int rfEnergyTime = section.getInt("fuel_time"); + int rfRepair = costs.getInt("repair_multiple", 1); + String rfName = section.getString("name", "Repair Factory"); + int repairTime = section.getInt("repair_time", 12); + int productionTime = section.getInt("production_time"); + return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse); + } +} From 3315064174d34197be9a9b572e1af78b9f22188d Mon Sep 17 00:00:00 2001 From: hlprimm Date: Fri, 22 May 2015 09:35:45 -0500 Subject: [PATCH 058/459] CLAY_BALL to CLAY change Changed CLAY_BALL recipe to CLAY recipes so people don't waste time breaking laying down clay blocks into clay balls just to run it through the factory. Divided clay_ball values by 4 since it takes 4 balls to make one block. --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 8e0dadfc..fa1c2a01 100644 --- a/config.yml +++ b/config.yml @@ -4579,8 +4579,8 @@ production_recipes: production_time: 32 inputs: Clay: - material: CLAY_BALL - amount: 512 + material: CLAY + amount: 128 outputs: Bricks: material: CLAY_BRICK @@ -4590,8 +4590,8 @@ production_recipes: production_time: 5 inputs: Clay: - material: CLAY_BALL - amount: 64 + material: CLAY + amount: 16 outputs: Flower Pots: material: FLOWER_POT_ITEM From 0c67a8484f143e5986c0edecbf77e4c7a5d007bb Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Fri, 22 May 2015 21:56:46 -0400 Subject: [PATCH 059/459] Added some missing methods --- .../managers/RepairFactoryManager.java | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 5f1731f8..b018f3e6 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -12,6 +12,9 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.inventory.Inventory; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; @@ -21,7 +24,10 @@ import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; @@ -110,14 +116,37 @@ public void load(File file) throws IOException { @Override public void updateFactorys() { - + plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() + { + @Override + public void run() + { + for (RepairFactory factory: repairFactories) + { + factory.update(); + } + } + }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); } @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation) { - // TODO Auto-generated method stub - return null; + RepairFactoryProperties repairFactoryProperties = plugin.getRepairFactoryProperties(); + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); + if(!factoryExistsAt(factoryLocation)) { + if (constructionMaterials.oneIn(chestInventory)){ + RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties, + this); + return addFactory(factory); + } + else + return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly."); + } + return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); } @Override @@ -153,8 +182,7 @@ public Factory getFactory(Location factoryLocation) { @Override public boolean factoryExistsAt(Location factoryLocation) { - // TODO Auto-generated method stub - return false; + return getFactory(factoryLocation) != null; } @Override From bd3e8110fa8eddfe81759f5be368256c4fec02b0 Mon Sep 17 00:00:00 2001 From: ribagi Date: Sat, 23 May 2015 16:26:08 -0700 Subject: [PATCH 060/459] Better NF Scaling Original was e^(1/(dis / rad)) It is now e^(1/(dis / rad)) - e + 1 --- .../igotyou/FactoryMod/managers/NetherFactoryManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 578b9146..fa040b8a 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -424,7 +424,7 @@ public double getScalingFactor(Location location) double distance = location.distance(factoryLoc); if (distance <= properties.getScalingRadius()) { - scalingFactor = scalingFactor * Math.exp(1/(distance/properties.getCostScalingRadius())); + scalingFactor = scalingFactor * ( Math.exp(1/(distance/properties.getCostScalingRadius())) - Math.exp(1.0) + 1.0 ); } } } From d3bec2a425546ae2ba628ae306b59d3179b3023a Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sat, 23 May 2015 23:32:49 -0400 Subject: [PATCH 061/459] fix config for repair factory --- config.yml | 62 ++++++++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 44 deletions(-) diff --git a/config.yml b/config.yml index e8bcfa6b..c6664fbe 100644 --- a/config.yml +++ b/config.yml @@ -72,55 +72,29 @@ # display_name: (display name of the item, null by default) # lore: (lore of the item, null by default) ######################################################################### -#Example for RepairFactory -#repair_factory: -# fuel: -# Charcoal: -# material: 'COAL' -# amount: 1 -# durability: 1 -# fuel_time: 5 -# repair_multiple: 1 -# name: 'Repair Factory' -# production_time: 20 -# costs: -# construction: -# A_DIAMOND: -# material: 'DIAMOND_BLOCK' -# amount: 1 -# repair: -# AA_DIAMOND: -# material: 'DIAMOND_BLOCK' -# amount: 1 -# RECIPE: -# AA_DIAMOND: -# material: 'DIAMOND_BLOCK' -# amount: 1 - - repair_factory: fuel: Charcoal: material: 'COAL' amount: 1 durability: 1 - fuel_time: 5 - repair_multiple: 1 - name: 'Repair Factory' - production_time: 20 - costs: - construction: - A_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 - repair: - AA_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 - RECIPE: - AAA_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 + fuel_time: 5 + repair_multiple: 1 + name: 'Repair Factory' + production_time: 20 + costs: + construction: + A_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 + repair: + AA_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 + RECIPE: + AAA_DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 1 copy_defaults: false general: central_block: WORKBENCH @@ -7676,4 +7650,4 @@ production_recipes: outputs: Eye of Ender: material: EYE_OF_ENDER - amount: 256 + amount: 256 \ No newline at end of file From be0d626f7a7bc8009ef748a73b40384a8484c68b Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 24 May 2015 15:27:23 -0400 Subject: [PATCH 062/459] Fix some issues with repair factory --- config.yml | 2 +- .../FactoryMod/Factorys/RepairFactory.java | 76 ++++++++++++++++++- .../managers/RepairFactoryManager.java | 5 +- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index c6664fbe..949f9db9 100644 --- a/config.yml +++ b/config.yml @@ -91,7 +91,7 @@ repair_factory: AA_DIAMOND: material: 'DIAMOND_BLOCK' amount: 1 - RECIPE: + recipe: AAA_DIAMOND: material: 'DIAMOND_BLOCK' amount: 1 diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 6479effe..3b3c5b99 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -148,6 +148,80 @@ else if (currentProductionTimer >= getProductionTime()){ } } } + + @Override + public List togglePower(){ + List response=new ArrayList(); + //if the factory is turned off + if (!active) + { + //if the factory isn't broken or the current recipe can repair it + if(!isBroken()||isRepairing()) + { + //is there fuel enough for at least once energy cycle? + if (isFuelAvailable()) + { + //are there enough materials for the current recipe in the chest? + if (checkHasMaterials()) + { + //turn the factory on + powerOn(); + //return a success message + response.add(new InteractionResponse(InteractionResult.SUCCESS, "Factory activated!")); + return response; + } + //there are not enough materials for the recipe! + else + { + //return a failure message, containing which materials are needed for the recipe + //[Requires the following: Amount Name, Amount Name.] + //[Requires one of the following: Amount Name, Amount Name.] + + ItemList needAll=new ItemList(); + ItemList allInputs = null; + + if (mode.equals(RepairFactoryMode.REPAIR)){ + allInputs = rfp.getRepairMaterials(); + } + else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ + allInputs = rfp.getRecipeMaterials(); + } + + needAll.addAll(allInputs.getDifference(getInventory())); + if(!needAll.isEmpty()) + { + response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); + } else if (allInputs == null || allInputs.isEmpty()) { + System.out.println("getAllInputs() returned null or empty; recipe is returning no expectation of input!"); + } + return response; + } + } + //if there isn't enough fuel for at least one energy cycle + else + { + //return a error message + int multiplesRequired=(int)Math.ceil(getProductionTime()/(double)getEnergyTime()); + response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is missing fuel! ("+getFuel().getMultiple(multiplesRequired).toString()+")")); + return response; + } + } + else + { + response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is in disrepair!")); + return response; + } + } + //if the factory is on already + else + { + //turn the factory off + powerOff(); + //return success message + response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory has been deactivated!")); + return response; + } + } @Override public double getEnergyTime() { @@ -230,7 +304,7 @@ else if (mode.getId() == 1){ responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); - if(!getRepairs().isEmpty()&&maintenanceActive) + if(!getRepairs().isEmpty()&&maintenanceActive&& mode == RepairFactoryMode.REPAIR) { int amountAvailable=getRepairs().amountAvailable(getInventory()); int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index b018f3e6..85a6b13a 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -141,6 +141,7 @@ public InteractionResponse createFactory(Location factoryLocation, if (constructionMaterials.oneIn(chestInventory)){ RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties, this); + repairFactoryProperties.getConstructionMaterials().removeFrom(chestInventory); return addFactory(factory); } else @@ -159,9 +160,9 @@ public InteractionResponse addFactory(Factory factory) { { repairFactories.add(repairFactory); if (isLogging){ - FactoryModPlugin.sendConsoleMessage("Repair Factory crreated: " + repairFactory.getProperties().getName()); + FactoryModPlugin.sendConsoleMessage("Repair Factory created: " + repairFactory.getProperties().getName()); } - return new InteractionResponse(InteractionResult.SUCCESS, ""); + return new InteractionResponse(InteractionResult.SUCCESS, "You have successfully created a Repair Factory."); } else { FactoryModPlugin.sendConsoleMessage("Repair Factory failed to create: " + repairFactory.getProperties().getName()); From 4563af5811e2a9fe19b2ee0458e644760ae0db96 Mon Sep 17 00:00:00 2001 From: TealNerd Date: Mon, 25 May 2015 00:05:14 -0500 Subject: [PATCH 063/459] Attempted to compactor --- config.yml | 26 ++ .../igotyou/FactoryMod/FactoryModPlugin.java | 9 + .../igotyou/FactoryMod/FactoryObject.java | 3 +- .../FactoryMod/Factorys/Compactor.java | 303 ++++++++++++++++++ .../FactoryMod/managers/CompactorManager.java | 177 ++++++++++ .../managers/FactoryModManager.java | 10 + .../properties/CompactorProperties.java | 99 ++++++ 7 files changed, 626 insertions(+), 1 deletion(-) create mode 100644 src/com/github/igotyou/FactoryMod/Factorys/Compactor.java create mode 100644 src/com/github/igotyou/FactoryMod/managers/CompactorManager.java create mode 100644 src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java diff --git a/config.yml b/config.yml index 949f9db9..7e605b02 100644 --- a/config.yml +++ b/config.yml @@ -95,6 +95,32 @@ repair_factory: AAA_DIAMOND: material: 'DIAMOND_BLOCK' amount: 1 +compactor: + fuel: + Charcoal: + material: 'COAL' + amount: 1 + durability: 1 + fuel_time: 5 + repair_multiple: 1 + name: 'Compactor' + production_time: 20 + costs: + construction: + DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 64 + repair: + EMERALD: + material: 'EMERALD_BLOCK' + amount: 16 + recipe: + CRATE: + material: 'CHEST' + amount: 1 + display_name: Crate + lore: A crate for compacting items + compact_lore: Compacted Item copy_defaults: false general: central_block: WORKBENCH diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 3d32eed1..369492f4 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -28,6 +28,7 @@ import com.github.igotyou.FactoryMod.listeners.NoteStackListener; import com.github.igotyou.FactoryMod.listeners.RedstoneListener; import com.github.igotyou.FactoryMod.managers.FactoryModManager; +import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; @@ -47,6 +48,7 @@ public class FactoryModPlugin extends JavaPlugin public PrintingPressProperties printingPressProperties; public NetherFactoryProperties netherFactoryProperties; public RepairFactoryProperties repairFactoryProperties; + public CompactorProperties compactorProperties; public static final String VERSION = "v1.0"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin @@ -57,6 +59,7 @@ public class FactoryModPlugin extends JavaPlugin public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; public static final String REPAIR_FACTORY_SAVE_FILE = "repairSaves"; + public static final String COMPACTOR_SAVE_FILE = "compactorSaves"; public static boolean DISABLE_PORTALS; public static int NETHER_SCALE; public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; @@ -315,9 +318,11 @@ public void initConfig() ConfigurationSection configPrintingPresses=config.getConfigurationSection("printing_presses"); ConfigurationSection configNetherFactory=config.getConfigurationSection("nether_factory"); ConfigurationSection configRepairFactory=config.getConfigurationSection("repair_factory"); + ConfigurationSection configCompactor=config.getConfigurationSection("compactor"); printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); repairFactoryProperties = RepairFactoryProperties.fromConfig(this, configRepairFactory); + compactorProperties = CompactorProperties.fromConfig(this, configCompactor); sendConsoleMessage("Finished initializing FactoryMod Config."); } @@ -485,6 +490,10 @@ public RepairFactoryProperties getRepairFactoryProperties() { return repairFactoryProperties; } + public CompactorProperties getCompactorProperties() { + return compactorProperties; + } + private static FactoryModPlugin plugin; public static FactoryModPlugin getPlugin(){ return plugin; diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java index 2e1c6bde..71939ad7 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ b/src/com/github/igotyou/FactoryMod/FactoryObject.java @@ -34,7 +34,8 @@ public enum FactoryType PRODUCTION, PRINTING_PRESS, REPAIR_FACTORY, - NETHER_FACTORY + NETHER_FACTORY, + COMPACTOR } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java new file mode 100644 index 00000000..dda83433 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -0,0 +1,303 @@ +package com.github.igotyou.FactoryMod.Factorys; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + +import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; +import com.github.igotyou.FactoryMod.managers.CompactorManager; +import com.github.igotyou.FactoryMod.properties.CompactorProperties; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; + +public class Compactor extends BaseFactory { + + private ReinforcementManager rm = Citadel.getReinforcementManager(); + private CompactorProperties cp; + private CompactorMode mode; + + public Compactor(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, CompactorProperties compactorProperties, CompactorManager compactorManager) { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, FactoryType.COMPACTOR, "Compactor"); + cp = compactorProperties; + mode = CompactorMode.REPAIR; + } + + public Compactor(Location factoryLocation, + Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, CompactorProperties compactorProperties, CompactorManager compactorManager, + CompactorMode mode, double currentRepair, long timeDisrepair) { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.COMPACTOR, active, + "Compactor", 0, 0, currentRepair, timeDisrepair); + cp = compactorProperties; + this.mode = mode; + } + + public boolean isRepairing() { + return mode == CompactorMode.REPAIR; + } + + public ItemList getFuel() { + return cp.getFuel(); + } + + public double getEnergyTime() { + return cp.getEnergyTime(); + } + + public double getProductionTime() { + return cp.getProductionTime(); + } + + public ItemList getInputs() { + ItemList inputs = new ItemList(); + Inventory inv = getInventory(); + if(mode == CompactorMode.DECOMPACT) { + for(ItemStack is : inv.getContents()) { + if(is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + inputs.add(new NamedItemStack(is.getType(), is.getMaxStackSize(), is.getDurability(), is.getItemMeta().getDisplayName())); + return inputs; + } + } + inputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Compacted Item")); + } else if (mode == CompactorMode.COMPACT) { + for(ItemStack is : inv.getContents()) { + if(is.getAmount() == is.getMaxStackSize()) { + if(!is.getItemMeta().hasLore()) { + inputs.add(new NamedItemStack(is.getType(), is.getAmount(), is.getDurability(), is.getItemMeta().getDisplayName())); + inputs.addAll(cp.getRecipeMaterials()); + return inputs; + } + } + } + return cp.getRecipeMaterials(); + } + return inputs; + } + + public ItemList getOutputs() { + ItemList outputs = new ItemList(); + Inventory inv = getInventory(); + if(mode == CompactorMode.DECOMPACT) { + for(ItemStack is : inv.getContents()) { + if(is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + outputs.add(new NamedItemStack(is.getType(), is.getMaxStackSize(), is.getDurability(), is.getItemMeta().getDisplayName())); + return outputs; + } + } + outputs.add(new NamedItemStack(Material.AIR, 64, (short)1, "Decompacted Items")); + } else if (mode == CompactorMode.COMPACT) { + for(ItemStack is : inv.getContents()) { + if(is.getAmount() == is.getMaxStackSize()) { + NamedItemStack compactedItemStack = new NamedItemStack(is.getType(), 1, is.getDurability(), is.getItemMeta().getDisplayName()); + compactedItemStack.getItemMeta().getLore().add(cp.getCompactLore()); + outputs.add(compactedItemStack); + return outputs; + } + } + outputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Compacted Item")); + } + return outputs; + } + + public ItemList getRepairs() { + return cp.getRepairMaterials(); + } + + public void update() { + if(mode == CompactorMode.REPAIR) { + if(active) { + if(checkHasMaterials()) { + if(currentProductionTimer < getProductionTime()) { + if(isFuelAvailable()) { + if(currentEnergyTimer == getEnergyTime() - 1) { + getFuel().removeFrom(getPowerSourceInventory()); + currentEnergyTimer = 0; + fuelConsumed(); + } else { + currentEnergyTimer++; + } + currentProductionTimer++; + postUpdate(); + } else { + powerOff(); + } + } else if(currentProductionTimer >= getProductionTime()) { + repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); + currentProductionTimer = 0; + powerOff(); + } + } else { + powerOff(); + } + } + } else if(mode == CompactorMode.COMPACT) { + if(active) { + if(checkHasMaterials()) { + if(currentProductionTimer < getProductionTime()) { + if(isFuelAvailable()) { + if(currentEnergyTimer == getEnergyTime() - 1) { + getFuel().removeFrom(getPowerSourceInventory()); + currentEnergyTimer = 0; + fuelConsumed(); + } else { + currentEnergyTimer++; + } + currentProductionTimer++; + postUpdate(); + } else { + powerOff(); + } + } else if(currentProductionTimer >= getProductionTime()) { + consumeInputs(); + + recipeFinished(); + + currentProductionTimer = 0; + powerOff(); + } + } else { + powerOff(); + } + } + } else if(mode == CompactorMode.DECOMPACT) { + if(active) { + if(checkHasMaterials()) { + if(currentProductionTimer < getProductionTime()) { + if(isFuelAvailable()) { + if(currentEnergyTimer == getEnergyTime() - 1) { + getFuel().removeFrom(getPowerSourceInventory()); + currentEnergyTimer = 0; + fuelConsumed(); + } else { + currentEnergyTimer++; + } + currentProductionTimer++; + postUpdate(); + } else { + powerOff(); + } + } else if(currentProductionTimer >= getProductionTime()) { + consumeInputs(); + + recipeFinished(); + + currentProductionTimer = 0; + powerOff(); + } + } else { + powerOff(); + } + } + } + } + + protected void recipeFinished() { + getInputs().removeOneFrom(getInventory()); + getOutputs().putIn(getInventory()); + } + + public int getMaxRepair() { + return cp.getRepair(); + } + + public List getCentralBlockResponse() { + List responses=new ArrayList(); + if (!active) { + CompactorMode mode = this.mode.getNext(); + this.mode = mode; + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to " + this.mode.getDescription() + ".")); + } else { + responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); + } + return responses; + } + + public List getChestResponse(){ + List responses=new ArrayList(); + String status=active ? "On" : "Off"; + double time = 0; + int maxRepair = getMaxRepair(); + boolean maintenanceActive = maxRepair!=0; + String response = "Current costs are : "; // the response specific to the mode. + if (mode.getId() == 0){ + time = getEnergyTime(); + response += getRepairs().toString(); + } + else if (mode.getId() == 1){ + time = getProductionTime(); + response += getInputs().toString(); + } + String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/time)+"% done." : ""; + int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, cp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); + + if(!getRepairs().isEmpty()&&maintenanceActive&& mode == CompactorMode.REPAIR) + { + int amountAvailable=getRepairs().amountAvailable(getInventory()); + int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; + int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); + } + + return responses; + } + + public enum CompactorMode { + REPAIR(0, "Repair Factory"), + COMPACT(1, "Compact Items"), + DECOMPACT(2, "De-Compact Items"); + + private static final int MAX_ID = 3; + private int id; + private String description; + + private CompactorMode(int id, String description) { + this.id = id; + this.description = description; + } + + public static CompactorMode byId(int id) { + for(CompactorMode mode : CompactorMode.values()) { + if(mode.getId() == id) { + return mode; + } + } + return null; + } + + public int getId() { + return id; + } + + public String getDescription() { + return description; + } + + public CompactorMode getNext() { + int nextId = (getId() + 1) % MAX_ID; + return byId(nextId); + } + } + + public CompactorMode getMode() { + return mode; + } + + public CompactorProperties getProperties() { + return cp; + } +} diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java new file mode 100644 index 00000000..f118fe5b --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -0,0 +1,177 @@ +package com.github.igotyou.FactoryMod.managers; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.Factorys.Compactor.CompactorMode; +import com.github.igotyou.FactoryMod.interfaces.Factory; +import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; + +public class CompactorManager implements Manager { + + private FactoryModPlugin plugin; + private ReinforcementManager rm = Citadel.getReinforcementManager(); + private List compactors; + private boolean isLogging = true; + private long repairTime; + + public CompactorManager(FactoryModPlugin plugin) { + this.plugin = plugin; + compactors = new ArrayList(); + updateFactorys(); + } + + @Override + public void save(File file) throws IOException { + repairTime = System.currentTimeMillis(); + FileOutputStream fos = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fos); + int version = 1; + oos.writeInt(version); + oos.writeInt(compactors.size()); + for(Compactor factory : compactors) { + Location centerLocation = factory.getCenterLocation(); + Location inventoryLocation = factory.getInventoryLocation(); + Location powerLocation = factory.getPowerSourceLocation(); + + oos.writeUTF(centerLocation.getWorld().getName()); + + oos.writeInt(centerLocation.getBlockX()); + oos.writeInt(centerLocation.getBlockY()); + oos.writeInt(centerLocation.getBlockZ()); + + oos.writeInt(inventoryLocation.getBlockX()); + oos.writeInt(inventoryLocation.getBlockY()); + oos.writeInt(inventoryLocation.getBlockZ()); + + oos.writeInt(powerLocation.getBlockX()); + oos.writeInt(powerLocation.getBlockY()); + oos.writeInt(powerLocation.getBlockZ()); + + oos.writeInt(factory.getMode().getId()); + oos.writeDouble(factory.getCurrentRepair()); + oos.writeLong(factory.getTimeDisrepair()); + } + oos.flush(); + fos.close(); + } + + @Override + public void load(File file) throws IOException { + isLogging = false; + repairTime = System.currentTimeMillis(); + FileInputStream fis = new FileInputStream(file); + ObjectInputStream ois = new ObjectInputStream(fis); + int version = ois.readInt(); + int count = ois.readInt(); + for(int i = 0; i < count; i++) { + String worldName = ois.readUTF(); + World world = Bukkit.getWorld(worldName); + + Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + + CompactorMode mode = CompactorMode.byId(ois.readInt()); + double currentRepair = ois.readDouble(); + long timeDisrepair = ois.readLong(); + + Compactor factory = new Compactor(centerLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties(), + this, mode, currentRepair, timeDisrepair); + addFactory(factory); + } + fis.close(); + } + + @Override + public void updateFactorys() { + + } + + @Override + public InteractionResponse createFactory(Location factoryLocation, + Location inventoryLocation, Location powerLocation) { + return null; + } + + @Override + public InteractionResponse addFactory(Factory factory) { + Compactor compactor = (Compactor) factory; + if(compactor.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && + (!factoryExistsAt(compactor.getCenterLocation()) + || !factoryExistsAt(compactor.getInventoryLocation()) + || !factoryExistsAt(compactor.getPowerSourceLocation()))) { + compactors.add(compactor); + if(isLogging) { + FactoryModPlugin.sendConsoleMessage("Compactor created: " + compactor.getProperties().getName()); + } + return new InteractionResponse(InteractionResult.SUCCESS, ""); + } else { + FactoryModPlugin.sendConsoleMessage("Compactor failed to create: " + compactor.getProperties().getName()); + return new InteractionResponse(InteractionResult.FAILURE, ""); + } + } + + @Override + public Factory getFactory(Location factoryLocation) { + for(Compactor factory : compactors) { + if(factory.getCenterLocation().equals(factoryLocation) + || factory.getInventoryLocation().equals(factoryLocation) + || factory.getPowerSourceLocation().equals(factoryLocation)) { + return factory; + } + } + return null; + } + + @Override + public boolean factoryExistsAt(Location factoryLocation) { + return false; + } + + @Override + public boolean factoryWholeAt(Location factoryLocation) { + return (getFactory(factoryLocation) != null); + } + + @Override + public void removeFactory(Factory factory) { + if(!(factory instanceof Compactor)) { + FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); + return; + } + + Compactor compactor = (Compactor) factory; + + FactoryModPlugin.sendConsoleMessage(new StringBuilder("Compactor removed: ") + .append(compactor.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(compactor.getCenterLocation())) + .toString()); + + compactors.remove(compactor); + } + + @Override + public String getSavesFileName() { + return FactoryModPlugin.COMPACTOR_SAVE_FILE; + } +} diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 99f8925f..0fa055b2 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -69,6 +69,7 @@ private void initializeManagers() initializePrintingPressManager(); initializeRepairFactoryManager(); initializeNetherFactoryManager(); + initializeCompactorManager(); //} } @@ -111,6 +112,15 @@ private void initializeRepairFactoryManager(){ managers.add(repairMan); } + /** + * Initializes the Compactor manager + */ + private void initializeCompactorManager() { + CompactorManager compactMan = new CompactorManager(plugin); + + managers.add(compactMan); + } + /** * When plugin disabled, this is called. */ diff --git a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java new file mode 100644 index 00000000..44c8d556 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java @@ -0,0 +1,99 @@ +package com.github.igotyou.FactoryMod.properties; + +import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +public class CompactorProperties { + + private ItemList constructionMaterials; + private ItemList fuel; + private ItemList repairMaterials; + private ItemList recipeMaterials; + private int energyTime; + private int repair; + private String name; + private double repairTime; + private double productionTime; + private String compactLore; + + public CompactorProperties(ItemList constructionMaterials, + ItemList fuel, + ItemList repairMaterials, + ItemList recipeMaterials, int energyTime, + int repair, String name, double repairTime, double productionTime, String compactLore) { + this.constructionMaterials = constructionMaterials; + this.fuel = fuel; + this.repairMaterials = repairMaterials; + this.recipeMaterials = recipeMaterials; + this.energyTime = energyTime; + this.repair = repair; + this.name = name; + this.repairTime = repairTime; + this.productionTime = productionTime; + this.compactLore = compactLore; + } + + public ItemList getConstructionMaterials() { + return constructionMaterials; + } + + public ItemList getFuel() { + return fuel; + } + + public ItemList getRepairMaterials() { + return repairMaterials; + } + + public ItemList getRecipeMaterials() { + return recipeMaterials; + } + + public int getEnergyTime() { + return energyTime; + } + + public int getRepair() { + return repair; + } + + public String getName() { + return name; + } + + public double getRepairTime() { + return repairTime; + } + + public double getProductionTime() { + return productionTime; + } + + public String getCompactLore() { + return compactLore; + } + + public static CompactorProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection config) { + ItemList cFuel = plugin.getItems(config.getConfigurationSection("fuel")); + if(cFuel.isEmpty()) { + cFuel = new ItemList(); + cFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short)1, "Charcoal")); + } + ConfigurationSection costs = config.getConfigurationSection("costs"); + ItemList constructionCost = plugin.getItems(costs.getConfigurationSection("construction")); + ItemList repairCost = plugin.getItems(costs.getConfigurationSection("repair")); + ItemList recipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + int energyTime = config.getInt("fuel_time"); + int repair = costs.getInt("repair_multiple", 1); + String name = config.getString("name", "Compactor"); + int repairTime = config.getInt("repair_time", 12); + int productionTime = config.getInt("production_time"); + String compactLore = config.getString("compact_lore", "Compacted Item"); + return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore); + } + +} From f749442d93d10b794d92649c7dc65965433b74b0 Mon Sep 17 00:00:00 2001 From: Akiyama64 Date: Mon, 25 May 2015 08:34:24 -1000 Subject: [PATCH 064/459] Add Iron Trapdoors to Forge Very similar to the iron door recipe, but makes twice as many trapdoors because it's half the size of a normal door. --- config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 949f9db9..8a718dbc 100644 --- a/config.yml +++ b/config.yml @@ -2091,6 +2091,7 @@ production_factories: - Forge_Iron_Bars - Forge_Buckets - Forge_Iron_Doors + - Forge_Iron_Trapdoors - Forge_Flint_And_Steel - Bastion_Gearbox repair_multiple: 10 @@ -6211,6 +6212,17 @@ production_recipes: Iron Door: material: IRON_DOOR amount: 18 + Forge_Iron_Trapdoors: + name: Forge Iron Trapdoors + production_time: 16 + inputs: + Iron Ingot: + material: IRON_INGOT + amount: 54 + outputs: + Iron Trapdoor: + material: IRON_TRAPDOOR + amount: 36 Forge_Flint_And_Steel: name: Forge Flint and Steel production_time: 8 @@ -7650,4 +7662,4 @@ production_recipes: outputs: Eye of Ender: material: EYE_OF_ENDER - amount: 256 \ No newline at end of file + amount: 256 From 214a04234039d76512fcbc6596e948547f81c1cb Mon Sep 17 00:00:00 2001 From: rourke750 Date: Tue, 26 May 2015 14:48:09 -0400 Subject: [PATCH 065/459] Fix for mossy cobblestone --- config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 949f9db9..4eb6f776 100644 --- a/config.yml +++ b/config.yml @@ -196,12 +196,14 @@ crafting: CHISSELED_STONE_BRICK: material: SMOOTH_BRICK durability: 3 - MOSSY_COBBLE: + MOSSY_STONE: material: SMOOTH_BRICK durability: 1 CRACKED_STONE_BRICK: material: SMOOTH_BRICK durability: 2 + MOSSY_COBBLE: + material: MOSSY_COBBLESTONE enable: XP to Emerald: inputs: @@ -7650,4 +7652,4 @@ production_recipes: outputs: Eye of Ender: material: EYE_OF_ENDER - amount: 256 \ No newline at end of file + amount: 256 From 740d90f7c90c40bf7aaad1d1bda29a1b3f30e6e7 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 29 May 2015 19:50:56 +0200 Subject: [PATCH 066/459] Added prismarine blocks and sea lanterns --- config.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/config.yml b/config.yml index 720dcc47..d445a967 100644 --- a/config.yml +++ b/config.yml @@ -1895,7 +1895,11 @@ production_factories: amount: 256 durability: 4 recipes: + - Smelt Prismarine + - Smelt Prismarine Bricks + - Smelt Dark Prismarine - Smelt_Cracked_Stone_Brick + - Craft Sea Lanterns - Smelt_Mossy_Stone_Brick - Smelt_Chiseled_Stone_Brick - Bastion_Flooring @@ -7595,3 +7599,57 @@ production_recipes: Eye of Ender: material: EYE_OF_ENDER amount: 256 + Smelt Prismarine: + name: Smelt Prismarine + production_time: 16 + inputs: + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 128 + outputs: + Prismarine + material: PRISMARINE + amount: 64 + durability: 0 + Smelt Prismarine Bricks: + name: Smelt Prismarine Bricks + production_time: 16 + inputs: + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 288 + outputs: + Prismarine + material: PRISMARINE + amount: 64 + durability: 1 + Smelt Dark Prismarine: + name: Smelt Dark Prismarine + production_time: 16 + inputs: + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 256 + Ink Sack: + material: INK_SACK + amount: 32 + durability: 0 + outputs: + Prismarine + material: PRISMARINE + amount: 64 + durability: 2 + Craft Sea Lanterns: + name: Craft Sea Lanterns + production_time: 8 + inputs: + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 32 + Prismarine Crystals: + material: PRISMARINE_CRYSTALS + amount: 64 + outputs: + Prismarine + material: SEA_LANTERN + amount: 16 \ No newline at end of file From 8b18bb5c27431c2d86baa8d201d9dcef5a1251f5 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 30 Mar 2015 01:28:32 -0400 Subject: [PATCH 067/459] Detailed feedback on current press functioning while activated --- .../FactoryMod/Factorys/PrintingPress.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index ebc8dcd6..b9684579 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -460,6 +460,8 @@ public List getCentralBlockResponse() * On interaction with the factory chest, return context-appropriate information * concerning the current mode, relative to the inputs and outputs. * + * Adding detailed state on the active recipe now, if factory is on. + * * @return A {@link List} of {@link InteractionResponse} objects containing * details on the current mode. */ @@ -502,6 +504,49 @@ public List getChestResponse() String.valueOf(percentRepaired) + "% of the factory with " + getRepairs.getMultiple(amountRepaired).toString() + ".")); } + + + //[% done if plates; queue status else] + if (active && mode != REPAIR) { + int readyCopies = 0; + StringBuffer queueContents; + if (mode == PRINT_BOOKS || mode == PRINT_PAMPHLETS || mode == PRINT_SECURITY) { + queueContents = new StringBuffer(); + queueContents.append("Queue Contents: "); + for (int i = 0; i < processQueue.length; i++) { + readyCopies += processQueue[i]; + queueContents.append("["); + queueContents.append(processQueue[i]); + queueContents.append("]"); + } + } + switch(mode) { + case PRINT_BOOKS: + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Books with " + + String.valueOf(readyCopies) + " in the queue.")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); + break; + case PRINT_PAMPHLETS: + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Pamphlets with " + + String.valueOf(readyCopies) + " in the queue.")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); + break; + case PRINT_SECURITY: + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Security Notes with " + + String.valueOf(readyCopies) + " in the queue.")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); + break; + case SET_PLATES: + int setTime = printingPressProperties.getSetPlateTime() * getBookInventoryPages(); + int percentComplete = (int) (( (double) currentProductionTimer) / setTime * 100); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Set Plates is " + + String.valueOf(percentComplete) + "% complete")); + break; + default: + log.debug("getChestResponse(): Active set, but unknown mode: critical error."); + break; + } + return responses; } @@ -517,6 +562,30 @@ private PrintResult getPrintResult() { return new PrintResult(); } + /** + * Lightweight page count function, for active recipes only. Useful for measuring current + * progress in a recipe, for instance. + */ + private int getBookInventoryPages() { + if (ItemStack stack : getInventory().getContents() { + if (stack == null) { + continue; + } + if (stack.getType().equals(Material.BOOK_AND_QUILL) || + stack.getType().equals(Material.WRITTEN_BOOK)) { + log.finer("getPlateResult(): Found a book in the factory."); + ItemMeta meta = stack.getItemMeta(); + if (meta instanceof BookMeta) { + BookMeta bookData = (BookMeta) meta; + if (bookData.hasPages()) { + return Math.max(1, bookData.getPageCount()); + } + } + } + } + return 0; + } + /** * Generates a NamedItemStack containing a 'plate' -- a signed book with lore that * uniquely reflects the book given as input. This plate can then be used to produce From 3f2f695e4c928cfbd969b4365bb6270cabe87eb4 Mon Sep 17 00:00:00 2001 From: ProgrammerDan Date: Wed, 1 Apr 2015 20:09:19 -0500 Subject: [PATCH 068/459] Fixes to intelligent feedback. Testing next --- .../igotyou/FactoryMod/Factorys/PrintingPress.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index b9684579..fc2353fe 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -507,11 +507,12 @@ public List getChestResponse() //[% done if plates; queue status else] - if (active && mode != REPAIR) { + if (active && mode != OperationMode.REPAIR) { int readyCopies = 0; - StringBuffer queueContents; - if (mode == PRINT_BOOKS || mode == PRINT_PAMPHLETS || mode == PRINT_SECURITY) { - queueContents = new StringBuffer(); + StringBuffer queueContents = new StringBuffer(); + if (mode == OperationMode.PRINT_BOOKS || + mode == OperationMode.PRINT_PAMPHLETS || + mode == OperationMode.PRINT_SECURITY) { queueContents.append("Queue Contents: "); for (int i = 0; i < processQueue.length; i++) { readyCopies += processQueue[i]; @@ -543,8 +544,9 @@ public List getChestResponse() String.valueOf(percentComplete) + "% complete")); break; default: - log.debug("getChestResponse(): Active set, but unknown mode: critical error."); + log.severe("getChestResponse(): Active set, but unknown mode: critical error."); break; + } } return responses; @@ -567,7 +569,7 @@ private PrintResult getPrintResult() { * progress in a recipe, for instance. */ private int getBookInventoryPages() { - if (ItemStack stack : getInventory().getContents() { + for (ItemStack stack : getInventory().getContents()) { if (stack == null) { continue; } From a1cac0528468c4800485e1b96b52b1c004421127 Mon Sep 17 00:00:00 2001 From: ProgrammerDan Date: Sat, 30 May 2015 11:15:29 -0500 Subject: [PATCH 069/459] Better status when running queue-based recipe, shows total in queue, queue contents, and progress within the queue. --- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 +- .../igotyou/FactoryMod/Factorys/PrintingPress.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 3d32eed1..f1fa1c4a 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -48,7 +48,7 @@ public class FactoryModPlugin extends JavaPlugin public NetherFactoryProperties netherFactoryProperties; public RepairFactoryProperties repairFactoryProperties; - public static final String VERSION = "v1.0"; //Current version of plugin + public static final String VERSION = "v1.3.4"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; public static final String PRODUCTION_SAVES_FILE = "productionSaves"; // The production saves file name diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index fc2353fe..1946d145 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -513,13 +513,21 @@ public List getChestResponse() if (mode == OperationMode.PRINT_BOOKS || mode == OperationMode.PRINT_PAMPHLETS || mode == OperationMode.PRINT_SECURITY) { - queueContents.append("Queue Contents: "); + queueContents.append("Queue Contents: ["); for (int i = 0; i < processQueue.length; i++) { readyCopies += processQueue[i]; - queueContents.append("["); + if (i > 0) { + queueContents.append(","); + } + if (i == processQueueOffset) { + queueContents.append("{"); + } queueContents.append(processQueue[i]); - queueContents.append("]"); + if (i == processQueueOffset) { + queueContents.append("}"); + } } + queueContents.append("]"); } switch(mode) { case PRINT_BOOKS: From 94651b46e32df06054a2106cf4768133fc0620c2 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 30 May 2015 19:44:34 +0200 Subject: [PATCH 070/459] Added newline at end of file --- config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index d445a967..2712acc3 100644 --- a/config.yml +++ b/config.yml @@ -7652,4 +7652,5 @@ production_recipes: outputs: Prismarine material: SEA_LANTERN - amount: 16 \ No newline at end of file + amount: 16 + \ No newline at end of file From 2e52d3871e6c71d196217c1f13b73b189353f190 Mon Sep 17 00:00:00 2001 From: ProgrammerDan Date: Sat, 30 May 2015 12:50:14 -0500 Subject: [PATCH 071/459] Fixed internal version to match external --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index f1fa1c4a..b7d0382e 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -48,7 +48,7 @@ public class FactoryModPlugin extends JavaPlugin public NetherFactoryProperties netherFactoryProperties; public RepairFactoryProperties repairFactoryProperties; - public static final String VERSION = "v1.3.4"; //Current version of plugin + public static final String VERSION = "v1.3.5"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; public static final String PRODUCTION_SAVES_FILE = "productionSaves"; // The production saves file name From c21c8d4a61a8468859e9b5b4da092e32de933e3f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 30 May 2015 19:51:41 +0200 Subject: [PATCH 072/459] Try no.2 to add a newline at end of file --- config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config.yml b/config.yml index 2712acc3..78abe7dd 100644 --- a/config.yml +++ b/config.yml @@ -7653,4 +7653,3 @@ production_recipes: Prismarine material: SEA_LANTERN amount: 16 - \ No newline at end of file From e4988790e9b891aed7e7b01a8d0710aad0a94127 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 30 May 2015 19:54:23 +0200 Subject: [PATCH 073/459] Fixed a few typos --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 78abe7dd..42b7ab9b 100644 --- a/config.yml +++ b/config.yml @@ -7607,7 +7607,7 @@ production_recipes: material: PRISMARINE_SHARD amount: 128 outputs: - Prismarine + Prismarine: material: PRISMARINE amount: 64 durability: 0 @@ -7619,7 +7619,7 @@ production_recipes: material: PRISMARINE_SHARD amount: 288 outputs: - Prismarine + Prismarine: material: PRISMARINE amount: 64 durability: 1 @@ -7635,7 +7635,7 @@ production_recipes: amount: 32 durability: 0 outputs: - Prismarine + Prismarine: material: PRISMARINE amount: 64 durability: 2 @@ -7650,6 +7650,6 @@ production_recipes: material: PRISMARINE_CRYSTALS amount: 64 outputs: - Prismarine + Sea Lantern: material: SEA_LANTERN amount: 16 From c0ed63432316fec1368698540634f38549694023 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sat, 30 May 2015 14:15:13 -0400 Subject: [PATCH 074/459] #11 refactoring file io code --- .../igotyou/FactoryMod/ConfigManager.java | 10 ++ .../FactoryMod/interfaces/Manager.java | 4 +- .../managers/NetherFactoryManager.java | 28 +++- .../managers/PrintingPressManager.java | 112 ++------------- .../managers/ProductionManager.java | 3 +- .../FactoryMod/persistence/FactoryCodec.java | 11 ++ .../persistence/PrintingPressCsvReader.java | 109 +++++++++++++++ .../persistence/PrintingPressCsvWriter.java | 63 +++++++++ .../persistence/ProductionCsvReader.java | 131 ++++++++++-------- 9 files changed, 301 insertions(+), 170 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/ConfigManager.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigManager.java b/src/com/github/igotyou/FactoryMod/ConfigManager.java new file mode 100644 index 00000000..31ac63d0 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/ConfigManager.java @@ -0,0 +1,10 @@ +package com.github.igotyou.FactoryMod; + +public class ConfigManager { + private static final String CONFIG_GENERAL = "config.yml"; + private static final String CONFIG_CRAFTING = "crafting.yml"; + private static final String CONFIG_PRODUCTON = "production.yml"; + private static final String CONFIG_PRINTING = "printing.yml"; + private static final String CONFIG_NETHER = "nether.yml"; + +} diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java index d1a12180..771c5473 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java +++ b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java @@ -35,12 +35,12 @@ public interface Manager /** * Saves the machine objects list of this manager to file */ - public void save(File file) throws IOException; + public void save(); /** * Loads machine objects list of this manager from file */ - public void load(File file) throws IOException; + public void load(); /** * Updates all the machines from this manager's machine object list diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index e6a108be..90bac6cd 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -26,12 +26,16 @@ import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.FileBackup; +import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.google.common.collect.Lists; //original file: /** @@ -54,26 +58,35 @@ public class NetherFactoryManager implements Manager private ReinforcementManager rm = Citadel.getReinforcementManager(); private FactoryModPlugin plugin; private List netherFactorys; + private FactoryDao mDao; + private File mSaveFile; private long repairTime; private boolean isLogging = true; + @SuppressWarnings("unchecked") public NetherFactoryManager(FactoryModPlugin plugin) { this.plugin = plugin; - netherFactorys = new ArrayList(); + mSaveFile = new File(plugin.getDataFolder(), "netherSaves.txt"); + netherFactorys = Lists.newArrayList(); //Set maintenance clock to 0 updateFactorys(); + //TODO: use type inference to avoid cast + mDao = (FactoryDao) PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } - public void save(File file) throws IOException + @Override + public void save() { //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis()-repairTime); - repairTime=System.currentTimeMillis(); + updateRepair(System.currentTimeMillis() - repairTime); + repairTime = System.currentTimeMillis(); - BackupManager.backup(file); + FileBackup.backup(mSaveFile); + mDao.writeFactories(netherFactorys); - FileOutputStream fileOutputStream = new FileOutputStream(file); + //TODO: migrate + FileOutputStream fileOutputStream = new FileOutputStream(mSaveFile); ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); int version = 1; oos.writeInt(version); @@ -119,7 +132,8 @@ public void save(File file) throws IOException fileOutputStream.close(); } - public void load(File file) throws IOException + @Override + public void load() { isLogging = false; try { diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 494939e4..d1902c53 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -18,9 +18,12 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; +import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.FileBackup; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; @@ -48,6 +51,8 @@ public class PrintingPressManager implements Manager { private FactoryModPlugin plugin; private List presses; + private FactoryDao mDao; + private File mSaveFile; private long repairTime; private boolean isLogging = true; @@ -59,112 +64,21 @@ public PrintingPressManager(FactoryModPlugin plugin) updateFactorys(); } - public void save(File file) throws IOException + public void save() { //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis()-repairTime); - repairTime=System.currentTimeMillis(); + updateRepair(System.currentTimeMillis() - repairTime); + repairTime = System.currentTimeMillis(); - BackupManager.backup(file); - - FileOutputStream fileOutputStream = new FileOutputStream(file); - ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); - int version = 1; - oos.writeInt(version); - oos.writeInt(presses.size()); - for (PrintingPress production : presses) - { - //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number - - Location centerlocation = production.getCenterLocation(); - Location inventoryLocation = production.getInventoryLocation(); - Location powerLocation = production.getPowerSourceLocation(); - - oos.writeUTF(centerlocation.getWorld().getName()); - - oos.writeInt(centerlocation.getBlockX()); - oos.writeInt(centerlocation.getBlockY()); - oos.writeInt(centerlocation.getBlockZ()); - - oos.writeInt(inventoryLocation.getBlockX()); - oos.writeInt(inventoryLocation.getBlockY()); - oos.writeInt(inventoryLocation.getBlockZ()); - - oos.writeInt(powerLocation.getBlockX()); - oos.writeInt(powerLocation.getBlockY()); - oos.writeInt(powerLocation.getBlockZ()); - - oos.writeBoolean(production.getActive()); - oos.writeInt(production.getMode().getId()); - oos.writeInt(production.getProductionTimer()); - oos.writeInt(production.getEnergyTimer()); - oos.writeDouble(production.getCurrentRepair()); - oos.writeLong(production.getTimeDisrepair()); - - oos.writeInt(production.getContainedPaper()); - oos.writeInt(production.getContainedBindings()); - oos.writeInt(production.getContainedSecurityMaterials()); - oos.writeInt(production.getLockedResultCode()); - - int[] processQueue = production.getProcessQueue(); - oos.writeInt(processQueue.length); - for (int entry : processQueue) { - oos.writeInt(entry); - } - } - oos.flush(); - fileOutputStream.close(); + FileBackup.backup(mSaveFile); + mDao.writeFactories(presses); } - public void load(File file) throws IOException + public void load() { isLogging = false; - try { - repairTime=System.currentTimeMillis(); - FileInputStream fileInputStream = new FileInputStream(file); - ObjectInputStream ois = new ObjectInputStream(fileInputStream); - int version = ois.readInt(); - assert(version == 1); - int count = ois.readInt(); - int i = 0; - for (i = 0; i < count; i++) - { - String worldName = ois.readUTF(); - World world = plugin.getServer().getWorld(worldName); - - Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - boolean active = ois.readBoolean(); - OperationMode mode = PrintingPress.OperationMode.byId(ois.readInt()); - int productionTimer = ois.readInt(); - int energyTimer = ois.readInt(); - double currentRepair = ois.readDouble(); - long timeDisrepair = ois.readLong(); - int containedPaper = ois.readInt(); - int containedBindings = ois.readInt(); - int containedSecurityMaterials = ois.readInt(); - int lockedResultCode = ois.readInt(); - - int queueLength = ois.readInt(); - int[] processQueue = new int[queueLength]; - int j; - for (j = 0; j < queueLength; j++) { - processQueue[j] = ois.readInt(); - } - - PrintingPress production = new PrintingPress(centerLocation, inventoryLocation, powerLocation, - active, productionTimer, - energyTimer, currentRepair, timeDisrepair, - mode, - plugin.getPrintingPressProperties(), - containedPaper, containedBindings, containedSecurityMaterials, - processQueue, lockedResultCode); - addFactory(production); - } - fileInputStream.close(); - } catch (IOException e) { - e.printStackTrace(); + for(PrintingPress press : mDao.readFactories()) { + addFactory(press); } isLogging = true; } diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index d025c656..8e57e5ac 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -17,6 +17,7 @@ import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.FileBackup; import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; @@ -69,7 +70,7 @@ public void save(File file) throws IOException updateRepair(System.currentTimeMillis() - repairTime); repairTime = System.currentTimeMillis(); - BackupManager.backup(mSaveFile); + FileBackup.backup(mSaveFile); mDao.writeFactories(producers); } diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java new file mode 100644 index 00000000..a5c5b987 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java @@ -0,0 +1,11 @@ +package com.github.igotyou.FactoryMod.persistence; + +import com.github.igotyou.FactoryMod.interfaces.Factory; + +public interface FactoryCodec { + + public void write(T out); + + public T read(); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java new file mode 100644 index 00000000..6c751c37 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java @@ -0,0 +1,109 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.nio.charset.Charset; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.World; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; +import com.google.common.collect.Lists; +import com.google.common.io.Files; + +public class PrintingPressCsvReader implements FactoryReader { + + /** + * The plugin instance + */ + FactoryModPlugin mPlugin; + + /** + * The CSV file being read + */ + File mFile; + + public PrintingPressCsvReader(FactoryModPlugin plugin, File file) { + mPlugin = plugin; + mFile = file; + } + + private enum LineTokens { + + MAX + } + + @Override + public List read() { + List presses = Lists.newArrayList(); + + if(!mFile.exists() || mFile.isDirectory()) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") + .append(mFile.getName()).append(" is not a valid file!").toString()); + return presses; + } + + BufferedReader reader; + + try { + reader = Files.newReader(mFile, Charset.defaultCharset()); + } catch (FileNotFoundException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); + return presses; + } + + int lineNum = 0; + + try { + for (String line; (line = reader.readLine()) != null; ++lineNum) + { + String worldName = ois.readUTF(); + World world = plugin.getServer().getWorld(worldName); + + Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + boolean active = ois.readBoolean(); + OperationMode mode = PrintingPress.OperationMode.byId(ois.readInt()); + int productionTimer = ois.readInt(); + int energyTimer = ois.readInt(); + double currentRepair = ois.readDouble(); + long timeDisrepair = ois.readLong(); + int containedPaper = ois.readInt(); + int containedBindings = ois.readInt(); + int containedSecurityMaterials = ois.readInt(); + int lockedResultCode = ois.readInt(); + + int queueLength = ois.readInt(); + int[] processQueue = new int[queueLength]; + int j; + for (j = 0; j < queueLength; j++) { + processQueue[j] = ois.readInt(); + } + + PrintingPress production = new PrintingPress(centerLocation, inventoryLocation, powerLocation, + active, productionTimer, + energyTimer, currentRepair, timeDisrepair, + mode, + plugin.getPrintingPressProperties(), + containedPaper, containedBindings, containedSecurityMaterials, + processQueue, lockedResultCode); + addFactory(production); + } + fileInputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return presses; + } + + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java new file mode 100644 index 00000000..035c7a95 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java @@ -0,0 +1,63 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.FileOutputStream; +import java.io.ObjectOutputStream; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; + +public class PrintingPressCsvWriter { + + + public void save() { + + FileOutputStream fileOutputStream = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); + int version = 1; + oos.writeInt(version); + oos.writeInt(presses.size()); + for (PrintingPress production : presses) + { + //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number + + Location centerlocation = production.getCenterLocation(); + Location inventoryLocation = production.getInventoryLocation(); + Location powerLocation = production.getPowerSourceLocation(); + + oos.writeUTF(centerlocation.getWorld().getName()); + + oos.writeInt(centerlocation.getBlockX()); + oos.writeInt(centerlocation.getBlockY()); + oos.writeInt(centerlocation.getBlockZ()); + + oos.writeInt(inventoryLocation.getBlockX()); + oos.writeInt(inventoryLocation.getBlockY()); + oos.writeInt(inventoryLocation.getBlockZ()); + + oos.writeInt(powerLocation.getBlockX()); + oos.writeInt(powerLocation.getBlockY()); + oos.writeInt(powerLocation.getBlockZ()); + + oos.writeBoolean(production.getActive()); + oos.writeInt(production.getMode().getId()); + oos.writeInt(production.getProductionTimer()); + oos.writeInt(production.getEnergyTimer()); + oos.writeDouble(production.getCurrentRepair()); + oos.writeLong(production.getTimeDisrepair()); + + oos.writeInt(production.getContainedPaper()); + oos.writeInt(production.getContainedBindings()); + oos.writeInt(production.getContainedSecurityMaterials()); + oos.writeInt(production.getLockedResultCode()); + + int[] processQueue = production.getProcessQueue(); + oos.writeInt(processQueue.length); + for (int entry : processQueue) { + oos.writeInt(entry); + } + } + oos.flush(); + fileOutputStream.close(); + } +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java index c34f6538..a1c602e6 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java @@ -79,71 +79,17 @@ public synchronized List read() { .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); return factories; } - String line; + int lineNum = 0; try { - for (; (line = reader.readLine()) != null; ++lineNum) + for (String line; (line = reader.readLine()) != null; ++lineNum) { - String[] tokens = line.split(" "); - - if(tokens.length != LineTokens.MAX.ordinal()) { - logFactoryError(lineNum, "Unexpected number of tokens: " + tokens.length); - break; - } - try { - String subFactoryType = tokens[LineTokens.SUBTYPE.ordinal()]; - String recipeNames[] = tokens[LineTokens.RECIPE_LIST.ordinal()].split(","); - - World world = mPlugin.getServer().getWorld(tokens[LineTokens.WORLD.ordinal()]); - Location centerLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.CENTER_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.CENTER_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.CENTER_Z.ordinal()])); - Location inventoryLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.INV_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.INV_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.INV_Z.ordinal()])); - Location powerLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.POWER_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.POWER_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.POWER_Z.ordinal()])); - - boolean active = Boolean.parseBoolean(tokens[LineTokens.IS_ACTIVE.ordinal()]); - int productionTimer = Integer.parseInt(tokens[LineTokens.PROD_TIMER.ordinal()]); - int energyTimer = Integer.parseInt(tokens[LineTokens.ENERGY_TIMER.ordinal()]); - int currentRecipeNumber = Integer.parseInt(tokens[LineTokens.RECIPE_NUMBER.ordinal()]); - double currentRepair = Double.parseDouble(tokens[LineTokens.REPAIR.ordinal()]); - long timeDisrepair = Long.parseLong(tokens[LineTokens.DISREPAIR_TIME.ordinal()]); - - if(FactoryModPlugin.productionProperties.containsKey(subFactoryType)) - { - Set recipes = Sets.newHashSet(); - - // TODO: Give default recipes for subfactory type - ProductionProperties properties = FactoryModPlugin.productionProperties.get(subFactoryType); - recipes.addAll(properties.getRecipes()); - - for(String name : recipeNames) - { - if(FactoryModPlugin.productionRecipes.containsKey(name)) - { - recipes.add(FactoryModPlugin.productionRecipes.get(name)); - } - } - - factories.add(new ProductionFactory( - centerLocation, inventoryLocation, powerLocation, - subFactoryType, active, productionTimer, energyTimer, - new ArrayList(recipes), - currentRecipeNumber, currentRepair, timeDisrepair)); - } else { - logFactoryError(lineNum, "Unexpected factory type: " + subFactoryType); - break; - } - } catch (NumberFormatException e) { - logFactoryError(lineNum, "Expected token was not an integer"); + factories.add(read(line)); + } catch(Exception e) { + logFactoryError(lineNum, "Factory parse error: " + e.getMessage()); + break; } } } catch (IOException e) { @@ -156,10 +102,73 @@ public synchronized List read() { FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not close stream reading from ") .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); } - + //TODO: ensure everything is closed return factories; } + //TODO: split into common csv file handler and factory type parser + public ProductionFactory read(String decode) throws Exception { + String[] tokens = decode.split(" "); + + if(tokens.length != LineTokens.MAX.ordinal()) { + throw new Exception("Unexpected number of tokens: " + tokens.length); + } + + try { + String subFactoryType = tokens[LineTokens.SUBTYPE.ordinal()]; + String recipeNames[] = tokens[LineTokens.RECIPE_LIST.ordinal()].split(","); + + World world = mPlugin.getServer().getWorld(tokens[LineTokens.WORLD.ordinal()]); + Location centerLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.CENTER_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.CENTER_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.CENTER_Z.ordinal()])); + Location inventoryLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.INV_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.INV_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.INV_Z.ordinal()])); + Location powerLocation = new Location(world, + Integer.parseInt(tokens[LineTokens.POWER_X.ordinal()]), + Integer.parseInt(tokens[LineTokens.POWER_Y.ordinal()]), + Integer.parseInt(tokens[LineTokens.POWER_Z.ordinal()])); + + boolean active = Boolean.parseBoolean(tokens[LineTokens.IS_ACTIVE.ordinal()]); + int productionTimer = Integer.parseInt(tokens[LineTokens.PROD_TIMER.ordinal()]); + int energyTimer = Integer.parseInt(tokens[LineTokens.ENERGY_TIMER.ordinal()]); + int currentRecipeNumber = Integer.parseInt(tokens[LineTokens.RECIPE_NUMBER.ordinal()]); + double currentRepair = Double.parseDouble(tokens[LineTokens.REPAIR.ordinal()]); + long timeDisrepair = Long.parseLong(tokens[LineTokens.DISREPAIR_TIME.ordinal()]); + + if(FactoryModPlugin.productionProperties.containsKey(subFactoryType)) + { + Set recipes = Sets.newHashSet(); + + // TODO: Give default recipes for subfactory type + ProductionProperties properties = FactoryModPlugin.productionProperties.get(subFactoryType); + recipes.addAll(properties.getRecipes()); + + for(String name : recipeNames) + { + if(FactoryModPlugin.productionRecipes.containsKey(name)) + { + recipes.add(FactoryModPlugin.productionRecipes.get(name)); + } + } + + return new ProductionFactory( + centerLocation, inventoryLocation, powerLocation, + subFactoryType, active, productionTimer, energyTimer, + new ArrayList(recipes), + currentRecipeNumber, currentRepair, timeDisrepair); + } else { + throw new Exception("Unexpected factory type: " + subFactoryType); + } + } catch (NumberFormatException e) { + throw new Exception("Expected token was not an integer"); + } + + } + private void logFactoryError(int lineNum, String error) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Parse error at line ") .append(lineNum).append(" of ").append(mFile.getName()).append(": ").append(error).toString()); From a8af342fdf5e94be5f4160f2aff740098ccf8109 Mon Sep 17 00:00:00 2001 From: rourke750 Date: Sun, 31 May 2015 12:56:55 -0400 Subject: [PATCH 075/459] Create CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..1e48be34 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +sign the Contributor License Agreement From 11ae41d45d25cc8f6a61d34e1b9f51c4308814e1 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sun, 31 May 2015 17:36:41 -0400 Subject: [PATCH 076/459] #11 more better refactor --- .../igotyou/FactoryMod/FactoryModPlugin.java | 9 +- .../FactoryMod/interfaces/Manager.java | 14 +- .../managers/FactoryModManager.java | 94 +++------- .../managers/NetherFactoryManager.java | 163 ++++-------------- .../managers/PrintingPressManager.java | 52 +++--- .../managers/ProductionManager.java | 53 +++--- .../persistence/NetherCsvReader.java | 115 ++++++++++++ .../persistence/NetherCsvWriter.java | 113 ++++++++++++ .../persistence/PersistenceFactory.java | 11 +- .../persistence/PrintingPressCsvReader.java | 112 ++++++------ .../persistence/PrintingPressCsvWriter.java | 149 +++++++++++----- .../persistence/ProductionCsvReader.java | 11 +- 12 files changed, 529 insertions(+), 367 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 31c8f82c..779c4616 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -21,11 +21,13 @@ import org.bukkit.potion.PotionEffectType; import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.interfaces.Properties; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.listeners.NoteStackListener; import com.github.igotyou.FactoryMod.listeners.RedstoneListener; import com.github.igotyou.FactoryMod.managers.FactoryModManager; +import com.github.igotyou.FactoryMod.managers.ProductionManager; import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; @@ -184,7 +186,7 @@ public void registerEvents() try { getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); - getServer().getPluginManager().registerEvents(new RedstoneListener(manager, manager.getProductionManager()), this); + getServer().getPluginManager().registerEvents(new RedstoneListener(manager, (ProductionManager) manager.getManager(ProductionFactory.class)), this); getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); } catch(Exception e) @@ -525,6 +527,11 @@ public static void sendConsoleMessage(String message) Bukkit.getLogger().info(FactoryModPlugin.PLUGIN_PREFIX + message); } + public static void logFileError(String fileName, int lineNum, String error) { + sendConsoleMessage(new StringBuilder("ERROR at line ") + .append(lineNum).append(" of ").append(fileName).append(": ").append(error).toString()); + } + public PrintingPressProperties getPrintingPressProperties() { return printingPressProperties; } diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java index 771c5473..d6ee0d4b 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java +++ b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java @@ -1,8 +1,5 @@ package com.github.igotyou.FactoryMod.interfaces; -import java.io.File; -import java.io.IOException; - import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; @@ -23,10 +20,11 @@ * @author igotyou * */ -//TODO: use generic for better type inference -public interface Manager +public interface Manager { + public Class getFactoryType(); + /** * @return the plugin instance */ @@ -55,12 +53,12 @@ public interface Manager /** * Creates a machine from an existing machine data object */ - public InteractionResponse addFactory(Factory factory); + public InteractionResponse addFactory(T factory); /** * Returns the machine (if any exists) at the given location from this manager */ - public Factory getFactory(Location factoryLocation); + public T getFactory(Location factoryLocation); /** * Returns whether a machine exists at the given location @@ -75,7 +73,7 @@ public interface Manager /** * Removes the given machine from the object list */ - public void removeFactory(Factory factory); + public void removeFactory(T factory); /** * Returns the saves file name for this manager diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 45834fce..79489442 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -1,13 +1,13 @@ package com.github.igotyou.FactoryMod.managers; import java.io.File; -import java.io.IOException; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.BaseFactory; import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.utility.InteractionResponse; @@ -30,7 +30,7 @@ */ public class FactoryModManager { - List managers; + List> managers; /** * The plugin instance @@ -45,7 +45,10 @@ public FactoryModManager(FactoryModPlugin plugin) FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); this.plugin = plugin; - managers = Lists.newArrayList( new ProductionManager(plugin), new PrintingPressManager(plugin), new NetherFactoryManager(plugin) ); + managers = Lists.newArrayList(); + managers.add(new ProductionManager(plugin)); + managers.add(new PrintingPressManager(plugin)); + managers.add(new NetherFactoryManager(plugin)); loadManagers(); periodicSaving(); @@ -65,9 +68,9 @@ public void onDisable() */ private void saveManagers() { - for (Manager manager : managers) + for (Manager manager : managers) { - save(manager, getSavesFile(manager.getSavesFileName())); + manager.save(); } } @@ -76,21 +79,21 @@ private void saveManagers() */ private void loadManagers() { - for (Manager manager : managers) + for (Manager manager : managers) { - load(manager, getSavesFile(manager.getSavesFileName())); + manager.load(); } } /** * Returns the appropriate manager depending on the given Manager Type + * @param */ - @SuppressWarnings("rawtypes") - public Manager getManager(Class managerType) + public Manager getManager(Class factoryClass) { - for (Manager manager : managers) + for (Manager manager : managers) { - if (managerType.isInstance(manager)) + if (manager.getFactoryType() == factoryClass) { return manager; } @@ -98,36 +101,6 @@ public Manager getManager(Class managerType) return null; } - - /** - * Load file - */ - private static void load(Manager managerInterface, File file) - { - try - { - managerInterface.load(file); - } - catch (IOException exception) - { - throw new RuntimeException("Failed to load " + file.getPath(), exception); - } - } - - /** - * Save file - */ - private static void save(Manager manager, File file) - { - try - { - manager.save(file); - } - catch (IOException exception) - { - throw new RuntimeException("Failed to save to " + file.getAbsolutePath(), exception); - } - } /** * Save Factories to file every SAVE_CYCLE minutes. @@ -158,7 +131,7 @@ public File getSavesFile(String fileName) */ public boolean factoryExistsAt(Location location) { - for (Manager manager : managers) + for (Manager manager : managers) { if (manager.factoryExistsAt(location)) { @@ -173,7 +146,7 @@ public boolean factoryExistsAt(Location location) */ public boolean factoryWholeAt(Location location) { - for (Manager manager : managers) + for (Manager manager : managers) { if (manager.factoryWholeAt(location)) { @@ -181,37 +154,10 @@ public boolean factoryWholeAt(Location location) } } return false; - } - - - public ProductionManager getProductionManager() - { - for (Manager manager : managers) - { - if (manager.getClass() == ProductionManager.class) - { - return (ProductionManager) manager; - } - } - - return null; - } - - public PrintingPressManager getPrintingPressManager() - { - for (Manager manager : managers) - { - if (manager.getClass() == PrintingPressManager.class) - { - return (PrintingPressManager) manager; - } - } - - return null; } public Factory getFactory(Location location) { - for (Manager manager : managers) + for (Manager manager : managers) { if (manager.factoryExistsAt(location)) { @@ -221,8 +167,8 @@ public Factory getFactory(Location location) { return null; } - public Manager getManager(Location location) { - for (Manager manager : managers) + public Manager getManager(Location location) { + for (Manager manager : managers) { if (manager.factoryExistsAt(location)) { @@ -235,7 +181,7 @@ public Manager getManager(Location location) { public InteractionResponse createFactory(Location centralLocation, Location inventoryLocation, Location powerLocation) { InteractionResponse response = null; - for (Manager manager : managers) + for (Manager manager : managers) { response = manager.createFactory(centralLocation, inventoryLocation, powerLocation); if (response.getInteractionResult() == InteractionResult.SUCCESS) diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 90bac6cd..00a8fa4c 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -1,19 +1,12 @@ package com.github.igotyou.FactoryMod.managers; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; @@ -23,8 +16,6 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; -import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; import com.github.igotyou.FactoryMod.persistence.FileBackup; @@ -53,7 +44,7 @@ * */ -public class NetherFactoryManager implements Manager +public class NetherFactoryManager implements Manager { private ReinforcementManager rm = Citadel.getReinforcementManager(); private FactoryModPlugin plugin; @@ -63,7 +54,6 @@ public class NetherFactoryManager implements Manager private long repairTime; private boolean isLogging = true; - @SuppressWarnings("unchecked") public NetherFactoryManager(FactoryModPlugin plugin) { this.plugin = plugin; @@ -71,112 +61,31 @@ public NetherFactoryManager(FactoryModPlugin plugin) netherFactorys = Lists.newArrayList(); //Set maintenance clock to 0 updateFactorys(); - //TODO: use type inference to avoid cast - mDao = (FactoryDao) PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); + mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } @Override public void save() { - //Takes difference between last repair update and current one and scales repair accordingly updateRepair(System.currentTimeMillis() - repairTime); repairTime = System.currentTimeMillis(); FileBackup.backup(mSaveFile); mDao.writeFactories(netherFactorys); - - //TODO: migrate - FileOutputStream fileOutputStream = new FileOutputStream(mSaveFile); - ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); - int version = 1; - oos.writeInt(version); - oos.writeInt(netherFactorys.size()); - for (NetherFactory factory : netherFactorys) - { - Location centerlocation = factory.getCenterLocation(); - Location inventoryLocation = factory.getInventoryLocation(); - Location powerLocation = factory.getPowerSourceLocation(); - Location netherTeleportPlatformLocation = factory.getNetherTeleportPlatform(); - Location overworldTeleportPlatformLocation = factory.getOverworldTeleportPlatform(); - - oos.writeUTF(centerlocation.getWorld().getName()); - - oos.writeInt(centerlocation.getBlockX()); - oos.writeInt(centerlocation.getBlockY()); - oos.writeInt(centerlocation.getBlockZ()); - - oos.writeInt(inventoryLocation.getBlockX()); - oos.writeInt(inventoryLocation.getBlockY()); - oos.writeInt(inventoryLocation.getBlockZ()); - - oos.writeInt(powerLocation.getBlockX()); - oos.writeInt(powerLocation.getBlockY()); - oos.writeInt(powerLocation.getBlockZ()); - - oos.writeInt(overworldTeleportPlatformLocation.getBlockX()); - oos.writeInt(overworldTeleportPlatformLocation.getBlockY()); - oos.writeInt(overworldTeleportPlatformLocation.getBlockZ()); - - oos.writeUTF(netherTeleportPlatformLocation.getWorld().getName()); - oos.writeInt(netherTeleportPlatformLocation.getBlockX()); - oos.writeInt(netherTeleportPlatformLocation.getBlockY()); - oos.writeInt(netherTeleportPlatformLocation.getBlockZ()); - - oos.writeBoolean(factory.getActive()); - oos.writeInt(factory.getMode().getId()); - oos.writeDouble(factory.getCurrentRepair()); - oos.writeLong(factory.getTimeDisrepair()); - - } - oos.flush(); - fileOutputStream.close(); } @Override public void load() { isLogging = false; - try { - repairTime=System.currentTimeMillis(); - FileInputStream fileInputStream = new FileInputStream(file); - ObjectInputStream ois = new ObjectInputStream(fileInputStream); - int version = ois.readInt(); - assert(version == 1); - int count = ois.readInt(); - int i = 0; - for (i = 0; i < count; i++) - { - String worldName = ois.readUTF(); - World world = plugin.getServer().getWorld(worldName); - - Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location overworldTeleportPlatformLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - - String worldName2 = ois.readUTF(); - World world2 = plugin.getServer().getWorld(worldName2); - - Location netherTeleportPlatformLocation = new Location(world2, ois.readInt(), ois.readInt(), ois.readInt()); - - boolean active = ois.readBoolean(); - NetherOperationMode mode = NetherFactory.NetherOperationMode.byId(ois.readInt()); - double currentRepair = ois.readDouble(); - long timeDisrepair = ois.readLong(); - - NetherFactory factory = new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, - active, currentRepair, timeDisrepair, - mode, - plugin.getNetherFactoryProperties(), this); - addFactory(factory); - } - fileInputStream.close(); - } catch (IOException e) { - e.printStackTrace(); + repairTime = System.currentTimeMillis(); + for(NetherFactory factory : mDao.readFactories()) { + addFactory(factory); } isLogging = true; } + @Override public void updateFactorys() { plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() @@ -192,6 +101,7 @@ public void run() }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); } + @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) { NetherFactoryProperties netherFactoryProperties = plugin.getNetherFactoryProperties(); @@ -318,27 +228,28 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve return new InteractionResponse(InteractionResult.FAILURE, "No factory was identified!"); } - public InteractionResponse addFactory(Factory factory) + @Override + public InteractionResponse addFactory(NetherFactory factory) { - NetherFactory netherFactory = (NetherFactory) factory; - if (netherFactory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && - (!factoryExistsAt(netherFactory.getCenterLocation()) - || !factoryExistsAt(netherFactory.getInventoryLocation()) - || !factoryExistsAt(netherFactory.getPowerSourceLocation()) - || !factoryExistsAt(netherFactory.getNetherTeleportPlatform()) - || !factoryExistsAt(netherFactory.getOverworldTeleportPlatform()) )) + if (factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && + (!factoryExistsAt(factory.getCenterLocation()) + || !factoryExistsAt(factory.getInventoryLocation()) + || !factoryExistsAt(factory.getPowerSourceLocation()) + || !factoryExistsAt(factory.getNetherTeleportPlatform()) + || !factoryExistsAt(factory.getOverworldTeleportPlatform()) )) { - netherFactorys.add(netherFactory); - if (isLogging) { FactoryModPlugin.sendConsoleMessage("Nether factory created: " + netherFactory.getProperties().getName()); } + netherFactorys.add(factory); + if (isLogging) { FactoryModPlugin.sendConsoleMessage("Nether factory created: " + factory.getProperties().getName()); } return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { - FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + netherFactory.getProperties().getName()); + FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + factory.getProperties().getName()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } + @Override public NetherFactory getFactory(Location factoryLocation) { for (NetherFactory factory : netherFactorys) @@ -352,7 +263,8 @@ public NetherFactory getFactory(Location factoryLocation) } return null; } - + + @Override public boolean factoryExistsAt(Location factoryLocation) { boolean returnValue = false; @@ -362,7 +274,8 @@ public boolean factoryExistsAt(Location factoryLocation) } return returnValue; } - + + @Override public boolean factoryWholeAt(Location factoryLocation) { boolean returnValue = false; @@ -373,25 +286,19 @@ public boolean factoryWholeAt(Location factoryLocation) return returnValue; } - public void removeFactory(Factory factory) - { - if(!(factory instanceof NetherFactory)) { - FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); - return; - } - - NetherFactory netherFactory = (NetherFactory)factory; - + @Override + public void removeFactory(NetherFactory factory) + { FactoryModPlugin.sendConsoleMessage(new StringBuilder("Nether factory removed: ") - .append(netherFactory.getProperties().getName()) + .append(factory.getProperties().getName()) .append(" at ") - .append(StringUtils.formatCoords(netherFactory.getCenterLocation())) + .append(StringUtils.formatCoords(factory.getCenterLocation())) .toString()); - netherFactorys.remove(netherFactory); + netherFactorys.remove(factory); } - + public void updateRepair(long time) { for (NetherFactory factory : netherFactorys) @@ -416,12 +323,13 @@ public void updateRepair(long time) } } } - + + @Override public String getSavesFileName() { return FactoryModPlugin.NETHER_FACTORY_SAVE_FILE; } - + public double getScalingFactor(Location location) { double scalingFactor = 1; @@ -452,6 +360,11 @@ public double getScalingFactor(Location location) @Override public FactoryModPlugin getPlugin() { return plugin; + } + + @Override + public Class getFactoryType() { + return NetherFactory.class; } } diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index d1902c53..407e83af 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -1,35 +1,27 @@ package com.github.igotyou.FactoryMod.managers; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.bukkit.Location; -import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; -import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; import com.github.igotyou.FactoryMod.persistence.FileBackup; +import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.google.common.collect.Lists; //original file: /** @@ -47,7 +39,7 @@ * */ -public class PrintingPressManager implements Manager +public class PrintingPressManager implements Manager { private FactoryModPlugin plugin; private List presses; @@ -59,9 +51,11 @@ public class PrintingPressManager implements Manager public PrintingPressManager(FactoryModPlugin plugin) { this.plugin = plugin; - presses = new ArrayList(); + presses = Lists.newArrayList(); + mSaveFile = new File(plugin.getDataFolder(), "pressSaves.txt"); //Set maintenance clock to 0 updateFactorys(); + mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } public void save() @@ -77,12 +71,14 @@ public void save() public void load() { isLogging = false; + repairTime = System.currentTimeMillis(); for(PrintingPress press : mDao.readFactories()) { addFactory(press); } isLogging = true; } + @Override public void updateFactorys() { plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() @@ -98,6 +94,7 @@ public void run() }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); } + @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) { PrintingPressProperties printingPressProperties = plugin.getPrintingPressProperties(); @@ -123,9 +120,9 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + printingPressProperties.getName() + " there!"); } - public InteractionResponse addFactory(Factory factory) + @Override + public InteractionResponse addFactory(PrintingPress press) { - PrintingPress press = (PrintingPress) factory; if (press.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(press.getCenterLocation())) || !factoryExistsAt(press.getInventoryLocation()) || !factoryExistsAt(press.getPowerSourceLocation())) { @@ -140,6 +137,7 @@ public InteractionResponse addFactory(Factory factory) } } + @Override public PrintingPress getFactory(Location factoryLocation) { for (PrintingPress production : presses) @@ -150,7 +148,8 @@ public PrintingPress getFactory(Location factoryLocation) } return null; } - + + @Override public boolean factoryExistsAt(Location factoryLocation) { boolean returnValue = false; @@ -160,7 +159,8 @@ public boolean factoryExistsAt(Location factoryLocation) } return returnValue; } - + + @Override public boolean factoryWholeAt(Location factoryLocation) { boolean returnValue = false; @@ -171,15 +171,9 @@ public boolean factoryWholeAt(Location factoryLocation) return returnValue; } - public void removeFactory(Factory factory) + @Override + public void removeFactory(PrintingPress press) { - if(!(factory instanceof PrintingPress)) { - FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); - return; - } - - PrintingPress press = (PrintingPress)factory; - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Printing press removed: ") .append(press.getProperties().getName()) .append(" at ") @@ -188,7 +182,7 @@ public void removeFactory(Factory factory) presses.remove(press); } - + public void updateRepair(long time) { for (PrintingPress press : presses) @@ -212,7 +206,8 @@ public void updateRepair(long time) } } } - + + @Override public String getSavesFileName() { return FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE; @@ -223,4 +218,9 @@ public FactoryModPlugin getPlugin() { return plugin; } + @Override + public Class getFactoryType() { + return PrintingPress.class; + } + } diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java index 8e57e5ac..abde62db 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java @@ -1,7 +1,6 @@ package com.github.igotyou.FactoryMod.managers; import java.io.File; -import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -14,7 +13,6 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; import com.github.igotyou.FactoryMod.persistence.FileBackup; @@ -43,7 +41,7 @@ * */ -public class ProductionManager implements Manager +public class ProductionManager implements Manager { private FactoryModPlugin plugin; private List producers; @@ -52,7 +50,6 @@ public class ProductionManager implements Manager private long repairTime; private boolean isLogging = true; - @SuppressWarnings("unchecked") public ProductionManager(FactoryModPlugin plugin) { this.plugin = plugin; @@ -60,11 +57,10 @@ public ProductionManager(FactoryModPlugin plugin) producers = Lists.newArrayList(); //Set maintenance clock to 0 updateFactorys(); - //TODO: use type inference to avoid cast - mDao = (FactoryDao) PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); + mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } - public void save(File file) throws IOException + public void save() { //Takes difference between last repair update and current one and scales repair accordingly updateRepair(System.currentTimeMillis() - repairTime); @@ -74,7 +70,7 @@ public void save(File file) throws IOException mDao.writeFactories(producers); } - public void load(File file) throws IOException + public void load() { isLogging = false; repairTime = System.currentTimeMillis(); @@ -84,6 +80,7 @@ public void load(File file) throws IOException isLogging = true; } + @Override public void updateFactorys() { plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() @@ -99,6 +96,7 @@ public void run() }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); } + @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) { if (!factoryExistsAt(factoryLocation)) @@ -167,23 +165,24 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); } - public InteractionResponse addFactory(Factory factory) + @Override + public InteractionResponse addFactory(ProductionFactory factory) { - ProductionFactory production = (ProductionFactory) factory; - if (production.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(production.getCenterLocation())) - || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) + if (factory.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(factory.getCenterLocation())) + || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation())) { - producers.add(production); - if(isLogging) { FactoryModPlugin.sendConsoleMessage("Production factory created: " + production.getProductionFactoryProperties().getName()); } + producers.add(factory); + if(isLogging) { FactoryModPlugin.sendConsoleMessage("Production factory created: " + factory.getProductionFactoryProperties().getName()); } return new InteractionResponse(InteractionResult.SUCCESS, ""); } else { - FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + production.getProductionFactoryProperties().getName()); + FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + factory.getProductionFactoryProperties().getName()); return new InteractionResponse(InteractionResult.FAILURE, ""); } } + @Override public ProductionFactory getFactory(Location factoryLocation) { for (ProductionFactory production : producers) @@ -195,6 +194,7 @@ public ProductionFactory getFactory(Location factoryLocation) return null; } + @Override public boolean factoryExistsAt(Location factoryLocation) { boolean returnValue = false; @@ -205,6 +205,7 @@ public boolean factoryExistsAt(Location factoryLocation) return returnValue; } + @Override public boolean factoryWholeAt(Location factoryLocation) { boolean returnValue = false; @@ -215,22 +216,16 @@ public boolean factoryWholeAt(Location factoryLocation) return returnValue; } - public void removeFactory(Factory factory) + @Override + public void removeFactory(ProductionFactory factory) { - if(!(factory instanceof ProductionFactory)) { - FactoryModPlugin.sendConsoleMessage("Could not remove unexpected factory type: " + factory.getClass().getName()); - return; - } - - ProductionFactory producer = (ProductionFactory)factory; - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Production factory removed: ") - .append(producer.getProductionFactoryProperties().getName()) + .append(factory.getProductionFactoryProperties().getName()) .append(" at ") - .append(StringUtils.formatCoords(producer.getCenterLocation())) + .append(StringUtils.formatCoords(factory.getCenterLocation())) .toString()); - producers.remove(producer); + producers.remove(factory); } public void updateRepair(long time) @@ -257,6 +252,7 @@ public void updateRepair(long time) } } + @Override public String getSavesFileName() { return mSaveFile.getName(); @@ -267,4 +263,9 @@ public FactoryModPlugin getPlugin() { return plugin; } + @Override + public Class getFactoryType() { + return ProductionFactory.class; + } + } diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java new file mode 100644 index 00000000..de5f513e --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -0,0 +1,115 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.nio.charset.Charset; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.World; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; +import com.google.common.collect.Lists; +import com.google.common.io.Files; + +public class NetherCsvReader implements FactoryReader { + + /** + * The plugin instance + */ + FactoryModPlugin mPlugin; + + /** + * The CSV file being read + */ + File mFile; + + static final int VERSION = 1; + + public NetherCsvReader(FactoryModPlugin plugin, File file) { + mPlugin = plugin; + mFile = file; + } + + @Override + public synchronized List read() { + + List factories = Lists.newArrayList(); + + if(!mFile.exists() || mFile.isDirectory()) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") + .append(mFile.getName()).append(" is not a valid file!").toString()); + return factories; + } + + ObjectInputStream ois; + + try { + FileInputStream fileInputStream = new FileInputStream(mFile); + ois = new ObjectInputStream(fileInputStream); + } catch (Exception e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); + return factories; + } + + int lineNum = 1; + + try { + int version = ois.readInt(); + if(version != VERSION) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); + ois.close(); + return factories; + } + + int count = ois.readInt(); + for (int i = 0; i < count; i++) + { + try { + factories.add(read(ois)); + } catch (Exception ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); + break; + } + } + } catch (IOException ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); + } + + return factories; + } + + public NetherFactory read(ObjectInputStream input) throws Exception { + String worldName = input.readUTF(); + World world = mPlugin.getServer().getWorld(worldName); + + Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location overworldTeleportPlatformLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + + String worldName2 = input.readUTF(); + World world2 = mPlugin.getServer().getWorld(worldName2); + + Location netherTeleportPlatformLocation = new Location(world2, input.readInt(), input.readInt(), input.readInt()); + + boolean active = input.readBoolean(); + NetherOperationMode mode = NetherFactory.NetherOperationMode.byId(input.readInt()); + double currentRepair = input.readDouble(); + long timeDisrepair = input.readLong(); + + return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, + active, currentRepair, timeDisrepair, + mode, + mPlugin.getNetherFactoryProperties(), this); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java new file mode 100644 index 00000000..bcdf45f0 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java @@ -0,0 +1,113 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.util.List; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; + +public class NetherCsvWriter implements FactoryWriter { + + static final int VERSION = 1; + + File mFile; + + public NetherCsvWriter(File file) { + mFile = file; + } + + @Override + public void write(List factories) { + + if(!mFile.exists()) { + try { + mFile.createNewFile(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + return; + } + } + + FileOutputStream fileStream = null; + + try { + fileStream = new FileOutputStream(mFile); + } catch (FileNotFoundException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for writing: ").append(ex.getMessage()).toString()); + return; + } + + ObjectOutputStream out = null; + + try { + out = new ObjectOutputStream(fileStream); + out.writeInt(VERSION); + out.writeInt(factories.size()); + } catch(IOException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to file ") + .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); + try { + if(fileStream!= null) fileStream.close(); + } catch (IOException e) {} + return; + } + + for (NetherFactory factory : factories) + { + Location centerlocation = factory.getCenterLocation(); + Location inventoryLocation = factory.getInventoryLocation(); + Location powerLocation = factory.getPowerSourceLocation(); + Location netherTeleportPlatformLocation = factory.getNetherTeleportPlatform(); + Location overworldTeleportPlatformLocation = factory.getOverworldTeleportPlatform(); + + try { + out.writeUTF(centerlocation.getWorld().getName()); + + out.writeInt(centerlocation.getBlockX()); + out.writeInt(centerlocation.getBlockY()); + out.writeInt(centerlocation.getBlockZ()); + + out.writeInt(inventoryLocation.getBlockX()); + out.writeInt(inventoryLocation.getBlockY()); + out.writeInt(inventoryLocation.getBlockZ()); + + out.writeInt(powerLocation.getBlockX()); + out.writeInt(powerLocation.getBlockY()); + out.writeInt(powerLocation.getBlockZ()); + + out.writeInt(overworldTeleportPlatformLocation.getBlockX()); + out.writeInt(overworldTeleportPlatformLocation.getBlockY()); + out.writeInt(overworldTeleportPlatformLocation.getBlockZ()); + + out.writeUTF(netherTeleportPlatformLocation.getWorld().getName()); + out.writeInt(netherTeleportPlatformLocation.getBlockX()); + out.writeInt(netherTeleportPlatformLocation.getBlockY()); + out.writeInt(netherTeleportPlatformLocation.getBlockZ()); + + out.writeBoolean(factory.getActive()); + out.writeInt(factory.getMode().getId()); + out.writeDouble(factory.getCurrentRepair()); + out.writeLong(factory.getTimeDisrepair()); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") + .append(mFile.getName()).append(" for factory ").append(factories.indexOf(factory)).append(": ").append(e.getMessage()).toString()); + } + } + + try { + out.flush(); + fileStream.close(); + } catch(IOException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") + .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); + } + } +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java index 94364063..32ce66f0 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -3,7 +3,10 @@ import java.io.File; import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; import com.github.igotyou.FactoryMod.managers.PrintingPressManager; @@ -12,15 +15,15 @@ public class PersistenceFactory { //TODO: use type inference for return - public static FactoryDao getFactoryDao(Manager factoryManager, File saveFile, String saveFormat) { + public static FactoryDao getFactoryDao(Manager factoryManager, File saveFile, String saveFormat) { if(saveFormat.toLowerCase().equals("txt")) { if(factoryManager instanceof ProductionManager) { - return new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); + return (FactoryDao) new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); } else if(factoryManager instanceof PrintingPressManager) { - //TODO: add printing press support + return (FactoryDao) new FactoryDao(new PrintingPressCsvReader(factoryManager.getPlugin(), saveFile), new PrintingPressCsvWriter(saveFile)); } else if(factoryManager instanceof NetherFactoryManager) { - //TODO: add nether factory support + return (FactoryDao) new FactoryDao(new NetherCsvReader(factoryManager.getPlugin(), saveFile), new NetherCsvWriter(saveFile)); } FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); return null; diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java index 6c751c37..53e976a2 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java @@ -1,12 +1,9 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; -import java.nio.charset.Charset; import java.util.List; import org.bukkit.Location; @@ -16,7 +13,6 @@ import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; import com.google.common.collect.Lists; -import com.google.common.io.Files; public class PrintingPressCsvReader implements FactoryReader { @@ -30,80 +26,98 @@ public class PrintingPressCsvReader implements FactoryReader { */ File mFile; + static final int VERSION = 1; + public PrintingPressCsvReader(FactoryModPlugin plugin, File file) { mPlugin = plugin; mFile = file; } - - private enum LineTokens { - - MAX - } @Override - public List read() { + public synchronized List read() { + List presses = Lists.newArrayList(); + if(!mFile.exists() || mFile.isDirectory()) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") .append(mFile.getName()).append(" is not a valid file!").toString()); return presses; } - BufferedReader reader; + ObjectInputStream ois; try { - reader = Files.newReader(mFile, Charset.defaultCharset()); - } catch (FileNotFoundException e) { + FileInputStream fileInputStream = new FileInputStream(mFile); + ois = new ObjectInputStream(fileInputStream); + } catch (Exception e) { FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); return presses; } - int lineNum = 0; + int lineNum = 1; try { - for (String line; (line = reader.readLine()) != null; ++lineNum) + int version = ois.readInt(); + if(version != VERSION) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); + ois.close(); + return presses; + } + + int count = ois.readInt(); + for (int i = 0; i < count; i++) { - String worldName = ois.readUTF(); - World world = plugin.getServer().getWorld(worldName); - - Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - boolean active = ois.readBoolean(); - OperationMode mode = PrintingPress.OperationMode.byId(ois.readInt()); - int productionTimer = ois.readInt(); - int energyTimer = ois.readInt(); - double currentRepair = ois.readDouble(); - long timeDisrepair = ois.readLong(); - int containedPaper = ois.readInt(); - int containedBindings = ois.readInt(); - int containedSecurityMaterials = ois.readInt(); - int lockedResultCode = ois.readInt(); - - int queueLength = ois.readInt(); - int[] processQueue = new int[queueLength]; - int j; - for (j = 0; j < queueLength; j++) { - processQueue[j] = ois.readInt(); + try { + presses.add(read(ois)); + } catch (Exception ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); + break; } - - PrintingPress production = new PrintingPress(centerLocation, inventoryLocation, powerLocation, - active, productionTimer, - energyTimer, currentRepair, timeDisrepair, - mode, - plugin.getPrintingPressProperties(), - containedPaper, containedBindings, containedSecurityMaterials, - processQueue, lockedResultCode); - addFactory(production); } - fileInputStream.close(); - } catch (IOException e) { - e.printStackTrace(); + } catch (IOException ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); } + //TODO: ensure everything is closed return presses; } + public PrintingPress read(ObjectInputStream input) throws Exception { + + try { + World world = mPlugin.getServer().getWorld(input.readUTF()); + Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + boolean active = input.readBoolean(); + OperationMode mode = PrintingPress.OperationMode.byId(input.readInt()); + int productionTimer = input.readInt(); + int energyTimer = input.readInt(); + double currentRepair = input.readDouble(); + long timeDisrepair = input.readLong(); + int containedPaper = input.readInt(); + int containedBindings = input.readInt(); + int containedSecurityMaterials = input.readInt(); + int lockedResultCode = input.readInt(); + + int queueLength = input.readInt(); + int[] processQueue = new int[queueLength]; + + for (int q = 0; q < queueLength; q++) { + processQueue[q] = input.readInt(); + } + + return new PrintingPress( + centerLocation, inventoryLocation, powerLocation, + active, productionTimer, energyTimer, currentRepair, timeDisrepair, + mode, mPlugin.getPrintingPressProperties(), + containedPaper, containedBindings, containedSecurityMaterials, + processQueue, lockedResultCode); + } catch (NumberFormatException e) { + throw new Exception("Expected token was not an integer"); + } + + } } diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java index 035c7a95..d45d6e15 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java @@ -1,63 +1,120 @@ package com.github.igotyou.FactoryMod.persistence; +import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.IOException; import java.io.ObjectOutputStream; +import java.util.List; import org.bukkit.Location; +import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -public class PrintingPressCsvWriter { - +public class PrintingPressCsvWriter implements FactoryWriter { - public void save() { - - FileOutputStream fileOutputStream = new FileOutputStream(file); - ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); - int version = 1; - oos.writeInt(version); - oos.writeInt(presses.size()); - for (PrintingPress production : presses) - { - //order: subFactoryType world recipe1,recipe2 central_x central_y central_z inventory_x inventory_y inventory_z power_x power_y power_z active productionTimer energyTimer current_Recipe_number - - Location centerlocation = production.getCenterLocation(); - Location inventoryLocation = production.getInventoryLocation(); - Location powerLocation = production.getPowerSourceLocation(); - - oos.writeUTF(centerlocation.getWorld().getName()); - - oos.writeInt(centerlocation.getBlockX()); - oos.writeInt(centerlocation.getBlockY()); - oos.writeInt(centerlocation.getBlockZ()); + static final int VERSION = 1; + + File mFile; + + public PrintingPressCsvWriter(File file) { + mFile = file; + } - oos.writeInt(inventoryLocation.getBlockX()); - oos.writeInt(inventoryLocation.getBlockY()); - oos.writeInt(inventoryLocation.getBlockZ()); + @Override + public synchronized void write(List presses) { - oos.writeInt(powerLocation.getBlockX()); - oos.writeInt(powerLocation.getBlockY()); - oos.writeInt(powerLocation.getBlockZ()); - - oos.writeBoolean(production.getActive()); - oos.writeInt(production.getMode().getId()); - oos.writeInt(production.getProductionTimer()); - oos.writeInt(production.getEnergyTimer()); - oos.writeDouble(production.getCurrentRepair()); - oos.writeLong(production.getTimeDisrepair()); + if(!mFile.exists()) { + try { + mFile.createNewFile(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + return; + } + } + + FileOutputStream fileStream = null; + + try { + fileStream = new FileOutputStream(mFile); + } catch (FileNotFoundException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for writing: ").append(ex.getMessage()).toString()); + return; + } + + ObjectOutputStream out = null; - oos.writeInt(production.getContainedPaper()); - oos.writeInt(production.getContainedBindings()); - oos.writeInt(production.getContainedSecurityMaterials()); - oos.writeInt(production.getLockedResultCode()); - - int[] processQueue = production.getProcessQueue(); - oos.writeInt(processQueue.length); - for (int entry : processQueue) { - oos.writeInt(entry); + try { + out = new ObjectOutputStream(fileStream); + out.writeInt(VERSION); + out.writeInt(presses.size()); + } catch(IOException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to file ") + .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); + try { + if(fileStream!= null) fileStream.close(); + } catch (IOException e) {} + return; + } + for (PrintingPress press : presses) + { + // order: subFactoryType world recipe1,recipe2 + // central_x central_y central_z + // inventory_x inventory_y inventory_z + // power_x power_y power_z + // active productionTimer energyTimer current_Recipe_number + + Location centerlocation = press.getCenterLocation(); + Location inventoryLocation = press.getInventoryLocation(); + Location powerLocation = press.getPowerSourceLocation(); + + try { + out.writeUTF(centerlocation.getWorld().getName()); + + out.writeInt(centerlocation.getBlockX()); + out.writeInt(centerlocation.getBlockY()); + out.writeInt(centerlocation.getBlockZ()); + + out.writeInt(inventoryLocation.getBlockX()); + out.writeInt(inventoryLocation.getBlockY()); + out.writeInt(inventoryLocation.getBlockZ()); + + out.writeInt(powerLocation.getBlockX()); + out.writeInt(powerLocation.getBlockY()); + out.writeInt(powerLocation.getBlockZ()); + + out.writeBoolean(press.getActive()); + out.writeInt(press.getMode().getId()); + out.writeInt(press.getProductionTimer()); + out.writeInt(press.getEnergyTimer()); + out.writeDouble(press.getCurrentRepair()); + out.writeLong(press.getTimeDisrepair()); + + out.writeInt(press.getContainedPaper()); + out.writeInt(press.getContainedBindings()); + out.writeInt(press.getContainedSecurityMaterials()); + out.writeInt(press.getLockedResultCode()); + + int[] processQueue = press.getProcessQueue(); + out.writeInt(processQueue.length); + for (int entry : processQueue) { + out.writeInt(entry); + } + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") + .append(mFile.getName()).append(" for factory ").append(presses.indexOf(press)).append(": ").append(e.getMessage()).toString()); + } } + + try { + out.flush(); + fileStream.close(); + } catch(IOException ex) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") + .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); } - oos.flush(); - fileOutputStream.close(); } } diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java index a1c602e6..e4b5b54c 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java @@ -80,7 +80,7 @@ public synchronized List read() { return factories; } - int lineNum = 0; + int lineNum = 1; try { for (String line; (line = reader.readLine()) != null; ++lineNum) @@ -88,12 +88,12 @@ public synchronized List read() { try { factories.add(read(line)); } catch(Exception e) { - logFactoryError(lineNum, "Factory parse error: " + e.getMessage()); + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + e.getMessage()); break; } } } catch (IOException e) { - logFactoryError(lineNum, "Could not read file, aborting"); + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); } try { @@ -168,10 +168,5 @@ public ProductionFactory read(String decode) throws Exception { } } - - private void logFactoryError(int lineNum, String error) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Parse error at line ") - .append(lineNum).append(" of ").append(mFile.getName()).append(": ").append(error).toString()); - } } From 1cea17823fe12949441330ec2ea1ff22f9bba878 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 31 May 2015 22:52:50 -0400 Subject: [PATCH 077/459] Identifiers fix --- config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.yml b/config.yml index 42b7ab9b..5d99d801 100644 --- a/config.yml +++ b/config.yml @@ -1895,11 +1895,11 @@ production_factories: amount: 256 durability: 4 recipes: - - Smelt Prismarine - - Smelt Prismarine Bricks - - Smelt Dark Prismarine + - Smelt_Prismarine + - Smelt_Prismarine_Bricks + - Smelt_Dark_Prismarine - Smelt_Cracked_Stone_Brick - - Craft Sea Lanterns + - Craft_Sea_Lanterns - Smelt_Mossy_Stone_Brick - Smelt_Chiseled_Stone_Brick - Bastion_Flooring @@ -7599,7 +7599,7 @@ production_recipes: Eye of Ender: material: EYE_OF_ENDER amount: 256 - Smelt Prismarine: + Smelt_Prismarine: name: Smelt Prismarine production_time: 16 inputs: @@ -7611,7 +7611,7 @@ production_recipes: material: PRISMARINE amount: 64 durability: 0 - Smelt Prismarine Bricks: + Smelt_Prismarine_Bricks: name: Smelt Prismarine Bricks production_time: 16 inputs: @@ -7623,7 +7623,7 @@ production_recipes: material: PRISMARINE amount: 64 durability: 1 - Smelt Dark Prismarine: + Smelt_Dark_Prismarine: name: Smelt Dark Prismarine production_time: 16 inputs: @@ -7639,7 +7639,7 @@ production_recipes: material: PRISMARINE amount: 64 durability: 2 - Craft Sea Lanterns: + Craft_Sea_Lanterns: name: Craft Sea Lanterns production_time: 8 inputs: From 2eefd09b2902b824b4dc37b426f9c761d97bc04f Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 1 Jun 2015 01:50:56 -0500 Subject: [PATCH 078/459] Mass Refactoring. Created Abstract Factory --- .../igotyou/FactoryMod/FactoryModPlugin.java | 1094 ++++++++--------- .../igotyou/FactoryMod/FactoryObject.java | 426 +++---- .../{BaseFactory.java => ABaseFactory.java} | 14 +- .../Factory.java => Factorys/IFactory.java} | 119 +- .../FactoryMod/Factorys/NetherFactory.java | 2 +- .../FactoryMod/Factorys/PrintingPress.java | 2 +- .../Factorys/ProductionFactory.java | 608 ++++----- .../listeners/FactoryModListener.java | 14 +- .../listeners/RedstoneListener.java | 10 +- .../igotyou/FactoryMod/managers/AManager.java | 148 +++ ...anager.java => FactoryManagerService.java} | 391 +++--- .../Manager.java => managers/IManager.java} | 167 +-- .../managers/NetherFactoryManager.java | 136 +- .../managers/PrintingPressManager.java | 131 +- ...ger.java => ProductionFactoryManager.java} | 426 +++---- .../FactoryMod/persistence/FactoryCodec.java | 22 +- .../FactoryMod/persistence/FactoryDao.java | 50 +- .../FactoryMod/persistence/FactoryReader.java | 22 +- .../FactoryMod/persistence/FactoryWriter.java | 22 +- .../persistence/NetherCsvReader.java | 231 ++-- .../persistence/PersistenceFactory.java | 72 +- .../properties/AFactoryProperties.java | 10 + .../IFactoryProperties.java} | 47 +- .../properties/NetherFactoryProperties.java | 7 +- .../properties/PrintingPressProperties.java | 8 +- .../properties/ProductionProperties.java | 113 +- .../Recipe.java => recipes/IRecipe.java} | 20 +- .../FactoryMod/recipes/ProductionRecipe.java | 220 ++-- 28 files changed, 2170 insertions(+), 2362 deletions(-) rename src/com/github/igotyou/FactoryMod/Factorys/{BaseFactory.java => ABaseFactory.java} (97%) rename src/com/github/igotyou/FactoryMod/{interfaces/Factory.java => Factorys/IFactory.java} (73%) create mode 100644 src/com/github/igotyou/FactoryMod/managers/AManager.java rename src/com/github/igotyou/FactoryMod/managers/{FactoryModManager.java => FactoryManagerService.java} (77%) rename src/com/github/igotyou/FactoryMod/{interfaces/Manager.java => managers/IManager.java} (90%) rename src/com/github/igotyou/FactoryMod/managers/{ProductionManager.java => ProductionFactoryManager.java} (56%) create mode 100644 src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java rename src/com/github/igotyou/FactoryMod/{interfaces/Properties.java => properties/IFactoryProperties.java} (72%) rename src/com/github/igotyou/FactoryMod/{interfaces/Recipe.java => recipes/IRecipe.java} (65%) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 779c4616..aac82348 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,547 +1,547 @@ -package com.github.igotyou.FactoryMod; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.inventory.meta.Repairable; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.interfaces.Properties; -import com.github.igotyou.FactoryMod.listeners.FactoryModListener; -import com.github.igotyou.FactoryMod.listeners.NoteStackListener; -import com.github.igotyou.FactoryMod.listeners.RedstoneListener; -import com.github.igotyou.FactoryMod.managers.FactoryModManager; -import com.github.igotyou.FactoryMod.managers.ProductionManager; -import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; -import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - - -public class FactoryModPlugin extends JavaPlugin -{ - - /* Special Values */ - public static final String VERSION = "v1.0"; //Current version of plugin - public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin - public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; - public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name - public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name - public static final int TICKS_PER_SECOND = 20; //ideal number of ticks per second - public static final int TICKS_PER_MIN = 20; //ideal number of ticks per minute - public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) - public static final int MINUTES_PER_YEAR = 60 * 60 * 24 * 365; //number of minutes per year (31.5M) - private static final String CONFIG_FILE = "config.yml"; // the config file name - private static final NamedItemStack DEFAULT_FUEL = new NamedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item - - /* General Properties */ - - /** - * How frequently in ticks factory states are updated (Default 20) - */ - public static int PRODUCER_UPDATE_CYCLE; - /** - * How often in minutes the managers should save their factories to file (Default 15) - */ - public static int SAVE_CYCLE; - /** - * Number of days after a factory falls into disrepair until it is removed (Default 14) - */ - public static long DISREPAIR_PERIOD; - /** - * Number of days for a factory to fully degrade from 100% to 0% health (Default 28) - */ - public static long REPAIR_PERIOD; - /** - * Factory center block material (Default WORKBENCH) - */ - public static Material CENTRAL_BLOCK_MATERIAL; - /** - * The item used to interact with factoies (Default STICK) - */ - public static Material FACTORY_INTERACTION_MATERIAL; - /** - * Whether the build materials are returned upon destruction of a factory (Default false) - */ - public static boolean RETURN_BUILD_MATERIALS; - /** - * Whether Citadel is enabled (Default true) - */ - public static boolean CITADEL_ENABLED; - /** - * Whether factories are permanently removed upon the destruction of their blocks (Default false) - */ - public static boolean DESTRUCTIBLE_FACTORIES; - /** - * Whether XP orb drops are disabled (Default false) - */ - public static boolean DISABLE_EXPERIENCE; - /** - * Whether factories are triggered by redstone signals (Default true) - */ - public static boolean REDSTONE_START_ENABLED; - /** - * Whether factory running state is output to a lever (Default true) - */ - public static boolean LEVER_OUTPUT_ENABLED; - - /* Nether Properties */ - - /** - * The name of the overworld dimension (Default world) - */ - public static String WORLD_NAME; - /** - * The name of the nether dimension (Default world_nether) - */ - public static String NETHER_NAME; - /** - * Overworld to nether distance ratio (Default 8) - */ - public static int NETHER_SCALE; - /** - * Disable vanilla nether portal operation (Default true) - */ - public static boolean DISABLE_PORTALS; - /** - * The material of the nether factory teleport platform (Default OBSIDIAN) - */ - public static Material NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL; - /** - * Allow reinforcement above nether factory teleport platforms (Default false) - */ - public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; - /** - * Allow placing of blocks above nether factory teleport platform (Default false) - */ - public static boolean ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM; - /** - * Whether teleport platforms are unbreakable (Default false) - */ - public static boolean TELEPORT_PLATFORM_INVUNERABLE; - /** - * Whether the teleport platform is generated when a player is about to teleport (Default false) - */ - public static boolean REGENERATE_TELEPORT_BLOCK_ON_TELEPORT; - /** - * Whether the blocks above a portal are destroyed, ignoring Citadel, when a player is about to teleport (Default false) - */ - public static boolean REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT; - /** - * The material of the nether factory marker block (Default COAL_BLOCK) - */ - public static Material NETHER_FACTORY_MARKER_MATERIAL; - /** - * Maximum distance between nether factory and marker (Default 64) - */ - public static int NETHER_MARKER_MAX_DISTANCE; - - public static Map productionProperties; - public static Map productionRecipes; - - public FactoryModManager manager; - public PrintingPressProperties printingPressProperties; - public NetherFactoryProperties netherFactoryProperties; - - public void onEnable() - { - plugin = this; - //load the config.yml - initConfig(); - //create the main manager - manager = new FactoryModManager(this); - //register the events(this should be moved...) - registerEvents(); - } - - public void onDisable() - { - //call the disable method, this will save the data etc. - manager.onDisable(); - } - - public void registerEvents() - { - try - { - getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); - getServer().getPluginManager().registerEvents(new RedstoneListener(manager, (ProductionManager) manager.getManager(ProductionFactory.class)), this); - getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - public void initConfig() - { - sendConsoleMessage("Initializing FactoryMod Config."); - - productionProperties = Maps.newHashMap(); - productionRecipes = Maps.newHashMap(); - - FileConfiguration config = getConfig(); - if(getConfig().getDefaults().getBoolean("copy_defaults", true)) - { - saveResource(CONFIG_FILE, true); - } - this.saveDefaultConfig(); - reloadConfig(); - config = getConfig(); - - NETHER_SCALE = config.getInt("nether_general.nether_scale", 8); - DISABLE_PORTALS = config.getBoolean("nether_general.disable_portals", true); - ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_reinforcement_creation_above_teleport_platform", false); - ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_block_placement_above_teleport_platform", false); - TELEPORT_PLATFORM_INVUNERABLE = config.getBoolean("nether_general.teleport_platform_invunerable", false); - REGENERATE_TELEPORT_BLOCK_ON_TELEPORT = config.getBoolean("nether_general.regenerate_teleport_block_on_teleport", false); - REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT = config.getBoolean("nether_general.remove_blocks_above_teleport_platform_on_teleport", false); - WORLD_NAME = config.getString("nether_general.world_name", "world"); - NETHER_NAME = config.getString("nether_general.nether_name", "world_nether"); - SAVE_CYCLE = config.getInt("general.save_cycle", 15) * TICKS_PER_MIN; - CENTRAL_BLOCK_MATERIAL = Material.getMaterial(config.getString("general.central_block", Material.WORKBENCH.name())); - NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL = Material.getMaterial(config.getString("nether_general.teleport_platform_material_nether_factory", Material.OBSIDIAN.name())); - NETHER_FACTORY_MARKER_MATERIAL = Material.getMaterial(config.getString("nether_general.marker_material_nether_factory", Material.COAL_BLOCK.name())); - NETHER_MARKER_MAX_DISTANCE = config.getInt("nether_general.marker_max_distance", 64); - RETURN_BUILD_MATERIALS = config.getBoolean("general.return_build_materials", false); - CITADEL_ENABLED = config.getBoolean("general.citadel_enabled", true); - FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material", Material.STICK.name())); - DESTRUCTIBLE_FACTORIES = config.getBoolean("general.destructible_factories", false); - DISABLE_EXPERIENCE = config.getBoolean("general.disable_experience", false); - PRODUCER_UPDATE_CYCLE = config.getInt("production_general.update_cycle", 20); - DISREPAIR_PERIOD = config.getLong("general.disrepair_period", 14) * MILLIS_PER_DAY; - REPAIR_PERIOD = config.getLong("production_general.repair_period", 28) * MILLIS_PER_DAY; - LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled", true); - REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled", true); - - List disabledRecipes = config.getStringList("crafting.disable"); - for (String disable : disabledRecipes) - { - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disable)); - List tempList = getServer().getRecipesFor(recipeItemStack); - for (Recipe rec : tempList) - { - removeRecipe(rec); - } - } - - //Enable the following recipes - ConfigurationSection configCraftingEnable = config.getConfigurationSection("crafting.enable"); - for (String recipeName : configCraftingEnable.getKeys(false)) - { - ConfigurationSection configSection=configCraftingEnable.getConfigurationSection(recipeName); - Recipe recipe; - List shape = configSection.getStringList("shape"); - NamedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); - - if(shape.isEmpty()) - { - ShapelessRecipe shapelessRecipe = new ShapelessRecipe(output); - - for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) - { - shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); - } - - recipe = shapelessRecipe; - } - else - { - ShapedRecipe shapedRecipe = new ShapedRecipe(output); - shapedRecipe.shape(shape.toArray(new String[shape.size()])); - - for(String inputKey : configSection.getConfigurationSection("inputs").getKeys(false)) - { - ItemStack input = getItems(configSection.getConfigurationSection("inputs." + inputKey)).get(0); - shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); - } - - recipe = shapedRecipe; - } - Bukkit.addRecipe(recipe); - } - - //Import recipes from config.yml - ConfigurationSection configProdRecipes = config.getConfigurationSection("production_recipes"); - //Temporary Storage array to store where recipes should point to each other - Map> outputRecipes = Maps.newHashMap(); - - for (String title : configProdRecipes.getKeys(false)) - { - //Section header in recipe file, also serves as unique identifier for the recipe - //All spaces are replaced with udnerscores so they don't disrupt saving format - //There should be a check for uniqueness of this identifier... - ConfigurationSection configSection = configProdRecipes.getConfigurationSection(title); - title = title.replaceAll(" ", "_"); - //Display name of the recipe, Deafult of "Default Name" - String recipeName = configSection.getString("name", "Default Name"); - //Production time of the recipe, default of 1 - //TODO: fix config according to default 1 - int productionTime = configSection.getInt("production_time", 2); - //Inputs of the recipe, empty of there are no inputs - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); - //Inputs of the recipe, empty of there are no inputs - ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); - //Outputs of the recipe, empty of there are no inputs - ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); - //Enchantments of the recipe, empty of there are no inputs - List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); - //Whether this recipe can only be used once - boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantments, useOnce, new ItemList()); - productionRecipes.put(title, recipe); - //Store the titles of the recipes that this should point to - List currentOutputRecipes = Lists.newArrayList(); - currentOutputRecipes.addAll(configSection.getStringList("output_recipes")); - outputRecipes.put(recipe, currentOutputRecipes); - } - - //Once ProductionRecipe objects have been created correctly insert different pointers - for (ProductionRecipe recipe : outputRecipes.keySet()) - { - for( String output : outputRecipes.get(recipe)) - { - recipe.addOutputRecipe(productionRecipes.get(output)); - } - } - - - //Import factories from config.yml - ConfigurationSection configProdFactories = config.getConfigurationSection("production_factories"); - for (String title : configProdFactories.getKeys(false)) - { - ConfigurationSection configSection = configProdFactories.getConfigurationSection(title); - title = title.replaceAll(" ", "_"); - String factoryName = configSection.getString("name", "Default Name"); - //Uses overpowered getItems method for consistency, should always return a list of size=1 - //If no fuel is found, default to charcoal - ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); - if(fuel.isEmpty()) - { - fuel = new ItemList(); - fuel.add(DEFAULT_FUEL); - } - //TODO: default fuel time should be 1 - int fuelTime = configSection.getInt("fuel_time", 2); - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); - ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); - - List factoryRecipes = Lists.newArrayList(); - for (String recipe : configSection.getStringList("recipes")) - { - factoryRecipes.add(productionRecipes.get(recipe)); - } - - int repair = configSection.getInt("repair_multiple",0); - //Create repair recipe - productionRecipes.put(title + "REPAIR", new ProductionRecipe(title + "REPAIR", "Repair Factory", 1, repairs)); - factoryRecipes.add(productionRecipes.get(title + "REPAIR")); - ProductionProperties productionProperty = new ProductionProperties(inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); - productionProperties.put(title, productionProperty); - } - - ConfigurationSection configPrintingPresses = config.getConfigurationSection("printing_presses"); - ConfigurationSection configNetherFactory = config.getConfigurationSection("nether_factory"); - printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); - netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); - sendConsoleMessage("Finished initializing FactoryMod Config."); - } - - private List getEnchantments(ConfigurationSection configEnchantments) - { - List enchantments = Lists.newArrayList(); - if(configEnchantments != null) - { - for (String name : configEnchantments.getKeys(false)) - { - ConfigurationSection configEnchantment = configEnchantments.getConfigurationSection(name); - String type = configEnchantment.getString("type"); - if (type != null) - { - int level = configEnchantment.getInt("level", 1); - double probability = configEnchantment.getDouble("probability", 1.0); - ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment(name, type, level, probability); - enchantments.add(enchantment); - } - } - } - return enchantments; - } - - private List getPotionEffects(ConfigurationSection configurationSection) { - List potionEffects = Lists.newArrayList(); - if(configurationSection != null) - { - for (String name : configurationSection.getKeys(false)) - { - ConfigurationSection configEffect = configurationSection.getConfigurationSection(name); - String type = configEffect.getString("type"); - if (type != null) - { - PotionEffectType effect = PotionEffectType.getByName(type); - if (effect != null) { - int duration = configEffect.getInt("duration", 200); - int amplifier = configEffect.getInt("amplifier", 0); - potionEffects.add(new PotionEffect(effect, duration, amplifier)); - } - } - } - } - return potionEffects; - } - - public ItemList getItems(ConfigurationSection configItems) - { - ItemList items = new ItemList(); - if(configItems != null) - { - for(String commonName : configItems.getKeys(false)) - { - - ConfigurationSection configItem = configItems.getConfigurationSection(commonName); - String materialName = configItem.getString("material"); - Material material = Material.getMaterial(materialName); - //only proceeds if an acceptable material name was provided - if (material == null) - { - getLogger().severe(configItems.getCurrentPath() + " requires invalid material " + materialName); - } - else - { - int amount = configItem.getInt("amount", 1); - short durability = (short)configItem.getInt("durability", 0); - int repairCost = (short)configItem.getInt("repair_cost", 0); - String displayName = configItem.getString("display_name"); - String lore = configItem.getString("lore"); - List compulsoryEnchantments = getEnchantments(configItem.getConfigurationSection("enchantments")); - List storedEnchantments = getEnchantments(configItem.getConfigurationSection("stored_enchantments")); - List potionEffects = getPotionEffects(configItem.getConfigurationSection("potion_effects")); - items.add(createItemStack(material, amount, durability, displayName, lore, commonName, repairCost, compulsoryEnchantments, storedEnchantments, potionEffects)); - } - } - } - - return items; - } - - private NamedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, - List compulsoryEnchants, List storedEnchants, List potionEffects) - { - NamedItemStack namedItemStack= new NamedItemStack(material, stackSize, durability,commonName); - if(name != null || loreString != null || compulsoryEnchants.size() > 0 || storedEnchants.size() > 0 || potionEffects.size() > 0 || repairCost > 0) - { - ItemMeta meta = namedItemStack.getItemMeta(); - - if (name != null) { - meta.setDisplayName(name); - } - - if (meta instanceof Repairable && repairCost > 0) { - ((Repairable) meta).setRepairCost(repairCost); - } - - if (loreString!=null) { - List lore = Lists.newArrayList(); - lore.add(loreString); - meta.setLore(lore); - } - - for (ProbabilisticEnchantment enchant : compulsoryEnchants) { - meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), false); - } - - if (meta instanceof EnchantmentStorageMeta) { - EnchantmentStorageMeta esm = (EnchantmentStorageMeta) meta; - for (ProbabilisticEnchantment enchant : storedEnchants) { - esm.addStoredEnchant(enchant.getEnchantment(), enchant.getLevel(), false); - } - } - - if (meta instanceof PotionMeta) { - PotionMeta pm = (PotionMeta) meta; - for (PotionEffect effect : potionEffects) { - pm.addCustomEffect(effect, true); - } - } - - namedItemStack.setItemMeta(meta); - } - - return namedItemStack; - } - - private void removeRecipe(Recipe removalRecipe) - { - Iterator it = getServer().recipeIterator(); - while (it.hasNext()) - { - Recipe recipe = it.next(); - if (recipe.getResult().getType() == removalRecipe.getResult().getType()) - { - it.remove(); - } - } - } - - public static Properties getProperties(FactoryType factoryType, String subFactoryType) - { - switch(factoryType) - { - case PRODUCTION: - return FactoryModPlugin.productionProperties.get(subFactoryType); - default: - return null; - } - } - - public static int getMaxTiers(FactoryType factoryType) - { - // TODO Auto-generated method stub - return 0; - } - - public static void sendConsoleMessage(String message) - { - Bukkit.getLogger().info(FactoryModPlugin.PLUGIN_PREFIX + message); - } - - public static void logFileError(String fileName, int lineNum, String error) { - sendConsoleMessage(new StringBuilder("ERROR at line ") - .append(lineNum).append(" of ").append(fileName).append(": ").append(error).toString()); - } - - public PrintingPressProperties getPrintingPressProperties() { - return printingPressProperties; - } - - public NetherFactoryProperties getNetherFactoryProperties() { - return netherFactoryProperties; - } - - private static FactoryModPlugin plugin; - public static FactoryModPlugin getPlugin(){ - return plugin; - } -} +package com.github.igotyou.FactoryMod; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.ShapedRecipe; +import org.bukkit.inventory.ShapelessRecipe; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.inventory.meta.Repairable; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.listeners.FactoryModListener; +import com.github.igotyou.FactoryMod.listeners.NoteStackListener; +import com.github.igotyou.FactoryMod.listeners.RedstoneListener; +import com.github.igotyou.FactoryMod.managers.FactoryManagerService; +import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; +import com.github.igotyou.FactoryMod.properties.IFactoryProperties; +import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; +import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; +import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + + +public class FactoryModPlugin extends JavaPlugin +{ + + /* Special Values */ + public static final String VERSION = "v1.0"; //Current version of plugin + public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin + public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; + public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name + public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name + public static final int TICKS_PER_SECOND = 20; //ideal number of ticks per second + public static final int TICKS_PER_MIN = 20; //ideal number of ticks per minute + public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) + public static final int MINUTES_PER_YEAR = 60 * 60 * 24 * 365; //number of minutes per year (31.5M) + private static final String CONFIG_FILE = "config.yml"; // the config file name + private static final NamedItemStack DEFAULT_FUEL = new NamedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item + + /* General Properties */ + + /** + * How frequently in ticks factory states are updated (Default 20) + */ + public static int PRODUCER_UPDATE_CYCLE; + /** + * How often in minutes the managers should save their factories to file (Default 15) + */ + public static int SAVE_CYCLE; + /** + * Number of days after a factory falls into disrepair until it is removed (Default 14) + */ + public static long DISREPAIR_PERIOD; + /** + * Number of days for a factory to fully degrade from 100% to 0% health (Default 28) + */ + public static long REPAIR_PERIOD; + /** + * Factory center block material (Default WORKBENCH) + */ + public static Material CENTRAL_BLOCK_MATERIAL; + /** + * The item used to interact with factoies (Default STICK) + */ + public static Material FACTORY_INTERACTION_MATERIAL; + /** + * Whether the build materials are returned upon destruction of a factory (Default false) + */ + public static boolean RETURN_BUILD_MATERIALS; + /** + * Whether Citadel is enabled (Default true) + */ + public static boolean CITADEL_ENABLED; + /** + * Whether factories are permanently removed upon the destruction of their blocks (Default false) + */ + public static boolean DESTRUCTIBLE_FACTORIES; + /** + * Whether XP orb drops are disabled (Default false) + */ + public static boolean DISABLE_EXPERIENCE; + /** + * Whether factories are triggered by redstone signals (Default true) + */ + public static boolean REDSTONE_START_ENABLED; + /** + * Whether factory running state is output to a lever (Default true) + */ + public static boolean LEVER_OUTPUT_ENABLED; + + /* Nether Properties */ + + /** + * The name of the overworld dimension (Default world) + */ + public static String WORLD_NAME; + /** + * The name of the nether dimension (Default world_nether) + */ + public static String NETHER_NAME; + /** + * Overworld to nether distance ratio (Default 8) + */ + public static int NETHER_SCALE; + /** + * Disable vanilla nether portal operation (Default true) + */ + public static boolean DISABLE_PORTALS; + /** + * The material of the nether factory teleport platform (Default OBSIDIAN) + */ + public static Material NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL; + /** + * Allow reinforcement above nether factory teleport platforms (Default false) + */ + public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; + /** + * Allow placing of blocks above nether factory teleport platform (Default false) + */ + public static boolean ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM; + /** + * Whether teleport platforms are unbreakable (Default false) + */ + public static boolean TELEPORT_PLATFORM_INVUNERABLE; + /** + * Whether the teleport platform is generated when a player is about to teleport (Default false) + */ + public static boolean REGENERATE_TELEPORT_BLOCK_ON_TELEPORT; + /** + * Whether the blocks above a portal are destroyed, ignoring Citadel, when a player is about to teleport (Default false) + */ + public static boolean REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT; + /** + * The material of the nether factory marker block (Default COAL_BLOCK) + */ + public static Material NETHER_FACTORY_MARKER_MATERIAL; + /** + * Maximum distance between nether factory and marker (Default 64) + */ + public static int NETHER_MARKER_MAX_DISTANCE; + + public static Map productionProperties; + public static Map productionRecipes; + + public FactoryManagerService manager; + public PrintingPressProperties printingPressProperties; + public NetherFactoryProperties netherFactoryProperties; + + public void onEnable() + { + plugin = this; + //load the config.yml + initConfig(); + //create the main manager + manager = new FactoryManagerService(this); + //register the events(this should be moved...) + registerEvents(); + } + + public void onDisable() + { + //call the disable method, this will save the data etc. + manager.onDisable(); + } + + public void registerEvents() + { + try + { + getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); + getServer().getPluginManager().registerEvents(new RedstoneListener(manager, (ProductionFactoryManager) manager.getManager(ProductionFactory.class)), this); + getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + public void initConfig() + { + sendConsoleMessage("Initializing FactoryMod Config."); + + productionProperties = Maps.newHashMap(); + productionRecipes = Maps.newHashMap(); + + FileConfiguration config = getConfig(); + if(getConfig().getDefaults().getBoolean("copy_defaults", true)) + { + saveResource(CONFIG_FILE, true); + } + this.saveDefaultConfig(); + reloadConfig(); + config = getConfig(); + + NETHER_SCALE = config.getInt("nether_general.nether_scale", 8); + DISABLE_PORTALS = config.getBoolean("nether_general.disable_portals", true); + ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_reinforcement_creation_above_teleport_platform", false); + ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_block_placement_above_teleport_platform", false); + TELEPORT_PLATFORM_INVUNERABLE = config.getBoolean("nether_general.teleport_platform_invunerable", false); + REGENERATE_TELEPORT_BLOCK_ON_TELEPORT = config.getBoolean("nether_general.regenerate_teleport_block_on_teleport", false); + REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT = config.getBoolean("nether_general.remove_blocks_above_teleport_platform_on_teleport", false); + WORLD_NAME = config.getString("nether_general.world_name", "world"); + NETHER_NAME = config.getString("nether_general.nether_name", "world_nether"); + SAVE_CYCLE = config.getInt("general.save_cycle", 15) * TICKS_PER_MIN; + CENTRAL_BLOCK_MATERIAL = Material.getMaterial(config.getString("general.central_block", Material.WORKBENCH.name())); + NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL = Material.getMaterial(config.getString("nether_general.teleport_platform_material_nether_factory", Material.OBSIDIAN.name())); + NETHER_FACTORY_MARKER_MATERIAL = Material.getMaterial(config.getString("nether_general.marker_material_nether_factory", Material.COAL_BLOCK.name())); + NETHER_MARKER_MAX_DISTANCE = config.getInt("nether_general.marker_max_distance", 64); + RETURN_BUILD_MATERIALS = config.getBoolean("general.return_build_materials", false); + CITADEL_ENABLED = config.getBoolean("general.citadel_enabled", true); + FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material", Material.STICK.name())); + DESTRUCTIBLE_FACTORIES = config.getBoolean("general.destructible_factories", false); + DISABLE_EXPERIENCE = config.getBoolean("general.disable_experience", false); + PRODUCER_UPDATE_CYCLE = config.getInt("production_general.update_cycle", 20); + DISREPAIR_PERIOD = config.getLong("general.disrepair_period", 14) * MILLIS_PER_DAY; + REPAIR_PERIOD = config.getLong("production_general.repair_period", 28) * MILLIS_PER_DAY; + LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled", true); + REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled", true); + + List disabledRecipes = config.getStringList("crafting.disable"); + for (String disable : disabledRecipes) + { + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disable)); + List tempList = getServer().getRecipesFor(recipeItemStack); + for (Recipe rec : tempList) + { + removeRecipe(rec); + } + } + + //Enable the following recipes + ConfigurationSection configCraftingEnable = config.getConfigurationSection("crafting.enable"); + for (String recipeName : configCraftingEnable.getKeys(false)) + { + ConfigurationSection configSection=configCraftingEnable.getConfigurationSection(recipeName); + Recipe recipe; + List shape = configSection.getStringList("shape"); + NamedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); + + if(shape.isEmpty()) + { + ShapelessRecipe shapelessRecipe = new ShapelessRecipe(output); + + for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) + { + shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); + } + + recipe = shapelessRecipe; + } + else + { + ShapedRecipe shapedRecipe = new ShapedRecipe(output); + shapedRecipe.shape(shape.toArray(new String[shape.size()])); + + for(String inputKey : configSection.getConfigurationSection("inputs").getKeys(false)) + { + ItemStack input = getItems(configSection.getConfigurationSection("inputs." + inputKey)).get(0); + shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); + } + + recipe = shapedRecipe; + } + Bukkit.addRecipe(recipe); + } + + //Import recipes from config.yml + ConfigurationSection configProdRecipes = config.getConfigurationSection("production_recipes"); + //Temporary Storage array to store where recipes should point to each other + Map> outputRecipes = Maps.newHashMap(); + + for (String title : configProdRecipes.getKeys(false)) + { + //Section header in recipe file, also serves as unique identifier for the recipe + //All spaces are replaced with udnerscores so they don't disrupt saving format + //There should be a check for uniqueness of this identifier... + ConfigurationSection configSection = configProdRecipes.getConfigurationSection(title); + title = title.replaceAll(" ", "_"); + //Display name of the recipe, Deafult of "Default Name" + String recipeName = configSection.getString("name", "Default Name"); + //Production time of the recipe, default of 1 + //TODO: fix config according to default 1 + int productionTime = configSection.getInt("production_time", 2); + //Inputs of the recipe, empty of there are no inputs + ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); + //Inputs of the recipe, empty of there are no inputs + ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); + //Outputs of the recipe, empty of there are no inputs + ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); + //Enchantments of the recipe, empty of there are no inputs + List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); + //Whether this recipe can only be used once + boolean useOnce = configSection.getBoolean("use_once"); + ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantments, useOnce, new ItemList()); + productionRecipes.put(title, recipe); + //Store the titles of the recipes that this should point to + List currentOutputRecipes = Lists.newArrayList(); + currentOutputRecipes.addAll(configSection.getStringList("output_recipes")); + outputRecipes.put(recipe, currentOutputRecipes); + } + + //Once ProductionRecipe objects have been created correctly insert different pointers + for (ProductionRecipe recipe : outputRecipes.keySet()) + { + for( String output : outputRecipes.get(recipe)) + { + recipe.addOutputRecipe(productionRecipes.get(output)); + } + } + + + //Import factories from config.yml + ConfigurationSection configProdFactories = config.getConfigurationSection("production_factories"); + for (String title : configProdFactories.getKeys(false)) + { + ConfigurationSection configSection = configProdFactories.getConfigurationSection(title); + title = title.replaceAll(" ", "_"); + String factoryName = configSection.getString("name", "Default Name"); + //Uses overpowered getItems method for consistency, should always return a list of size=1 + //If no fuel is found, default to charcoal + ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); + if(fuel.isEmpty()) + { + fuel = new ItemList(); + fuel.add(DEFAULT_FUEL); + } + //TODO: default fuel time should be 1 + int fuelTime = configSection.getInt("fuel_time", 2); + ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); + ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); + + List factoryRecipes = Lists.newArrayList(); + for (String recipe : configSection.getStringList("recipes")) + { + factoryRecipes.add(productionRecipes.get(recipe)); + } + + int repair = configSection.getInt("repair_multiple",0); + //Create repair recipe + productionRecipes.put(title + "REPAIR", new ProductionRecipe(title + "REPAIR", "Repair Factory", 1, repairs)); + factoryRecipes.add(productionRecipes.get(title + "REPAIR")); + ProductionProperties productionProperty = new ProductionProperties(inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); + productionProperties.put(title, productionProperty); + } + + ConfigurationSection configPrintingPresses = config.getConfigurationSection("printing_presses"); + ConfigurationSection configNetherFactory = config.getConfigurationSection("nether_factory"); + printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); + netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); + sendConsoleMessage("Finished initializing FactoryMod Config."); + } + + private List getEnchantments(ConfigurationSection configEnchantments) + { + List enchantments = Lists.newArrayList(); + if(configEnchantments != null) + { + for (String name : configEnchantments.getKeys(false)) + { + ConfigurationSection configEnchantment = configEnchantments.getConfigurationSection(name); + String type = configEnchantment.getString("type"); + if (type != null) + { + int level = configEnchantment.getInt("level", 1); + double probability = configEnchantment.getDouble("probability", 1.0); + ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment(name, type, level, probability); + enchantments.add(enchantment); + } + } + } + return enchantments; + } + + private List getPotionEffects(ConfigurationSection configurationSection) { + List potionEffects = Lists.newArrayList(); + if(configurationSection != null) + { + for (String name : configurationSection.getKeys(false)) + { + ConfigurationSection configEffect = configurationSection.getConfigurationSection(name); + String type = configEffect.getString("type"); + if (type != null) + { + PotionEffectType effect = PotionEffectType.getByName(type); + if (effect != null) { + int duration = configEffect.getInt("duration", 200); + int amplifier = configEffect.getInt("amplifier", 0); + potionEffects.add(new PotionEffect(effect, duration, amplifier)); + } + } + } + } + return potionEffects; + } + + public ItemList getItems(ConfigurationSection configItems) + { + ItemList items = new ItemList(); + if(configItems != null) + { + for(String commonName : configItems.getKeys(false)) + { + + ConfigurationSection configItem = configItems.getConfigurationSection(commonName); + String materialName = configItem.getString("material"); + Material material = Material.getMaterial(materialName); + //only proceeds if an acceptable material name was provided + if (material == null) + { + getLogger().severe(configItems.getCurrentPath() + " requires invalid material " + materialName); + } + else + { + int amount = configItem.getInt("amount", 1); + short durability = (short)configItem.getInt("durability", 0); + int repairCost = (short)configItem.getInt("repair_cost", 0); + String displayName = configItem.getString("display_name"); + String lore = configItem.getString("lore"); + List compulsoryEnchantments = getEnchantments(configItem.getConfigurationSection("enchantments")); + List storedEnchantments = getEnchantments(configItem.getConfigurationSection("stored_enchantments")); + List potionEffects = getPotionEffects(configItem.getConfigurationSection("potion_effects")); + items.add(createItemStack(material, amount, durability, displayName, lore, commonName, repairCost, compulsoryEnchantments, storedEnchantments, potionEffects)); + } + } + } + + return items; + } + + private NamedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, + List compulsoryEnchants, List storedEnchants, List potionEffects) + { + NamedItemStack namedItemStack= new NamedItemStack(material, stackSize, durability,commonName); + if(name != null || loreString != null || compulsoryEnchants.size() > 0 || storedEnchants.size() > 0 || potionEffects.size() > 0 || repairCost > 0) + { + ItemMeta meta = namedItemStack.getItemMeta(); + + if (name != null) { + meta.setDisplayName(name); + } + + if (meta instanceof Repairable && repairCost > 0) { + ((Repairable) meta).setRepairCost(repairCost); + } + + if (loreString!=null) { + List lore = Lists.newArrayList(); + lore.add(loreString); + meta.setLore(lore); + } + + for (ProbabilisticEnchantment enchant : compulsoryEnchants) { + meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), false); + } + + if (meta instanceof EnchantmentStorageMeta) { + EnchantmentStorageMeta esm = (EnchantmentStorageMeta) meta; + for (ProbabilisticEnchantment enchant : storedEnchants) { + esm.addStoredEnchant(enchant.getEnchantment(), enchant.getLevel(), false); + } + } + + if (meta instanceof PotionMeta) { + PotionMeta pm = (PotionMeta) meta; + for (PotionEffect effect : potionEffects) { + pm.addCustomEffect(effect, true); + } + } + + namedItemStack.setItemMeta(meta); + } + + return namedItemStack; + } + + private void removeRecipe(Recipe removalRecipe) + { + Iterator it = getServer().recipeIterator(); + while (it.hasNext()) + { + Recipe recipe = it.next(); + if (recipe.getResult().getType() == removalRecipe.getResult().getType()) + { + it.remove(); + } + } + } + + public static IFactoryProperties getProperties(FactoryType factoryType, String subFactoryType) + { + switch(factoryType) + { + case PRODUCTION: + return FactoryModPlugin.productionProperties.get(subFactoryType); + default: + return null; + } + } + + public static int getMaxTiers(FactoryType factoryType) + { + // TODO Auto-generated method stub + return 0; + } + + public static void sendConsoleMessage(String message) + { + Bukkit.getLogger().info(FactoryModPlugin.PLUGIN_PREFIX + message); + } + + public static void logFileError(String fileName, int lineNum, String error) { + sendConsoleMessage(new StringBuilder("ERROR at line ") + .append(lineNum).append(" of ").append(fileName).append(": ").append(error).toString()); + } + + public PrintingPressProperties getPrintingPressProperties() { + return printingPressProperties; + } + + public NetherFactoryProperties getNetherFactoryProperties() { + return netherFactoryProperties; + } + + private static FactoryModPlugin plugin; + public static FactoryModPlugin getPlugin(){ + return plugin; + } +} diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java index 30b72d21..79c4d377 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ b/src/com/github/igotyou/FactoryMod/FactoryObject.java @@ -1,213 +1,213 @@ -package com.github.igotyou.FactoryMod; - - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Chest; -import org.bukkit.block.Furnace; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.interfaces.Properties; - -import java.util.Date; - -//original file: -/** - * MachineObject.java - * Purpose: Basic object base for machines to extend - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited version: -/** - * FactoryObject.java - * Purpose basic object base for factories to extend - * @author igotyou - * - */ -public class FactoryObject -{ - //the diffrent factory types, NOTE: these are not the sub-factory types, these are the main types. - public enum FactoryType - { - PRODUCTION, - PRINTING_PRESS, - NETHER_FACTORY - } - - - protected Location factoryLocation; // Current location of factory center - protected Location factoryInventoryLocation; //Current location of factory inventory(normmaly a chest) - protected Location factoryPowerSourceLocation;//Current location of factory power source(normmaly a furnace) - protected boolean active; // Whether factory is currently active - protected Inventory factoryInventory; // The inventory of the factory - protected Inventory factoryPowerInventory;//The inventory of the power source. - protected FactoryType factoryType; // The type this factory is - protected String subFactoryType;//the SUBfactory type(the ones loaded from the config file) - protected Properties factoryProperties; // The properties of this factory type and tier - protected boolean upgraded; // Whether the tier has recently upgraded - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - FactoryType factoryType, String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = false; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.upgraded = false; - if (this.isWhole(true)) - { - initializeInventory(); - } - updateProperties(); - } - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, FactoryType factoryType, String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = active; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.upgraded = false; - if (this.isWhole(true)) - { - initializeInventory(); - } - updateProperties(); - } - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, int tierLevel, FactoryType factoryType, Inventory factoryInventory, - String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = active; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.factoryInventory = factoryInventory; - updateProperties(); - } - - /** - * Initializes the inventory for this factory - */ - //Due to non-destructable factories this will not have been called on reconstructed factories - //however I am unable to find a use for this method in the current code, so it doesn't - //seem to be an issue right now, maybe the calls in the constructor should be gotten rid of - //all methods that get the inventory reinitialize the contents. - public void initializeInventory() - { - switch(factoryType) - { - case PRODUCTION: - Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); - factoryInventory = chestBlock.getInventory(); - Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); - factoryPowerInventory = furnaceBlock.getInventory(); - break; - default: - break; - } - } - - /** - * Updates the current properties for the factory. - */ - public void updateProperties() - { - factoryProperties = FactoryModPlugin.getProperties(factoryType, subFactoryType); - } - - /** - * Returns the user-friendly name for this factory type - */ - public String factoryName() - { - switch (factoryType) - { - case PRODUCTION: - return "Production"; - default: - return null; - } - } - - /** - * returns the factory Inventory(normally a chest), updates the inventory variable aswell. - */ - public Inventory getInventory() - { - Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); - factoryInventory = chestBlock.getInventory(); - return factoryInventory; - } - - /** - * Returns the power Source inventory, updates it aswell. - */ - public Inventory getPowerSourceInventory() - { - if (!(factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation.getBlock().getType() == Material.BURNING_FURNACE)) - { - return null; - } - Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); - factoryPowerInventory = furnaceBlock.getInventory(); - return factoryPowerInventory; - } - - /** - * Returns the sub-factory type of the factory. - */ - public String getSubFactoryType() - { - return subFactoryType; - } - - - /** - * returns if the factory is on or not. - */ - public boolean getActive() - { - return active; - } - - /** - * returns true if all factory blocks are occupied with the correct blocks - */ - public boolean isWhole(boolean initCall) - { - //Check if power source exists - if(factoryPowerSourceLocation.getBlock().getType().getId()== 61 || factoryPowerSourceLocation.getBlock().getType().getId()== 62) - { - //Check inventory location - if(factoryInventoryLocation.getBlock().getType().getId()== 54) - { - //Check Interaction block location - if(factoryLocation.getBlock().getType().getId()==FactoryModPlugin.CENTRAL_BLOCK_MATERIAL.getId()) - { - return true; - } - } - } - return false; - } -} +package com.github.igotyou.FactoryMod; + + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Chest; +import org.bukkit.block.Furnace; +import org.bukkit.inventory.Inventory; + +import com.github.igotyou.FactoryMod.properties.IFactoryProperties; + +import java.util.Date; + +//original file: +/** + * MachineObject.java + * Purpose: Basic object base for machines to extend + * + * @author MrTwiggy + * @version 0.1 1/14/13 + */ +//edited version: +/** + * FactoryObject.java + * Purpose basic object base for factories to extend + * @author igotyou + * + */ +public class FactoryObject +{ + //the diffrent factory types, NOTE: these are not the sub-factory types, these are the main types. + public enum FactoryType + { + PRODUCTION, + PRINTING_PRESS, + NETHER_FACTORY + } + + + protected Location factoryLocation; // Current location of factory center + protected Location factoryInventoryLocation; //Current location of factory inventory(normmaly a chest) + protected Location factoryPowerSourceLocation;//Current location of factory power source(normmaly a furnace) + protected boolean active; // Whether factory is currently active + protected Inventory factoryInventory; // The inventory of the factory + protected Inventory factoryPowerInventory;//The inventory of the power source. + protected FactoryType factoryType; // The type this factory is + protected String subFactoryType;//the SUBfactory type(the ones loaded from the config file) + protected IFactoryProperties factoryProperties; // The properties of this factory type and tier + protected boolean upgraded; // Whether the tier has recently upgraded + + /** + * Constructor + */ + public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, + FactoryType factoryType, String subFactoryType) + { + this.factoryLocation = factoryLocation; + this.factoryInventoryLocation = factoryInventoryLocation; + this.factoryPowerSourceLocation = factoryPowerSource; + this.active = false; + this.factoryType = factoryType; + this.subFactoryType = subFactoryType; + this.upgraded = false; + if (this.isWhole(true)) + { + initializeInventory(); + } + updateProperties(); + } + + /** + * Constructor + */ + public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, FactoryType factoryType, String subFactoryType) + { + this.factoryLocation = factoryLocation; + this.factoryInventoryLocation = factoryInventoryLocation; + this.factoryPowerSourceLocation = factoryPowerSource; + this.active = active; + this.factoryType = factoryType; + this.subFactoryType = subFactoryType; + this.upgraded = false; + if (this.isWhole(true)) + { + initializeInventory(); + } + updateProperties(); + } + + /** + * Constructor + */ + public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, + boolean active, int tierLevel, FactoryType factoryType, Inventory factoryInventory, + String subFactoryType) + { + this.factoryLocation = factoryLocation; + this.factoryInventoryLocation = factoryInventoryLocation; + this.factoryPowerSourceLocation = factoryPowerSource; + this.active = active; + this.factoryType = factoryType; + this.subFactoryType = subFactoryType; + this.factoryInventory = factoryInventory; + updateProperties(); + } + + /** + * Initializes the inventory for this factory + */ + //Due to non-destructable factories this will not have been called on reconstructed factories + //however I am unable to find a use for this method in the current code, so it doesn't + //seem to be an issue right now, maybe the calls in the constructor should be gotten rid of + //all methods that get the inventory reinitialize the contents. + public void initializeInventory() + { + switch(factoryType) + { + case PRODUCTION: + Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); + factoryInventory = chestBlock.getInventory(); + Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); + factoryPowerInventory = furnaceBlock.getInventory(); + break; + default: + break; + } + } + + /** + * Updates the current properties for the factory. + */ + public void updateProperties() + { + factoryProperties = FactoryModPlugin.getProperties(factoryType, subFactoryType); + } + + /** + * Returns the user-friendly name for this factory type + */ + public String factoryName() + { + switch (factoryType) + { + case PRODUCTION: + return "Production"; + default: + return null; + } + } + + /** + * returns the factory Inventory(normally a chest), updates the inventory variable aswell. + */ + public Inventory getInventory() + { + Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); + factoryInventory = chestBlock.getInventory(); + return factoryInventory; + } + + /** + * Returns the power Source inventory, updates it aswell. + */ + public Inventory getPowerSourceInventory() + { + if (!(factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation.getBlock().getType() == Material.BURNING_FURNACE)) + { + return null; + } + Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); + factoryPowerInventory = furnaceBlock.getInventory(); + return factoryPowerInventory; + } + + /** + * Returns the sub-factory type of the factory. + */ + public String getSubFactoryType() + { + return subFactoryType; + } + + + /** + * returns if the factory is on or not. + */ + public boolean getActive() + { + return active; + } + + /** + * returns true if all factory blocks are occupied with the correct blocks + */ + public boolean isWhole(boolean initCall) + { + //Check if power source exists + if(factoryPowerSourceLocation.getBlock().getType().getId()== 61 || factoryPowerSourceLocation.getBlock().getType().getId()== 62) + { + //Check inventory location + if(factoryInventoryLocation.getBlock().getType().getId()== 54) + { + //Check Interaction block location + if(factoryLocation.getBlock().getType().getId()==FactoryModPlugin.CENTRAL_BLOCK_MATERIAL.getId()) + { + return true; + } + } + } + return false; + } +} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java similarity index 97% rename from src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java rename to src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index a224bbbe..a2dbd4ad 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.List; - import java.util.logging.Logger; import java.util.logging.Level; @@ -21,7 +20,6 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.FactoryObject; -import com.github.igotyou.FactoryMod.interfaces.Factory; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.ItemList; @@ -29,7 +27,7 @@ import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -public abstract class BaseFactory extends FactoryObject implements Factory { +public abstract class ABaseFactory extends FactoryObject implements IFactory { public static final BlockFace[] REDSTONE_FACES = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN}; protected int currentProductionTimer = 0;//The "production timer", which trachs for how long the factory has been producing the selected recipe @@ -37,9 +35,9 @@ public abstract class BaseFactory extends FactoryObject implements Factory { protected double currentRepair; protected long timeDisrepair;//The time at which the factory went into disrepair - private Logger log = Logger.getLogger(BaseFactory.class.getName()); + private Logger log = Logger.getLogger(ABaseFactory.class.getName()); - public BaseFactory(Location factoryLocation, + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, FactoryType factoryType, String subFactoryType) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, @@ -48,7 +46,7 @@ public BaseFactory(Location factoryLocation, this.timeDisrepair=3155692597470L; } - public BaseFactory(Location factoryLocation, + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, int tierLevel, FactoryType factoryType, Inventory factoryInventory, String subFactoryType) { @@ -58,7 +56,7 @@ public BaseFactory(Location factoryLocation, this.timeDisrepair=3155692597470L; } - public BaseFactory(Location factoryLocation, + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, FactoryType factoryType, String subFactoryType) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, @@ -67,7 +65,7 @@ public BaseFactory(Location factoryLocation, this.timeDisrepair=3155692597470L;//Year 2070, default starting value } - public BaseFactory(Location factoryLocation, + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, FactoryType factoryType, boolean active, String subFactoryType, int currentProductionTimer, int currentEnergyTimer, diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Factory.java b/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java similarity index 73% rename from src/com/github/igotyou/FactoryMod/interfaces/Factory.java rename to src/com/github/igotyou/FactoryMod/Factorys/IFactory.java index cdaadbee..abbb0ffb 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Factory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java @@ -1,55 +1,66 @@ -package com.github.igotyou.FactoryMod.interfaces; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import java.util.List; -//original file: -/** - * Machine.java - * Purpose: An interface for machines to implement with basic functionality - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited version: -/** -* Factory.java -* Purpose: An interface for factorys to implement with basic functionality -* @author igotyou -*/ -public interface Factory -{ - /** - * Updates the machine - */ - public void update(); - - public void destroy(Location destroyLocation); - - /** - * Powers on the machine - */ - public void powerOn(); - - /** - * Powers off the machine - */ - public void powerOff(); - - /** - * Toggles the current power state and returns interaction response - */ - public List togglePower(); - public List getChestResponse(); - public List getCentralBlockResponse(); - - /** - * Returns the location of the machine - */ - public Location getCenterLocation(); - - public Location getInventoryLocation(); - - public Location getPowerSourceLocation(); +package com.github.igotyou.FactoryMod.Factorys; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.properties.AFactoryProperties; +import com.github.igotyou.FactoryMod.properties.IFactoryProperties; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; + +import java.util.List; +//original file: +/** + * Machine.java + * Purpose: An interface for machines to implement with basic functionality + * + * @author MrTwiggy + * @version 0.1 1/14/13 + */ +//edited version: +/** +* Factory.java +* Purpose: An interface for factorys to implement with basic functionality +* @author igotyou +*/ +public interface IFactory +{ + /** + * Updates the machine + */ + public void update(); + + public void destroy(Location destroyLocation); + + /** + * Powers on the machine + */ + public void powerOn(); + + /** + * Powers off the machine + */ + public void powerOff(); + + /** + * Toggles the current power state and returns interaction response + */ + public List togglePower(); + public List getChestResponse(); + public List getCentralBlockResponse(); + + /** + * Returns the location of the machine + */ + public Location getCenterLocation(); + + public Location getInventoryLocation(); + + public Location getPowerSourceLocation(); + + public void updateRepair(double percent); + + public long getTimeDisrepair(); + + public IFactoryProperties getProperties(); + + public boolean isWhole(boolean initCall); } \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 463dc541..7c355a42 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -22,7 +22,7 @@ import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -public class NetherFactory extends BaseFactory +public class NetherFactory extends ABaseFactory { private ReinforcementManager rm = Citadel.getReinforcementManager(); diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index ebc8dcd6..84e3087b 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -23,7 +23,7 @@ import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; -public class PrintingPress extends BaseFactory { +public class PrintingPress extends ABaseFactory { private PrintingPressProperties printingPressProperties; diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java index 340e4af3..aaf2325d 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java @@ -1,301 +1,307 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.block.Furnace; -import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.Attachable; -import org.bukkit.material.Lever; -import org.bukkit.material.MaterialData; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.FactoryObject; -import com.github.igotyou.FactoryMod.interfaces.Factory; -import com.github.igotyou.FactoryMod.interfaces.Recipe; -import com.github.igotyou.FactoryMod.listeners.RedstoneListener; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -public class ProductionFactory extends BaseFactory -{ - - private ProductionRecipe currentRecipe = null;//the recipe that is currently selected - private ProductionProperties productionFactoryProperties;//the properties of the production factory - public static final FactoryType FACTORY_TYPE = FactoryType.PRODUCTION;//the factory's type - private List recipes; - private int currentRecipeNumber = 0;//the array index of the current recipe - - /** - * Constructor - */ - public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource - , String subFactoryType) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, subFactoryType); - this.productionFactoryProperties = (ProductionProperties) factoryProperties; - this.recipes=new ArrayList (productionFactoryProperties.getRecipes()); - this.setRecipeToNumber(0); - } - - /** - * Constructor - */ - public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - String subFactoryType, boolean active, int currentProductionTimer, int currentEnergyTimer, List recipes, - int currentRecipeNumber,double currentMaintenance,long timeDisrepair) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, active, subFactoryType, currentProductionTimer, currentEnergyTimer, currentMaintenance, timeDisrepair); - this.productionFactoryProperties = (ProductionProperties) factoryProperties; - this.recipes=recipes; - this.setRecipeToNumber(currentRecipeNumber); - } - - @Override - public boolean checkHasMaterials() { - return currentRecipe.hasMaterials(getInventory()); - } - - @Override - public boolean isRepairing() { - return currentRecipe.getRepairs().size()!=0; - } - - - /** - * Returns either a success or error message. - * Called by the blockListener when a player left clicks the center block, with the InteractionMaterial - */ - @Override - public List getCentralBlockResponse() - { - List responses=new ArrayList(); - //Is the factory off - if (!active) - { - //is the recipe is initiaed - if (currentRecipe != null) - { - //if we are at the end of the recipe array loop around - if (currentRecipeNumber == recipes.size() - 1) - { - setRecipeToNumber(0); - currentProductionTimer = 0; - } - //if we can just increment the recipe - else - { - setRecipeToNumber(currentRecipeNumber + 1); - currentProductionTimer = 0; - } - } - //if the recipe for some reason is not initialised, initialise it to recipe 0 - else - { - setRecipeToNumber(0); - currentProductionTimer = 0; - } - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to: " + currentRecipe.getRecipeName()+".")); - if(currentRecipeNumber != recipes.size() - 1) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(currentRecipeNumber+1).getRecipeName()+".")); - } - else - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(0).getRecipeName()+".")); - } - } - //if the factory is on, return error message - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); - } - return responses; - } - - @Override - public ItemList getFuel() { - return productionFactoryProperties.getFuel(); - } - - /** - * Sets the factories current recipe. - * @param newRecipe the desired recipe - */ - public void setRecipe(Recipe newRecipe) - { - if (newRecipe instanceof ProductionRecipe) - { - currentRecipe = (ProductionRecipe) newRecipe; - } - } - - /** - * sets the recipe to the supplied index - * @param newRecipeNumber the desired recipeArray index - */ - public void setRecipeToNumber(int newRecipeNumber) - { - if (newRecipeNumber getRecipes() - { - return recipes; - } - - @Override - public List getChestResponse() - { - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/currentRecipe.getProductionTime())+"% done." : ""; - //Name: Status with XX% health. - int health =(getProductionFactoryProperties().getRepair()==0) ? 100 : (int) Math.round(100*(1-currentRepair/(getProductionFactoryProperties().getRepair()))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, getProductionFactoryProperties().getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - //RecipeName: X seconds(Y ticks)[ - XX% done.] - responses.add(new InteractionResponse(InteractionResult.SUCCESS, currentRecipe.getRecipeName()+": "+currentRecipe.getProductionTime() + " seconds("+ currentRecipe.getProductionTime()*FactoryModPlugin.TICKS_PER_SECOND + " ticks)"+percentDone)); - //[Inputs: amount Name, amount Name.] - if(!currentRecipe.getInputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+currentRecipe.getInputs().toString()+".")); - } - //[Upgrades: amount Name, amount Name.] - if(!currentRecipe.getUpgrades().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Upgrades: "+currentRecipe.getUpgrades().toString()+".")); - } - //[Outputs: amount Name, amount Name.] - if(!getOutputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs().toString()+".")); - } - //[Will repair XX% of the factory] - if(!currentRecipe.getRepairs().isEmpty()&&getProductionFactoryProperties().getRepair()!=0) - { - int amountAvailable=currentRecipe.getRepairs().amountAvailable(getPowerSourceInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/getProductionFactoryProperties().getRepair()*100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+currentRecipe.getRepairs().getMultiple(amountRepaired).toString()+".")); - } - if(getProductionFactoryProperties().getRepair()!=0) - if(!currentRecipe.getOutputRecipes().isEmpty()) - { - List outputRecipes=currentRecipe.getOutputRecipes(); - String response="Makes available: "; - for(int i=0;i getInputs() { - return currentRecipe.getInputs(); - } - - @Override - public ItemList getOutputs() { - return currentRecipe.getOutputs(); - } - - @Override - public ItemList getRepairs() { - return currentRecipe.getRepairs(); - } - - @Override - public List getEnchantments() { - return currentRecipe.getEnchantments(); - } - - @Override - public double getEnergyTime() { - return productionFactoryProperties.getEnergyTime(); - } - - @Override - public double getProductionTime() { - return currentRecipe.getProductionTime(); - } - - @Override - public int getMaxRepair() { - return productionFactoryProperties.getRepair(); - } -} +package com.github.igotyou.FactoryMod.Factorys; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.BlockState; +import org.bukkit.block.Furnace; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.material.Attachable; +import org.bukkit.material.Lever; +import org.bukkit.material.MaterialData; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.FactoryObject; +import com.github.igotyou.FactoryMod.listeners.RedstoneListener; +import com.github.igotyou.FactoryMod.properties.IFactoryProperties; +import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +public class ProductionFactory extends ABaseFactory +{ + + private ProductionRecipe currentRecipe = null;//the recipe that is currently selected + private ProductionProperties productionFactoryProperties;//the properties of the production factory + public static final FactoryType FACTORY_TYPE = FactoryType.PRODUCTION;//the factory's type + private List recipes; + private int currentRecipeNumber = 0;//the array index of the current recipe + + /** + * Constructor + */ + public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource + , String subFactoryType) + { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, subFactoryType); + this.productionFactoryProperties = (ProductionProperties) factoryProperties; + this.recipes=new ArrayList (productionFactoryProperties.getRecipes()); + this.setRecipeToNumber(0); + } + + /** + * Constructor + */ + public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, + String subFactoryType, boolean active, int currentProductionTimer, int currentEnergyTimer, List recipes, + int currentRecipeNumber,double currentMaintenance,long timeDisrepair) + { + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, active, subFactoryType, currentProductionTimer, currentEnergyTimer, currentMaintenance, timeDisrepair); + this.productionFactoryProperties = (ProductionProperties) factoryProperties; + this.recipes=recipes; + this.setRecipeToNumber(currentRecipeNumber); + } + + @Override + public boolean checkHasMaterials() { + return currentRecipe.hasMaterials(getInventory()); + } + + @Override + public boolean isRepairing() { + return currentRecipe.getRepairs().size()!=0; + } + + + /** + * Returns either a success or error message. + * Called by the blockListener when a player left clicks the center block, with the InteractionMaterial + */ + @Override + public List getCentralBlockResponse() + { + List responses=new ArrayList(); + //Is the factory off + if (!active) + { + //is the recipe is initiaed + if (currentRecipe != null) + { + //if we are at the end of the recipe array loop around + if (currentRecipeNumber == recipes.size() - 1) + { + setRecipeToNumber(0); + currentProductionTimer = 0; + } + //if we can just increment the recipe + else + { + setRecipeToNumber(currentRecipeNumber + 1); + currentProductionTimer = 0; + } + } + //if the recipe for some reason is not initialised, initialise it to recipe 0 + else + { + setRecipeToNumber(0); + currentProductionTimer = 0; + } + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to: " + currentRecipe.getRecipeName()+".")); + if(currentRecipeNumber != recipes.size() - 1) + { + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(currentRecipeNumber+1).getRecipeName()+".")); + } + else + { + responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(0).getRecipeName()+".")); + } + } + //if the factory is on, return error message + else + { + responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); + } + return responses; + } + + @Override + public ItemList getFuel() { + return productionFactoryProperties.getFuel(); + } + + /** + * Sets the factories current recipe. + * @param newRecipe the desired recipe + */ + public void setRecipe(IRecipe newRecipe) + { + if (newRecipe instanceof ProductionRecipe) + { + currentRecipe = (ProductionRecipe) newRecipe; + } + } + + /** + * sets the recipe to the supplied index + * @param newRecipeNumber the desired recipeArray index + */ + public void setRecipeToNumber(int newRecipeNumber) + { + if (newRecipeNumber getRecipes() + { + return recipes; + } + + @Override + public List getChestResponse() + { + List responses=new ArrayList(); + String status=active ? "On" : "Off"; + String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/currentRecipe.getProductionTime())+"% done." : ""; + //Name: Status with XX% health. + int health =(getProductionFactoryProperties().getRepair()==0) ? 100 : (int) Math.round(100*(1-currentRepair/(getProductionFactoryProperties().getRepair()))); + responses.add(new InteractionResponse(InteractionResult.SUCCESS, getProductionFactoryProperties().getName()+": "+status+" with "+String.valueOf(health)+"% health.")); + //RecipeName: X seconds(Y ticks)[ - XX% done.] + responses.add(new InteractionResponse(InteractionResult.SUCCESS, currentRecipe.getRecipeName()+": "+currentRecipe.getProductionTime() + " seconds("+ currentRecipe.getProductionTime()*FactoryModPlugin.TICKS_PER_SECOND + " ticks)"+percentDone)); + //[Inputs: amount Name, amount Name.] + if(!currentRecipe.getInputs().isEmpty()) + { + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+currentRecipe.getInputs().toString()+".")); + } + //[Upgrades: amount Name, amount Name.] + if(!currentRecipe.getUpgrades().isEmpty()) + { + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Upgrades: "+currentRecipe.getUpgrades().toString()+".")); + } + //[Outputs: amount Name, amount Name.] + if(!getOutputs().isEmpty()) + { + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs().toString()+".")); + } + //[Will repair XX% of the factory] + if(!currentRecipe.getRepairs().isEmpty()&&getProductionFactoryProperties().getRepair()!=0) + { + int amountAvailable=currentRecipe.getRepairs().amountAvailable(getPowerSourceInventory()); + int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; + int percentRepaired=(int) (( (double) amountRepaired)/getProductionFactoryProperties().getRepair()*100); + responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+currentRecipe.getRepairs().getMultiple(amountRepaired).toString()+".")); + } + if(getProductionFactoryProperties().getRepair()!=0) + if(!currentRecipe.getOutputRecipes().isEmpty()) + { + List outputRecipes=currentRecipe.getOutputRecipes(); + String response="Makes available: "; + for(int i=0;i getInputs() { + return currentRecipe.getInputs(); + } + + @Override + public ItemList getOutputs() { + return currentRecipe.getOutputs(); + } + + @Override + public ItemList getRepairs() { + return currentRecipe.getRepairs(); + } + + @Override + public List getEnchantments() { + return currentRecipe.getEnchantments(); + } + + @Override + public double getEnergyTime() { + return productionFactoryProperties.getEnergyTime(); + } + + @Override + public double getProductionTime() { + return currentRecipe.getProductionTime(); + } + + @Override + public int getMaxRepair() { + return productionFactoryProperties.getRepair(); + } + + @Override + public IFactoryProperties getProperties() { + return productionFactoryProperties; + } +} diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index aa683e9d..10a64274 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -24,22 +24,22 @@ import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.IFactory; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.interfaces.Factory; -import com.github.igotyou.FactoryMod.managers.FactoryModManager; +import com.github.igotyou.FactoryMod.managers.FactoryManagerService; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public class FactoryModListener implements Listener { - private FactoryModManager factoryMan; + private FactoryManagerService factoryMan; private ReinforcementManager rm = Citadel.getReinforcementManager(); /** * Constructor */ - public FactoryModListener(FactoryModManager factoryManager) + public FactoryModListener(FactoryManagerService factoryManager) { this.factoryMan = factoryManager; } @@ -92,11 +92,11 @@ private void destroyFactoryAt(Block block) { //Is the factory a production factory? if (factoryMan.factoryExistsAt(block.getLocation())) { - Factory factory = factoryMan.getFactory(block.getLocation()); + IFactory factory = factoryMan.getFactory(block.getLocation()); factory.destroy(block.getLocation()); if(FactoryModPlugin.DESTRUCTIBLE_FACTORIES) { - factoryMan.getManager(block.getLocation()).removeFactory(factory); + //TODO: factoryMan.getManager(block.getLocation()).removeFactory(factory); } } } @@ -185,7 +185,7 @@ public void playerInteractionEvent(PlayerInteractEvent e) //if there is a production Factory at the clicked location if (factoryMan.factoryExistsAt(clicked.getLocation())) { - Factory factory = factoryMan.getFactory(clicked.getLocation()); + IFactory factory = factoryMan.getFactory(clicked.getLocation()); //toggle the recipe, and print the returned message. InteractionResponse.messagePlayerResults(player, factory.getCentralBlockResponse()); } diff --git a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java index 4fdea5b4..aeda87ea 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java @@ -15,19 +15,19 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.managers.FactoryModManager; -import com.github.igotyou.FactoryMod.managers.ProductionManager; +import com.github.igotyou.FactoryMod.managers.FactoryManagerService; +import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; public class RedstoneListener implements Listener { - private FactoryModManager factoryMan; + private FactoryManagerService factoryMan; private ReinforcementManager rm = Citadel.getReinforcementManager(); //this is a lazy fix... - private ProductionManager productionMan; + private ProductionFactoryManager productionMan; /** * Constructor */ - public RedstoneListener(FactoryModManager factoryManager, ProductionManager productionManager) + public RedstoneListener(FactoryManagerService factoryManager, ProductionFactoryManager productionManager) { this.factoryMan = factoryManager; this.productionMan = productionManager; diff --git a/src/com/github/igotyou/FactoryMod/managers/AManager.java b/src/com/github/igotyou/FactoryMod/managers/AManager.java new file mode 100644 index 00000000..8285be75 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/managers/AManager.java @@ -0,0 +1,148 @@ +package com.github.igotyou.FactoryMod.managers; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.IFactory; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.FileBackup; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; + +public abstract class AManager implements IManager{ + + protected FactoryModPlugin plugin; + ArrayList factories = new ArrayList(); + + protected FactoryDao mDao; + protected File mSaveFile; + protected long repairTime; + protected boolean isLogging = true; + + + public String getFactoryName(){ + return getFactoryType().getName(); + //return this.getClass().getName().replace("Manager", ""); + } + + @Override + public FactoryModPlugin getPlugin() { + return plugin; + } + + + @Override + public void updateFactorys() + { + plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() + { + @Override + public void run() + { + for (T factory: factories) + { + factory.update(); + } + } + }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); + } + + public void save() + { + //Takes difference between last repair update and current one and scales repair accordingly + updateRepair(System.currentTimeMillis() - repairTime); + repairTime = System.currentTimeMillis(); + + FileBackup.backup(mSaveFile); + mDao.writeFactories(factories); + } + + public void load() + { + isLogging = false; + repairTime = System.currentTimeMillis(); + for(T press : mDao.readFactories()) { + addFactory(press); + } + isLogging = true; + } + public void updateRepair(long time) + { + for (T factory : factories) + { + factory.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); + } + long currentTime = System.currentTimeMillis(); + Iterator itr = factories.iterator(); + while(itr.hasNext()) + { + T factory = itr.next(); + if(currentTime > (factory.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) + { + FactoryModPlugin.sendConsoleMessage(new StringBuilder(getFactoryName()+" removed due to disrepair: ") + .append(factory.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(factory.getCenterLocation())) + .toString()); + + itr.remove(); + } + } + } + + @Override + public InteractionResponse addFactory(T factory) + { + if (isClear(factory)) + { + factories.add(factory); + if (isLogging) { FactoryModPlugin.sendConsoleMessage(getFactoryName()+" created: " + factory.getProperties().getName()); } + return new InteractionResponse(InteractionResult.SUCCESS, ""); + } + else + { + FactoryModPlugin.sendConsoleMessage(getFactoryName()+" failed to create: " + factory.getProperties().getName()); + return new InteractionResponse(InteractionResult.FAILURE, ""); + } + } + + @Override + public boolean factoryExistsAt(Location factoryLocation) + { + boolean returnValue = false; + if (getFactory(factoryLocation) != null) + { + returnValue = true; + } + return returnValue; + } + + @Override + public boolean factoryWholeAt(Location factoryLocation) + { + boolean returnValue = false; + if (getFactory(factoryLocation) != null) + { + returnValue = getFactory(factoryLocation).isWhole(false); + } + return returnValue; + } + @Override + public void removeFactory(T factory) + { + FactoryModPlugin.sendConsoleMessage(new StringBuilder(getFactoryName() +" removed: ") + .append(factory.getProperties().getName()) + .append(" at ") + .append(StringUtils.formatCoords(factory.getCenterLocation())) + .toString()); + + factories.remove(factory); + + } +} diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java similarity index 77% rename from src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java rename to src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java index 79489442..3dfe6a1e 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java @@ -1,196 +1,195 @@ -package com.github.igotyou.FactoryMod.managers; - -import java.io.File; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.BaseFactory; -import com.github.igotyou.FactoryMod.interfaces.Factory; -import com.github.igotyou.FactoryMod.interfaces.Manager; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.google.common.collect.Lists; -//original file: -/** - * MachinesManager.java - * Purpose: Manages the initialization and updating of all managers. - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited file: -/** - * FactorysManager.java - * Purpose: Manages the initialization and updating of all managers. - * @author igotyou - * - */ -public class FactoryModManager -{ - List> managers; - - /** - * The plugin instance - */ - FactoryModPlugin plugin; - - /** - * Constructor - */ - public FactoryModManager(FactoryModPlugin plugin) - { - FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); - - this.plugin = plugin; - managers = Lists.newArrayList(); - managers.add(new ProductionManager(plugin)); - managers.add(new PrintingPressManager(plugin)); - managers.add(new NetherFactoryManager(plugin)); - loadManagers(); - periodicSaving(); - - FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); - } - - /** - * When plugin disabled, this is called. - */ - public void onDisable() - { - saveManagers(); - } - - /** - * Saves all managers - */ - private void saveManagers() - { - for (Manager manager : managers) - { - manager.save(); - } - } - - /** - * Loads all managers - */ - private void loadManagers() - { - for (Manager manager : managers) - { - manager.load(); - } - } - - /** - * Returns the appropriate manager depending on the given Manager Type - * @param - */ - public Manager getManager(Class factoryClass) - { - for (Manager manager : managers) - { - if (manager.getFactoryType() == factoryClass) - { - return manager; - } - } - - return null; - } - - /** - * Save Factories to file every SAVE_CYCLE minutes. - */ - private void periodicSaving() - { - Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { - @Override - public void run() - { - FactoryModPlugin.sendConsoleMessage("Saving Factory data..."); - saveManagers(); - } - }, (FactoryModPlugin.SAVE_CYCLE), - FactoryModPlugin.SAVE_CYCLE); - } - - /** - * Returns the Factory Saves file - */ - public File getSavesFile(String fileName) - { - return new File(plugin.getDataFolder(), fileName + ".txt"); - } - - /** - * Returns whether a factory exists at given location in any manager - */ - public boolean factoryExistsAt(Location location) - { - for (Manager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return true; - } - } - return false; - } - - /** - * Returns whether a factory is whole at given location in any manager - */ - public boolean factoryWholeAt(Location location) - { - for (Manager manager : managers) - { - if (manager.factoryWholeAt(location)) - { - return true; - } - } - return false; - } - - public Factory getFactory(Location location) { - for (Manager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return manager.getFactory(location); - } - } - return null; - } - - public Manager getManager(Location location) { - for (Manager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return manager; - } - } - return null; - } - - public InteractionResponse createFactory(Location centralLocation, - Location inventoryLocation, Location powerLocation) { - InteractionResponse response = null; - for (Manager manager : managers) - { - response = manager.createFactory(centralLocation, inventoryLocation, powerLocation); - if (response.getInteractionResult() == InteractionResult.SUCCESS) - { - return response; - } - } - - FactoryModPlugin.sendConsoleMessage("The factory could not be created: " + response.getInteractionMessage()); - return response; - } -} +package com.github.igotyou.FactoryMod.managers; + +import java.io.File; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; +import com.github.igotyou.FactoryMod.Factorys.IFactory; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.google.common.collect.Lists; +//original file: +/** + * MachinesManager.java + * Purpose: Manages the initialization and updating of all managers. + * + * @author MrTwiggy + * @version 0.1 1/14/13 + */ +//edited file: +/** + * FactorysManager.java + * Purpose: Manages the initialization and updating of all managers. + * @author igotyou + * + */ +public class FactoryManagerService +{ + List> managers; + + /** + * The plugin instance + */ + FactoryModPlugin plugin; + + /** + * Constructor + */ + public FactoryManagerService(FactoryModPlugin plugin) + { + FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); + + this.plugin = plugin; + managers = Lists.newArrayList(); + managers.add(new ProductionFactoryManager(plugin)); + managers.add(new PrintingPressManager(plugin)); + managers.add(new NetherFactoryManager(plugin)); + loadManagers(); + periodicSaving(); + + FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); + } + + /** + * When plugin disabled, this is called. + */ + public void onDisable() + { + saveManagers(); + } + + /** + * Saves all managers + */ + private void saveManagers() + { + for (IManager manager : managers) + { + manager.save(); + } + } + + /** + * Loads all managers + */ + private void loadManagers() + { + for (IManager manager : managers) + { + manager.load(); + } + } + + /** + * Returns the appropriate manager depending on the given Manager Type + * @param + */ + public IManager getManager(Class factoryClass) + { + for (IManager manager : managers) + { + if (manager.getFactoryType() == factoryClass) + { + return manager; + } + } + + return null; + } + + /** + * Save Factories to file every SAVE_CYCLE minutes. + */ + private void periodicSaving() + { + Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { + @Override + public void run() + { + FactoryModPlugin.sendConsoleMessage("Saving Factory data..."); + saveManagers(); + } + }, (FactoryModPlugin.SAVE_CYCLE), + FactoryModPlugin.SAVE_CYCLE); + } + + /** + * Returns the Factory Saves file + */ + public File getSavesFile(String fileName) + { + return new File(plugin.getDataFolder(), fileName + ".txt"); + } + + /** + * Returns whether a factory exists at given location in any manager + */ + public boolean factoryExistsAt(Location location) + { + for (IManager manager : managers) + { + if (manager.factoryExistsAt(location)) + { + return true; + } + } + return false; + } + + /** + * Returns whether a factory is whole at given location in any manager + */ + public boolean factoryWholeAt(Location location) + { + for (IManager manager : managers) + { + if (manager.factoryWholeAt(location)) + { + return true; + } + } + return false; + } + + public IFactory getFactory(Location location) { + for (IManager manager : managers) + { + if (manager.factoryExistsAt(location)) + { + return manager.getFactory(location); + } + } + return null; + } + + public IManager getManager(Location location) { + for (IManager manager : managers) + { + if (manager.factoryExistsAt(location)) + { + return manager; + } + } + return null; + } + + public InteractionResponse createFactory(Location centralLocation, + Location inventoryLocation, Location powerLocation) { + InteractionResponse response = null; + for (IManager manager : managers) + { + response = manager.createFactory(centralLocation, inventoryLocation, powerLocation); + if (response.getInteractionResult() == InteractionResult.SUCCESS) + { + return response; + } + } + + FactoryModPlugin.sendConsoleMessage("The factory could not be created: " + response.getInteractionMessage()); + return response; + } +} diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java b/src/com/github/igotyou/FactoryMod/managers/IManager.java similarity index 90% rename from src/com/github/igotyou/FactoryMod/interfaces/Manager.java rename to src/com/github/igotyou/FactoryMod/managers/IManager.java index d6ee0d4b..e3759b96 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java +++ b/src/com/github/igotyou/FactoryMod/managers/IManager.java @@ -1,83 +1,86 @@ -package com.github.igotyou.FactoryMod.interfaces; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ -public interface Manager -{ - - public Class getFactoryType(); - - /** - * @return the plugin instance - */ - public FactoryModPlugin getPlugin(); - -/** -* Saves the machine objects list of this manager to file -*/ - public void save(); - -/** -* Loads machine objects list of this manager from file -*/ - public void load(); - -/** -* Updates all the machines from this manager's machine object list -*/ - public void updateFactorys(); - -/** -* Attempts to create a new machine for this manager -*/ - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation); - -/** -* Creates a machine from an existing machine data object -*/ - public InteractionResponse addFactory(T factory); - -/** -* Returns the machine (if any exists) at the given location from this manager -*/ - public T getFactory(Location factoryLocation); - -/** -* Returns whether a machine exists at the given location -*/ - public boolean factoryExistsAt(Location factoryLocation); - -/** -* Returns whether a machine is whole at the given location -*/ - public boolean factoryWholeAt(Location factoryLocation); - -/** -* Removes the given machine from the object list -*/ - public void removeFactory(T factory); - -/** -* Returns the saves file name for this manager -*/ - public String getSavesFileName(); - +package com.github.igotyou.FactoryMod.managers; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.IFactory; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; + +//original file: +/** +* Manager.java +* Purpose: Interface for Manager objects for basic manager functionality +* +* @author MrTwiggy +* @version 0.1 1/08/13 +*/ +//edited version: +/** +* Manager.java +* Purpose: Interface for Manager objects for basic manager functionality +* @author igotyou +* +*/ +public interface IManager +{ + + public Class getFactoryType(); + + /** + * @return the plugin instance + */ + public FactoryModPlugin getPlugin(); + +/** +* Saves the machine objects list of this manager to file +*/ + public void save(); + +/** +* Loads machine objects list of this manager from file +*/ + public void load(); + +/** +* Updates all the machines from this manager's machine object list +*/ + public void updateFactorys(); + +/** +* Attempts to create a new machine for this manager +*/ + public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation); + +/** +* Creates a machine from an existing machine data object +*/ + public InteractionResponse addFactory(T factory); + +/** +* Returns the machine (if any exists) at the given location from this manager +*/ + public T getFactory(Location factoryLocation); + +/** +* Returns whether a machine exists at the given location +*/ + public boolean factoryExistsAt(Location factoryLocation); + +/** +* Returns whether a machine is whole at the given location +*/ + public boolean factoryWholeAt(Location factoryLocation); + +/** +* Removes the given machine from the object list +*/ + public void removeFactory(T factory); + +/** +* Returns the saves file name for this manager +*/ + public String getSavesFileName(); + + public boolean isClear(T factory); + } \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 00a8fa4c..588b43e6 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -16,7 +16,6 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; import com.github.igotyou.FactoryMod.persistence.FileBackup; import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; @@ -44,62 +43,20 @@ * */ -public class NetherFactoryManager implements Manager +public class NetherFactoryManager extends AManager { private ReinforcementManager rm = Citadel.getReinforcementManager(); - private FactoryModPlugin plugin; - private List netherFactorys; - private FactoryDao mDao; - private File mSaveFile; - private long repairTime; - private boolean isLogging = true; + //private List netherFactorys; public NetherFactoryManager(FactoryModPlugin plugin) { this.plugin = plugin; mSaveFile = new File(plugin.getDataFolder(), "netherSaves.txt"); - netherFactorys = Lists.newArrayList(); + //netherFactorys = Lists.newArrayList(); //Set maintenance clock to 0 updateFactorys(); mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } - - @Override - public void save() - { - updateRepair(System.currentTimeMillis() - repairTime); - repairTime = System.currentTimeMillis(); - - FileBackup.backup(mSaveFile); - mDao.writeFactories(netherFactorys); - } - - @Override - public void load() - { - isLogging = false; - repairTime = System.currentTimeMillis(); - for(NetherFactory factory : mDao.readFactories()) { - addFactory(factory); - } - isLogging = true; - } - - @Override - public void updateFactorys() - { - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() - { - @Override - public void run() - { - for (NetherFactory factory: netherFactorys) - { - factory.update(); - } - } - }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); - } @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) @@ -228,31 +185,19 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve return new InteractionResponse(InteractionResult.FAILURE, "No factory was identified!"); } - @Override - public InteractionResponse addFactory(NetherFactory factory) - { - if (factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && + public boolean isClear(NetherFactory factory){ + return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(factory.getCenterLocation()) || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation()) || !factoryExistsAt(factory.getNetherTeleportPlatform()) - || !factoryExistsAt(factory.getOverworldTeleportPlatform()) )) - { - netherFactorys.add(factory); - if (isLogging) { FactoryModPlugin.sendConsoleMessage("Nether factory created: " + factory.getProperties().getName()); } - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - FactoryModPlugin.sendConsoleMessage("Nether factory failed to create: " + factory.getProperties().getName()); - return new InteractionResponse(InteractionResult.FAILURE, ""); - } + || !factoryExistsAt(factory.getOverworldTeleportPlatform()) ); } @Override public NetherFactory getFactory(Location factoryLocation) { - for (NetherFactory factory : netherFactorys) + for (NetherFactory factory : factories) { if (factory.getCenterLocation().equals(factoryLocation) || factory.getInventoryLocation().equals(factoryLocation) @@ -264,66 +209,6 @@ public NetherFactory getFactory(Location factoryLocation) return null; } - @Override - public boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - @Override - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - @Override - public void removeFactory(NetherFactory factory) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Nether factory removed: ") - .append(factory.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(factory.getCenterLocation())) - .toString()); - - netherFactorys.remove(factory); - - } - - public void updateRepair(long time) - { - for (NetherFactory factory : netherFactorys) - { - factory.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); - } - long currentTime = System.currentTimeMillis(); - Iterator itr = netherFactorys.iterator(); - while(itr.hasNext()) - { - NetherFactory factory = itr.next(); - if(currentTime > (factory.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Nether factory removed due to disrepair: ") - .append(factory.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(factory.getCenterLocation())) - .toString()); - - itr.remove(); - - } - } - } - @Override public String getSavesFileName() { @@ -334,7 +219,7 @@ public double getScalingFactor(Location location) { double scalingFactor = 1; NetherFactoryProperties properties = plugin.getNetherFactoryProperties(); - for (NetherFactory factory : netherFactorys) + for (NetherFactory factory : factories) { Location factoryLoc = factory.getCenterLocation(); if(factory.getCenterLocation().equals(location)) @@ -357,11 +242,6 @@ public double getScalingFactor(Location location) return scalingFactor; } - @Override - public FactoryModPlugin getPlugin() { - return plugin; - } - @Override public Class getFactoryType() { return NetherFactory.class; diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 407e83af..0fb21e08 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -10,8 +10,8 @@ import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.interfaces.Manager; import com.github.igotyou.FactoryMod.persistence.FactoryDao; import com.github.igotyou.FactoryMod.persistence.FileBackup; import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; @@ -39,60 +39,19 @@ * */ -public class PrintingPressManager implements Manager +public class PrintingPressManager extends AManager { - private FactoryModPlugin plugin; - private List presses; - private FactoryDao mDao; - private File mSaveFile; - private long repairTime; - private boolean isLogging = true; + //private List presses; public PrintingPressManager(FactoryModPlugin plugin) { this.plugin = plugin; - presses = Lists.newArrayList(); + //presses = Lists.newArrayList(); mSaveFile = new File(plugin.getDataFolder(), "pressSaves.txt"); //Set maintenance clock to 0 updateFactorys(); mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); } - - public void save() - { - //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis() - repairTime); - repairTime = System.currentTimeMillis(); - - FileBackup.backup(mSaveFile); - mDao.writeFactories(presses); - } - - public void load() - { - isLogging = false; - repairTime = System.currentTimeMillis(); - for(PrintingPress press : mDao.readFactories()) { - addFactory(press); - } - isLogging = true; - } - - @Override - public void updateFactorys() - { - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() - { - @Override - public void run() - { - for (PrintingPress production: presses) - { - production.update(); - } - } - }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); - } @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) @@ -120,27 +79,15 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + printingPressProperties.getName() + " there!"); } - @Override - public InteractionResponse addFactory(PrintingPress press) - { - if (press.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(press.getCenterLocation())) - || !factoryExistsAt(press.getInventoryLocation()) || !factoryExistsAt(press.getPowerSourceLocation())) - { - presses.add(press); - if (isLogging) { FactoryModPlugin.sendConsoleMessage("Printing press created: " + press.getProperties().getName()); } - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - FactoryModPlugin.sendConsoleMessage("Printing press failed to create: " + press.getProperties().getName()); - return new InteractionResponse(InteractionResult.FAILURE, ""); - } + public boolean isClear(PrintingPress factory){ + return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(factory.getCenterLocation())) + || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation()); } @Override public PrintingPress getFactory(Location factoryLocation) { - for (PrintingPress production : presses) + for (PrintingPress production : factories) { if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) || production.getPowerSourceLocation().equals(factoryLocation)) @@ -149,74 +96,12 @@ public PrintingPress getFactory(Location factoryLocation) return null; } - @Override - public boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - @Override - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - @Override - public void removeFactory(PrintingPress press) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Printing press removed: ") - .append(press.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(press.getCenterLocation())) - .toString()); - - presses.remove(press); - } - - public void updateRepair(long time) - { - for (PrintingPress press : presses) - { - press.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); - } - long currentTime = System.currentTimeMillis(); - Iterator itr = presses.iterator(); - while(itr.hasNext()) - { - PrintingPress press = itr.next(); - if(currentTime > (press.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Printing press removed due to disrepair: ") - .append(press.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(press.getCenterLocation())) - .toString()); - - itr.remove(); - } - } - } - @Override public String getSavesFileName() { return FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE; } - @Override - public FactoryModPlugin getPlugin() { - return plugin; - } @Override public Class getFactoryType() { diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java similarity index 56% rename from src/com/github/igotyou/FactoryMod/managers/ProductionManager.java rename to src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java index abde62db..ec8d14d5 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java @@ -1,271 +1,155 @@ -package com.github.igotyou.FactoryMod.managers; - -import java.io.File; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.interfaces.Manager; -import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.FileBackup; -import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.google.common.collect.Lists; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ - -public class ProductionManager implements Manager -{ - private FactoryModPlugin plugin; - private List producers; - private FactoryDao mDao; - private File mSaveFile; - private long repairTime; - private boolean isLogging = true; - - public ProductionManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); - producers = Lists.newArrayList(); - //Set maintenance clock to 0 - updateFactorys(); - mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); - } - - public void save() - { - //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis() - repairTime); - repairTime = System.currentTimeMillis(); - - FileBackup.backup(mSaveFile); - mDao.writeFactories(producers); - } - - public void load() - { - isLogging = false; - repairTime = System.currentTimeMillis(); - for(ProductionFactory factory : mDao.readFactories()) { - addFactory(factory); - } - isLogging = true; - } - - @Override - public void updateFactorys() - { - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() - { - @Override - public void run() - { - for (ProductionFactory production: producers) - { - production.update(); - } - } - }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) - { - if (!factoryExistsAt(factoryLocation)) - { - Map properties = FactoryModPlugin.productionProperties; - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - String subFactoryType = null; - for (Map.Entry entry : properties.entrySet()) - { - ItemList inputs = entry.getValue().getInputs(); - if(inputs.exactlyIn(chestInventory)) - { - subFactoryType = entry.getKey(); - } - } - if (subFactoryType != null) - { - ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); - if (properties.get(subFactoryType).getInputs().allIn(production.getInventory())) - { - addFactory(production); - properties.get(subFactoryType).getInputs().removeFrom(production.getInventory()); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + production.getProductionFactoryProperties().getName()); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly."); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation, int productionTimer, int energyTimer) - { - if (!factoryExistsAt(factoryLocation)) - { - Map properties = FactoryModPlugin.productionProperties; - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - String subFactoryType = null; - boolean hasMaterials = true; - for (Map.Entry entry : properties.entrySet()) - { - ItemList inputs = entry.getValue().getInputs(); - if(!inputs.allIn(chestInventory)) - { - hasMaterials = false; - } - if (hasMaterials == true) - { - subFactoryType = entry.getKey(); - } - } - if (hasMaterials && subFactoryType != null) - { - ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); - if (properties.get(subFactoryType).getInputs().removeFrom(production.getInventory())) - { - addFactory(production); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + subFactoryType + " production factory"); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - - @Override - public InteractionResponse addFactory(ProductionFactory factory) - { - if (factory.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(factory.getCenterLocation())) - || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation())) - { - producers.add(factory); - if(isLogging) { FactoryModPlugin.sendConsoleMessage("Production factory created: " + factory.getProductionFactoryProperties().getName()); } - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - FactoryModPlugin.sendConsoleMessage("Production factory failed to create: " + factory.getProductionFactoryProperties().getName()); - return new InteractionResponse(InteractionResult.FAILURE, ""); - } - } - - @Override - public ProductionFactory getFactory(Location factoryLocation) - { - for (ProductionFactory production : producers) - { - if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) - || production.getPowerSourceLocation().equals(factoryLocation)) - return production; - } - return null; - } - - @Override - public boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - @Override - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - @Override - public void removeFactory(ProductionFactory factory) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Production factory removed: ") - .append(factory.getProductionFactoryProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(factory.getCenterLocation())) - .toString()); - - producers.remove(factory); - } - - public void updateRepair(long time) - { - for (ProductionFactory production : producers) - { - production.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); - } - long currentTime = System.currentTimeMillis(); - Iterator itr = producers.iterator(); - while(itr.hasNext()) - { - ProductionFactory producer = itr.next(); - if(currentTime > (producer.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Production factory removed due to disrepair: ") - .append(producer.getProductionFactoryProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(producer.getCenterLocation())) - .toString()); - - itr.remove(); - } - } - } - - @Override - public String getSavesFileName() - { - return mSaveFile.getName(); - } - - @Override - public FactoryModPlugin getPlugin() { - return plugin; - } - - @Override - public Class getFactoryType() { - return ProductionFactory.class; - } - -} +package com.github.igotyou.FactoryMod.managers; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.inventory.Inventory; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.persistence.FactoryDao; +import com.github.igotyou.FactoryMod.persistence.FileBackup; +import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; +import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.StringUtils; +import com.google.common.collect.Lists; + +//original file: +/** +* Manager.java +* Purpose: Interface for Manager objects for basic manager functionality +* +* @author MrTwiggy +* @version 0.1 1/08/13 +*/ +//edited version: +/** +* Manager.java +* Purpose: Interface for Manager objects for basic manager functionality +* @author igotyou +* +*/ + +public class ProductionFactoryManager extends AManager +{ + //private List producers; + + public ProductionFactoryManager(FactoryModPlugin plugin) + { + this.plugin = plugin; + mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); + //producers = Lists.newArrayList(); + //Set maintenance clock to 0 + updateFactorys(); + mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); + } + + @Override + public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) + { + if (!factoryExistsAt(factoryLocation)) + { + Map properties = FactoryModPlugin.productionProperties; + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + String subFactoryType = null; + for (Map.Entry entry : properties.entrySet()) + { + ItemList inputs = entry.getValue().getInputs(); + if(inputs.exactlyIn(chestInventory)) + { + subFactoryType = entry.getKey(); + } + } + if (subFactoryType != null) + { + ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); + if (properties.get(subFactoryType).getInputs().allIn(production.getInventory())) + { + addFactory(production); + properties.get(subFactoryType).getInputs().removeFrom(production.getInventory()); + return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + production.getProductionFactoryProperties().getName()); + } + } + return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly."); + } + return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); + } + + public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation, int productionTimer, int energyTimer) + { + if (!factoryExistsAt(factoryLocation)) + { + Map properties = FactoryModPlugin.productionProperties; + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + String subFactoryType = null; + boolean hasMaterials = true; + for (Map.Entry entry : properties.entrySet()) + { + ItemList inputs = entry.getValue().getInputs(); + if(!inputs.allIn(chestInventory)) + { + hasMaterials = false; + } + if (hasMaterials == true) + { + subFactoryType = entry.getKey(); + } + } + if (hasMaterials && subFactoryType != null) + { + ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); + if (properties.get(subFactoryType).getInputs().removeFrom(production.getInventory())) + { + addFactory(production); + return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + subFactoryType + " production factory"); + } + } + return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); + } + return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); + } + + public boolean isClear(ProductionFactory factory){ + return factory.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(factory.getCenterLocation())) + || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation()); + } + + @Override + public ProductionFactory getFactory(Location factoryLocation) + { + for (ProductionFactory production : factories) + { + if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) + || production.getPowerSourceLocation().equals(factoryLocation)) + return production; + } + return null; + } + + @Override + public String getSavesFileName() + { + return mSaveFile.getName(); + } + + @Override + public Class getFactoryType() { + return ProductionFactory.class; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java index a5c5b987..1be096f9 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java @@ -1,11 +1,11 @@ -package com.github.igotyou.FactoryMod.persistence; - -import com.github.igotyou.FactoryMod.interfaces.Factory; - -public interface FactoryCodec { - - public void write(T out); - - public T read(); - -} +package com.github.igotyou.FactoryMod.persistence; + +import com.github.igotyou.FactoryMod.Factorys.IFactory; + +public interface FactoryCodec { + + public void write(T out); + + public T read(); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java index 6679066f..6fd9eced 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java @@ -1,25 +1,25 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.interfaces.Factory; - -public class FactoryDao { - - private FactoryReader mReader; - private FactoryWriter mWriter; - - FactoryDao(FactoryReader reader, FactoryWriter writer) { - mReader = reader; - mWriter = writer; - } - - public List readFactories() { - return mReader.read(); - } - - public void writeFactories(List factories) { - mWriter.write(factories); - } - -} +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.Factorys.IFactory; + +public class FactoryDao { + + private FactoryReader mReader; + private FactoryWriter mWriter; + + FactoryDao(FactoryReader reader, FactoryWriter writer) { + mReader = reader; + mWriter = writer; + } + + public List readFactories() { + return mReader.read(); + } + + public void writeFactories(List factories) { + mWriter.write(factories); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java index 7f1ba60b..246384bf 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java @@ -1,11 +1,11 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.interfaces.Factory; - -public interface FactoryReader { - - public List read(); - -} +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.Factorys.IFactory; + +public interface FactoryReader { + + public List read(); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java index 18a69019..9c237538 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java @@ -1,11 +1,11 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.interfaces.Factory; - -public interface FactoryWriter { - - public void write(List factories); - -} +package com.github.igotyou.FactoryMod.persistence; + +import java.util.List; + +import com.github.igotyou.FactoryMod.Factorys.IFactory; + +public interface FactoryWriter { + + public void write(List factories); + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index de5f513e..2e20f4eb 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -1,115 +1,116 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.nio.charset.Charset; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; -import com.google.common.collect.Lists; -import com.google.common.io.Files; - -public class NetherCsvReader implements FactoryReader { - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - static final int VERSION = 1; - - public NetherCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - @Override - public synchronized List read() { - - List factories = Lists.newArrayList(); - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return factories; - } - - ObjectInputStream ois; - - try { - FileInputStream fileInputStream = new FileInputStream(mFile); - ois = new ObjectInputStream(fileInputStream); - } catch (Exception e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return factories; - } - - int lineNum = 1; - - try { - int version = ois.readInt(); - if(version != VERSION) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); - ois.close(); - return factories; - } - - int count = ois.readInt(); - for (int i = 0; i < count; i++) - { - try { - factories.add(read(ois)); - } catch (Exception ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); - break; - } - } - } catch (IOException ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - - return factories; - } - - public NetherFactory read(ObjectInputStream input) throws Exception { - String worldName = input.readUTF(); - World world = mPlugin.getServer().getWorld(worldName); - - Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location overworldTeleportPlatformLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - - String worldName2 = input.readUTF(); - World world2 = mPlugin.getServer().getWorld(worldName2); - - Location netherTeleportPlatformLocation = new Location(world2, input.readInt(), input.readInt(), input.readInt()); - - boolean active = input.readBoolean(); - NetherOperationMode mode = NetherFactory.NetherOperationMode.byId(input.readInt()); - double currentRepair = input.readDouble(); - long timeDisrepair = input.readLong(); - - return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, - active, currentRepair, timeDisrepair, - mode, - mPlugin.getNetherFactoryProperties(), this); - } - -} +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.nio.charset.Charset; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.World; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; +import com.google.common.collect.Lists; +import com.google.common.io.Files; + +public class NetherCsvReader implements FactoryReader { + + /** + * The plugin instance + */ + FactoryModPlugin mPlugin; + + /** + * The CSV file being read + */ + File mFile; + + static final int VERSION = 1; + + public NetherCsvReader(FactoryModPlugin plugin, File file) { + mPlugin = plugin; + mFile = file; + } + + @Override + public synchronized List read() { + + List factories = Lists.newArrayList(); + + if(!mFile.exists() || mFile.isDirectory()) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") + .append(mFile.getName()).append(" is not a valid file!").toString()); + return factories; + } + + ObjectInputStream ois; + + try { + FileInputStream fileInputStream = new FileInputStream(mFile); + ois = new ObjectInputStream(fileInputStream); + } catch (Exception e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); + return factories; + } + + int lineNum = 1; + + try { + int version = ois.readInt(); + if(version != VERSION) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); + ois.close(); + return factories; + } + + int count = ois.readInt(); + for (int i = 0; i < count; i++) + { + try { + factories.add(read(ois)); + } catch (Exception ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); + break; + } + } + } catch (IOException ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); + } + + return factories; + } + + public NetherFactory read(ObjectInputStream input) throws Exception { + String worldName = input.readUTF(); + World world = mPlugin.getServer().getWorld(worldName); + + Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + Location overworldTeleportPlatformLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); + + String worldName2 = input.readUTF(); + World world2 = mPlugin.getServer().getWorld(worldName2); + + Location netherTeleportPlatformLocation = new Location(world2, input.readInt(), input.readInt(), input.readInt()); + + boolean active = input.readBoolean(); + NetherOperationMode mode = NetherFactory.NetherOperationMode.byId(input.readInt()); + double currentRepair = input.readDouble(); + long timeDisrepair = input.readLong(); + + return null; +// return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, +// active, currentRepair, timeDisrepair, +// mode, +// mPlugin.getNetherFactoryProperties(), this); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java index 32ce66f0..9619aae6 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -1,36 +1,36 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.interfaces.Factory; -import com.github.igotyou.FactoryMod.interfaces.Manager; -import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; -import com.github.igotyou.FactoryMod.managers.PrintingPressManager; -import com.github.igotyou.FactoryMod.managers.ProductionManager; - -public class PersistenceFactory { - - //TODO: use type inference for return - public static FactoryDao getFactoryDao(Manager factoryManager, File saveFile, String saveFormat) { - - if(saveFormat.toLowerCase().equals("txt")) { - if(factoryManager instanceof ProductionManager) { - return (FactoryDao) new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); - } else if(factoryManager instanceof PrintingPressManager) { - return (FactoryDao) new FactoryDao(new PrintingPressCsvReader(factoryManager.getPlugin(), saveFile), new PrintingPressCsvWriter(saveFile)); - } else if(factoryManager instanceof NetherFactoryManager) { - return (FactoryDao) new FactoryDao(new NetherCsvReader(factoryManager.getPlugin(), saveFile), new NetherCsvWriter(saveFile)); - } - FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); - return null; - } - - FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + saveFormat); - return null; - } - -} +package com.github.igotyou.FactoryMod.persistence; + +import java.io.File; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.IFactory; +import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.managers.IManager; +import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; +import com.github.igotyou.FactoryMod.managers.PrintingPressManager; +import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; + +public class PersistenceFactory { + + //TODO: use type inference for return + public static FactoryDao getFactoryDao(IManager factoryManager, File saveFile, String saveFormat) { + + if(saveFormat.toLowerCase().equals("txt")) { + if(factoryManager instanceof ProductionFactoryManager) { + return (FactoryDao) new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); + } else if(factoryManager instanceof PrintingPressManager) { + return (FactoryDao) new FactoryDao(new PrintingPressCsvReader(factoryManager.getPlugin(), saveFile), new PrintingPressCsvWriter(saveFile)); + } else if(factoryManager instanceof NetherFactoryManager) { + return (FactoryDao) new FactoryDao(new NetherCsvReader(factoryManager.getPlugin(), saveFile), new NetherCsvWriter(saveFile)); + } + FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); + return null; + } + + FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + saveFormat); + return null; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java new file mode 100644 index 00000000..4054e02e --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java @@ -0,0 +1,10 @@ +package com.github.igotyou.FactoryMod.properties; + +public abstract class AFactoryProperties implements IFactoryProperties{ + protected String name; + + public String getName() + { + return name; + } +} diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Properties.java b/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java similarity index 72% rename from src/com/github/igotyou/FactoryMod/interfaces/Properties.java rename to src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java index 38ddad61..eec0f76b 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Properties.java +++ b/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java @@ -1,24 +1,25 @@ -package com.github.igotyou.FactoryMod.interfaces; - -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - -//original file: -/** - * Properties.java - * Purpose: Interface for Properties objects for basic properties functionality - * - * @author MrTwiggy - * @version 0.1 1/17/13 - */ -//edited version: -/** -* Properties.java - * Purpose: Interface for Properties objects for basic properties functionality -* @author igotyou -* -*/ -public interface Properties -{ - public ItemList getInputs() ; +package com.github.igotyou.FactoryMod.properties; + +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +//original file: +/** + * Properties.java + * Purpose: Interface for Properties objects for basic properties functionality + * + * @author MrTwiggy + * @version 0.1 1/17/13 + */ +//edited version: +/** +* Properties.java + * Purpose: Interface for Properties objects for basic properties functionality +* @author igotyou +* +*/ +public interface IFactoryProperties +{ +// public ItemList getInputs() ; + public String getName(); } \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java index 7591f2cf..2d7708ed 100644 --- a/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java @@ -9,13 +9,12 @@ import com.github.igotyou.FactoryMod.utility.NamedItemStack; -public class NetherFactoryProperties +public class NetherFactoryProperties extends AFactoryProperties { private ItemList constructionMaterials; private ItemList fuel; private ItemList repairMaterials; private int energyTime; - private String name; private int repair; private double repairTime; private int scalingMode; @@ -79,10 +78,6 @@ public int getEnergyTime() return energyTime; } - public String getName() - { - return name; - } public static NetherFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection configNetherFactory) { diff --git a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java index 7285b726..a50a723d 100644 --- a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java @@ -10,7 +10,7 @@ import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -public class PrintingPressProperties { +public class PrintingPressProperties extends AFactoryProperties{ private ItemList fuel; private ItemList constructionMaterials; @@ -23,7 +23,6 @@ public class PrintingPressProperties { private ItemList securityMaterials; private int securityNotesPerLot; private int energyTime; - private String name; private int maxRepair; private ItemList repairMaterials; private int pageLead; @@ -170,11 +169,6 @@ public int getEnergyTime() { return energyTime; } - - public String getName() - { - return name; - } public ItemList getConstructionMaterials() { return constructionMaterials; diff --git a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java index 4172b3aa..44f673b0 100644 --- a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java @@ -1,60 +1,53 @@ -package com.github.igotyou.FactoryMod.properties; - -import java.util.List; - -import com.github.igotyou.FactoryMod.interfaces.Properties; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - - -public class ProductionProperties implements Properties -{ - private ItemList inputs; - private List recipes; - private ItemList fuel; - private int energyTime; - private String name; - private int repair; - - public ProductionProperties(ItemList inputs, List recipes, - ItemList fuel, int energyTime, String name,int repair) - { - this.inputs = inputs; - this.recipes = recipes; - this.fuel = fuel; - this.energyTime = energyTime; - this.name = name; - this.repair=repair; - } - - public int getRepair() - { - return repair; - } - - public ItemList getInputs() - { - return inputs; - } - - public List getRecipes() - { - return recipes; - } - - public ItemList getFuel() - { - return fuel; - } - - public int getEnergyTime() - { - return energyTime; - } - - public String getName() - { - return name; - } -} +package com.github.igotyou.FactoryMod.properties; + +import java.util.List; + +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + + +public class ProductionProperties extends AFactoryProperties +{ + private ItemList inputs; + private List recipes; + private ItemList fuel; + private int energyTime; + private int repair; + + public ProductionProperties(ItemList inputs, List recipes, + ItemList fuel, int energyTime, String name,int repair) + { + this.inputs = inputs; + this.recipes = recipes; + this.fuel = fuel; + this.energyTime = energyTime; + this.name = name; + this.repair=repair; + } + + public int getRepair() + { + return repair; + } + + public ItemList getInputs() + { + return inputs; + } + + public List getRecipes() + { + return recipes; + } + + public ItemList getFuel() + { + return fuel; + } + + public int getEnergyTime() + { + return energyTime; + } +} diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Recipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java similarity index 65% rename from src/com/github/igotyou/FactoryMod/interfaces/Recipe.java rename to src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index d7e1ba2a..e7944a08 100644 --- a/src/com/github/igotyou/FactoryMod/interfaces/Recipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -1,10 +1,10 @@ -package com.github.igotyou.FactoryMod.interfaces; - -public interface Recipe -{ - //get the recipes name, example: Iron Pickaxe - public String getRecipeName(); - - //get production time in update cycles - public int getProductionTime(); -} +package com.github.igotyou.FactoryMod.recipes; + +public interface IRecipe +{ + //get the recipes name, example: Iron Pickaxe + public String getRecipeName(); + + //get production time in update cycles + public int getProductionTime(); +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 10d85dc2..483b3162 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,110 +1,110 @@ -package com.github.igotyou.FactoryMod.recipes; - -import java.util.HashMap; -import java.util.Random; -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.enchantments.Enchantment; - -import com.github.igotyou.FactoryMod.interfaces.Recipe; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import org.bukkit.inventory.Inventory; - -public class ProductionRecipe implements Recipe -{ - private String title; - private String recipeName; - private int productionTime; - private ItemList inputs; - private ItemList upgrades; - private ItemList outputs; - private ItemList repairs; - private List outputRecipes; - private List enchantments; - private boolean useOnce; - - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, - ItemList outputs,List enchantments,boolean useOnce, ItemList repairs) - { - this.title=title; - this.recipeName = recipeName; - this.productionTime = productionTime; - this.inputs = inputs; - this.upgrades=upgrades; - this.outputs = outputs; - this.outputRecipes=new ArrayList(); - this.enchantments=enchantments; - this.useOnce=useOnce; - this.repairs=repairs; - } - - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) - { - this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),new ArrayList(),false,repairs); - } - - public boolean hasMaterials(Inventory inventory) - { - return inputs.allIn(inventory)&&upgrades.oneIn(inventory)&&repairs.allIn(inventory); - } - public void addOutputRecipe(ProductionRecipe outputRecipe) - { - this.outputRecipes.add(outputRecipe); - } - - public ItemList getInputs() - { - return inputs; - } - - public ItemList getUpgrades() - { - return upgrades; - } - - public ItemList getOutputs() - { - return outputs; - } - - public ItemList getRepairs() - { - return repairs; - } - - public List getEnchantments() - { - return enchantments; - } - - public boolean hasEnchantments() - { - return enchantments.size()>0; - } - - public String getTitle() - { - return title; - } - public String getRecipeName() - { - return recipeName; - } - - public int getProductionTime() - { - return productionTime; - } - - public List getOutputRecipes() - { - return outputRecipes; - } - - public boolean getUseOnce() - { - return useOnce; - } -} +package com.github.igotyou.FactoryMod.recipes; + +import java.util.HashMap; +import java.util.Random; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.enchantments.Enchantment; + +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; + +import org.bukkit.inventory.Inventory; + +public class ProductionRecipe implements IRecipe +{ + private String title; + private String recipeName; + private int productionTime; + private ItemList inputs; + private ItemList upgrades; + private ItemList outputs; + private ItemList repairs; + private List outputRecipes; + private List enchantments; + private boolean useOnce; + + public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, + ItemList outputs,List enchantments,boolean useOnce, ItemList repairs) + { + this.title=title; + this.recipeName = recipeName; + this.productionTime = productionTime; + this.inputs = inputs; + this.upgrades=upgrades; + this.outputs = outputs; + this.outputRecipes=new ArrayList(); + this.enchantments=enchantments; + this.useOnce=useOnce; + this.repairs=repairs; + } + + public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) + { + this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),new ArrayList(),false,repairs); + } + + public boolean hasMaterials(Inventory inventory) + { + return inputs.allIn(inventory)&&upgrades.oneIn(inventory)&&repairs.allIn(inventory); + } + public void addOutputRecipe(ProductionRecipe outputRecipe) + { + this.outputRecipes.add(outputRecipe); + } + + public ItemList getInputs() + { + return inputs; + } + + public ItemList getUpgrades() + { + return upgrades; + } + + public ItemList getOutputs() + { + return outputs; + } + + public ItemList getRepairs() + { + return repairs; + } + + public List getEnchantments() + { + return enchantments; + } + + public boolean hasEnchantments() + { + return enchantments.size()>0; + } + + public String getTitle() + { + return title; + } + public String getRecipeName() + { + return recipeName; + } + + public int getProductionTime() + { + return productionTime; + } + + public List getOutputRecipes() + { + return outputRecipes; + } + + public boolean getUseOnce() + { + return useOnce; + } +} From 6c6c539282a785b9d76c4d5fc9c6b8f978fa8143 Mon Sep 17 00:00:00 2001 From: biggestnerd Date: Wed, 3 Jun 2015 16:48:17 -0500 Subject: [PATCH 079/459] Update FactoryModManager.java --- .../github/igotyou/FactoryMod/managers/FactoryModManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java index 0fa055b2..54ce2800 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java @@ -65,11 +65,12 @@ private void initializeManagers() //if (FactoryModPlugin.PRODUCTION_ENEABLED) //{ + //NetherFactoryManager must ALWAYS BE LAST!!!! initializeProductionManager(); initializePrintingPressManager(); initializeRepairFactoryManager(); - initializeNetherFactoryManager(); initializeCompactorManager(); + initializeNetherFactoryManager(); //} } From ad068731b92dc73714323456c2a8fe2017c29636 Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 8 Jun 2015 21:50:47 -0500 Subject: [PATCH 080/459] made managers file agnostic --- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 ++ .../igotyou/FactoryMod/managers/AManager.java | 4 +--- .../igotyou/FactoryMod/managers/IManager.java | 4 ---- .../FactoryMod/managers/NetherFactoryManager.java | 7 ------- .../FactoryMod/managers/PrintingPressManager.java | 8 -------- .../managers/ProductionFactoryManager.java | 7 ------- .../FactoryMod/managers/RepairFactoryManager.java | 5 ----- .../FactoryMod/persistence/NetherCsvWriter.java | 3 ++- .../FactoryMod/persistence/PersistenceFactory.java | 14 +++++++++++--- .../persistence/PrintingPressCsvWriter.java | 2 ++ .../persistence/ProductionCsvWriter.java | 3 ++- .../FactoryMod/persistence/RepairCsvWriter.java | 3 ++- 12 files changed, 22 insertions(+), 40 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index ff012537..1b07c393 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -50,6 +50,8 @@ public class FactoryModPlugin extends JavaPlugin public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name public static final String REPAIR_FACTORY_SAVE_FILE = "repairSaves"; + public static final String PRODUCTION_FACTORY_SAVE_FILE = "productionSaves"; + public static final String PERSISTENCE_FORMAT = "txt"; public static final int TICKS_PER_SECOND = 20; //ideal number of ticks per second public static final int TICKS_PER_MIN = 20; //ideal number of ticks per minute public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) diff --git a/src/com/github/igotyou/FactoryMod/managers/AManager.java b/src/com/github/igotyou/FactoryMod/managers/AManager.java index e92bfe2e..55bc0375 100644 --- a/src/com/github/igotyou/FactoryMod/managers/AManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/AManager.java @@ -22,7 +22,6 @@ public abstract class AManager implements IManager{ ArrayList factories = new ArrayList(); protected FactoryDao mDao; - protected File mSaveFile; protected long repairTime; protected boolean isLogging = true; @@ -31,7 +30,7 @@ public AManager(FactoryModPlugin plugin) this.plugin = plugin; //mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); updateFactorys(); - mDao = PersistenceFactory.getFactoryDao(this, mSaveFile, "txt"); + mDao = PersistenceFactory.getFactoryDao(this); } public String getFactoryName(){ @@ -67,7 +66,6 @@ public void save() updateRepair(System.currentTimeMillis() - repairTime); repairTime = System.currentTimeMillis(); - FileBackup.backup(mSaveFile); mDao.writeFactories(factories); } diff --git a/src/com/github/igotyou/FactoryMod/managers/IManager.java b/src/com/github/igotyou/FactoryMod/managers/IManager.java index e3759b96..4670a831 100644 --- a/src/com/github/igotyou/FactoryMod/managers/IManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/IManager.java @@ -76,10 +76,6 @@ public interface IManager */ public void removeFactory(T factory); -/** -* Returns the saves file name for this manager -*/ - public String getSavesFileName(); public boolean isClear(T factory); diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index df90a838..13d0c6c6 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -51,7 +51,6 @@ public class NetherFactoryManager extends AManager public NetherFactoryManager(FactoryModPlugin plugin) { super(plugin); - mSaveFile = new File(plugin.getDataFolder(), "netherSaves.txt"); } @Override @@ -205,12 +204,6 @@ public NetherFactory getFactory(Location factoryLocation) return null; } - @Override - public String getSavesFileName() - { - return FactoryModPlugin.NETHER_FACTORY_SAVE_FILE; - } - public double getScalingFactor(Location location) { double scalingFactor = 1; diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 01120f56..5d0e650b 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -46,7 +46,6 @@ public class PrintingPressManager extends AManager public PrintingPressManager(FactoryModPlugin plugin) { super(plugin); - mSaveFile = new File(plugin.getDataFolder(), "pressSaves.txt"); } @Override @@ -92,13 +91,6 @@ public PrintingPress getFactory(Location factoryLocation) return null; } - @Override - public String getSavesFileName() - { - return FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE; - } - - @Override public Class getFactoryType() { return PrintingPress.class; diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java index 7017fcd8..4ee458d2 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java @@ -52,7 +52,6 @@ public Class getFactoryType() { public ProductionFactoryManager(FactoryModPlugin plugin) { super(plugin); - mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); } @Override @@ -140,11 +139,5 @@ public ProductionFactory getFactory(Location factoryLocation) } return null; } - - @Override - public String getSavesFileName() - { - return mSaveFile.getName(); - } } diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 2a89221a..7642a8ea 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -155,9 +155,4 @@ public RepairFactory getFactory(Location factoryLocation) { return null; } - @Override - public String getSavesFileName() { - return FactoryModPlugin.REPAIR_FACTORY_SAVE_FILE; - } - } diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java index bcdf45f0..2bcf6276 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java @@ -24,7 +24,8 @@ public NetherCsvWriter(File file) { @Override public void write(List factories) { - + FileBackup.backup(mFile); + if(!mFile.exists()) { try { mFile.createNewFile(); diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java index 9619aae6..b149152b 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -7,29 +7,37 @@ import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory; import com.github.igotyou.FactoryMod.managers.IManager; import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; import com.github.igotyou.FactoryMod.managers.PrintingPressManager; import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; +import com.github.igotyou.FactoryMod.managers.RepairFactoryManager; public class PersistenceFactory { //TODO: use type inference for return - public static FactoryDao getFactoryDao(IManager factoryManager, File saveFile, String saveFormat) { + public static FactoryDao getFactoryDao(IManager factoryManager) { - if(saveFormat.toLowerCase().equals("txt")) { + if(FactoryModPlugin.PERSISTENCE_FORMAT.toLowerCase().equals("txt")) { if(factoryManager instanceof ProductionFactoryManager) { + File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.PRODUCTION_FACTORY_SAVE_FILE+".txt"); return (FactoryDao) new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); } else if(factoryManager instanceof PrintingPressManager) { + File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE+".txt"); return (FactoryDao) new FactoryDao(new PrintingPressCsvReader(factoryManager.getPlugin(), saveFile), new PrintingPressCsvWriter(saveFile)); } else if(factoryManager instanceof NetherFactoryManager) { + File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.NETHER_FACTORY_SAVE_FILE+".txt"); return (FactoryDao) new FactoryDao(new NetherCsvReader(factoryManager.getPlugin(), saveFile), new NetherCsvWriter(saveFile)); + } else if(factoryManager instanceof RepairFactoryManager) { + File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.REPAIR_FACTORY_SAVE_FILE+".txt"); + return (FactoryDao) new FactoryDao(new RepairCsvReader(factoryManager.getPlugin(), saveFile), new RepairCsvWriter(saveFile)); } FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); return null; } - FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + saveFormat); + FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + FactoryModPlugin.PERSISTENCE_FORMAT); return null; } diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java index d45d6e15..3482bbb3 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java @@ -25,6 +25,8 @@ public PrintingPressCsvWriter(File file) { @Override public synchronized void write(List presses) { + FileBackup.backup(mFile); + if(!mFile.exists()) { try { mFile.createNewFile(); diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java index b7319b1a..ed773ae0 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java @@ -24,7 +24,8 @@ public ProductionCsvWriter(File file) { @Override public synchronized void write(List factories) { - + FileBackup.backup(mFile); + if(!mFile.exists()) { try { mFile.createNewFile(); diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java index 1a7bd643..b826e3dc 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java @@ -27,7 +27,8 @@ public RepairCsvWriter(File file) { @Override public synchronized void write(List factories) { - + FileBackup.backup(mFile); + if(!mFile.exists()) { try { mFile.createNewFile(); From 20ad4fe4720398ee98d7fd0130299e26e6565b1e Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 8 Jun 2015 21:52:07 -0500 Subject: [PATCH 081/459] added comment about new reader/writers --- .../igotyou/FactoryMod/managers/RepairFactoryManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 7642a8ea..a2046daf 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -47,6 +47,7 @@ public Class getFactoryType() { } private ReinforcementManager rm = Citadel.getReinforcementManager(); + //SEE RepairCsvReader.java // @Override // public void save(File file) throws IOException { // repairTime=System.currentTimeMillis(); @@ -81,7 +82,8 @@ public Class getFactoryType() { // oos.flush(); // fileOutputStream.close(); // } - + + //SEE RepairCsvWriter.java // @Override // public void load(File file) throws IOException { // isLogging = false; From d995d9ac78aa50f5ef477888facef0f7de7b252a Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 8 Jun 2015 22:07:37 -0500 Subject: [PATCH 082/459] renamed some interfaces according to convention --- .../github/igotyou/FactoryMod/persistence/FactoryDao.java | 6 +++--- .../persistence/{FactoryCodec.java => IFactoryCodec.java} | 2 +- .../persistence/{FactoryReader.java => IFactoryReader.java} | 2 +- .../persistence/{FactoryWriter.java => IFactoryWriter.java} | 2 +- .../igotyou/FactoryMod/persistence/NetherCsvReader.java | 2 +- .../igotyou/FactoryMod/persistence/NetherCsvWriter.java | 2 +- .../FactoryMod/persistence/PrintingPressCsvReader.java | 2 +- .../FactoryMod/persistence/PrintingPressCsvWriter.java | 2 +- .../igotyou/FactoryMod/persistence/ProductionCsvReader.java | 2 +- .../igotyou/FactoryMod/persistence/ProductionCsvWriter.java | 2 +- .../igotyou/FactoryMod/persistence/RepairCsvReader.java | 2 +- .../igotyou/FactoryMod/persistence/RepairCsvWriter.java | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) rename src/com/github/igotyou/FactoryMod/persistence/{FactoryCodec.java => IFactoryCodec.java} (75%) rename src/com/github/igotyou/FactoryMod/persistence/{FactoryReader.java => IFactoryReader.java} (75%) rename src/com/github/igotyou/FactoryMod/persistence/{FactoryWriter.java => IFactoryWriter.java} (76%) diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java index 6fd9eced..b39739cd 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java @@ -6,10 +6,10 @@ public class FactoryDao { - private FactoryReader mReader; - private FactoryWriter mWriter; + private IFactoryReader mReader; + private IFactoryWriter mWriter; - FactoryDao(FactoryReader reader, FactoryWriter writer) { + FactoryDao(IFactoryReader reader, IFactoryWriter writer) { mReader = reader; mWriter = writer; } diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java similarity index 75% rename from src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java rename to src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java index 1be096f9..21df2e2c 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryCodec.java +++ b/src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java @@ -2,7 +2,7 @@ import com.github.igotyou.FactoryMod.Factorys.IFactory; -public interface FactoryCodec { +public interface IFactoryCodec { public void write(T out); diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java similarity index 75% rename from src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java rename to src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java index 246384bf..ee48f88c 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java @@ -4,7 +4,7 @@ import com.github.igotyou.FactoryMod.Factorys.IFactory; -public interface FactoryReader { +public interface IFactoryReader { public List read(); diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java similarity index 76% rename from src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java rename to src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java index 9c237538..7c2775fe 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java @@ -4,7 +4,7 @@ import com.github.igotyou.FactoryMod.Factorys.IFactory; -public interface FactoryWriter { +public interface IFactoryWriter { public void write(List factories); diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index 2e20f4eb..c00c5b31 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import com.google.common.io.Files; -public class NetherCsvReader implements FactoryReader { +public class NetherCsvReader implements IFactoryReader { /** * The plugin instance diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java index 2bcf6276..229930db 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java @@ -12,7 +12,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -public class NetherCsvWriter implements FactoryWriter { +public class NetherCsvWriter implements IFactoryWriter { static final int VERSION = 1; diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java index 53e976a2..8384c89e 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java @@ -14,7 +14,7 @@ import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; import com.google.common.collect.Lists; -public class PrintingPressCsvReader implements FactoryReader { +public class PrintingPressCsvReader implements IFactoryReader { /** * The plugin instance diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java index 3482bbb3..7d0cdb13 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java @@ -12,7 +12,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -public class PrintingPressCsvWriter implements FactoryWriter { +public class PrintingPressCsvWriter implements IFactoryWriter { static final int VERSION = 1; diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java index e4b5b54c..9d7333e2 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java @@ -20,7 +20,7 @@ import com.google.common.collect.Sets; import com.google.common.io.Files; -public class ProductionCsvReader implements FactoryReader{ +public class ProductionCsvReader implements IFactoryReader{ /** * The plugin instance diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java index ed773ae0..47f1575a 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java @@ -14,7 +14,7 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.google.common.io.Files; -public class ProductionCsvWriter implements FactoryWriter { +public class ProductionCsvWriter implements IFactoryWriter { File mFile; diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java index c1f1a86f..a3f4c5fd 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java @@ -23,7 +23,7 @@ import com.google.common.collect.Sets; import com.google.common.io.Files; -public class RepairCsvReader implements FactoryReader{ +public class RepairCsvReader implements IFactoryReader{ /** * The plugin instance diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java index b826e3dc..81cd5f4a 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java @@ -17,7 +17,7 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.google.common.io.Files; -public class RepairCsvWriter implements FactoryWriter { +public class RepairCsvWriter implements IFactoryWriter { File mFile; From 70dc354cef8e330ea833a78d85b85ce44e0652a2 Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 8 Jun 2015 23:46:59 -0500 Subject: [PATCH 083/459] removed craftbukkit dependency (haz spigot) --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index f75615a4..46df3fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -30,12 +30,6 @@ - - org.bukkit.craftbukkit - craftbukkit - 1.8.3 - provided - org.spigotmc spigot From 4c27d02c7fd6b84d12e8b3aa087fc463cc1587b9 Mon Sep 17 00:00:00 2001 From: Valadian Date: Mon, 8 Jun 2015 23:51:32 -0500 Subject: [PATCH 084/459] removed bukkit repo --- pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index 46df3fbf..64873197 100644 --- a/pom.xml +++ b/pom.xml @@ -51,10 +51,6 @@ - - bukkit-repo - http://repo.bukkit.org/content/groups/public/ - spigot-repo https://hub.spigotmc.org/nexus/content/groups/public/ From 46a6f9f2af1e4cdc1d65255e5bb9e6261b355b45 Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Tue, 9 Jun 2015 01:02:40 -0400 Subject: [PATCH 085/459] version 1.4.0 --- plugin.yml | 2 +- pom.xml | 6 +++--- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin.yml b/plugin.yml index 648d1ac7..6aec818d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: FactoryMod main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.3.5 +version: 1.4.0 depend: [NameLayer, Citadel] diff --git a/pom.xml b/pom.xml index 64873197..fe1a6dc3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.3.5-${build.number} + 1.4.0-${build.number} FactoryMod https://github.com/Civcraft/FactoryMod @@ -52,8 +52,8 @@ - spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ Jenkins-repo diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 1b07c393..23a3ef82 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -44,7 +44,7 @@ public class FactoryModPlugin extends JavaPlugin { /* Special Values */ - public static final String VERSION = "v1.0"; //Current version of plugin + public static final String VERSION = "v1.4.0"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name From 0b375f63cbe15830e0b5994c9a8bb9f6e8376dc2 Mon Sep 17 00:00:00 2001 From: Valadian Date: Thu, 11 Jun 2015 11:04:05 -0500 Subject: [PATCH 086/459] oops. forgot compactor reader/writer --- .../persistence/CompactorCsvReader.java | 114 ++++++++++++++++++ .../persistence/CompactorCsvWriter.java | 87 +++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java new file mode 100644 index 00000000..c0289a77 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java @@ -0,0 +1,114 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.Factorys.Compactor.CompactorMode; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.common.io.Files; + +public class CompactorCsvReader implements IFactoryReader{ + + /** + * The plugin instance + */ + FactoryModPlugin mPlugin; + + /** + * The CSV file being read + */ + File mFile; + + static final int VERSION = 1; + + public CompactorCsvReader(FactoryModPlugin plugin, File file) { + mPlugin = plugin; + mFile = file; + } + + @Override + public synchronized List read() { + + List factory = Lists.newArrayList(); + + + if(!mFile.exists() || mFile.isDirectory()) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") + .append(mFile.getName()).append(" is not a valid file!").toString()); + return factory; + } + + ObjectInputStream ois; + + try { + FileInputStream fileInputStream = new FileInputStream(mFile); + ois = new ObjectInputStream(fileInputStream); + } catch (Exception e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); + return factory; + } + + int lineNum = 1; + + try { + int version = ois.readInt(); + if(version != VERSION) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); + ois.close(); + return factory; + } + + int count = ois.readInt(); + for (int i = 0; i < count; i++) + { + try { + factory.add(read(ois)); + } catch (Exception ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); + break; + } + } + } catch (IOException ex) { + FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); + } + //TODO: ensure everything is closed + return factory; + } + + //TODO: split into common csv file handler and factory type parser + public Compactor read(ObjectInputStream ois) throws Exception { + String worldName = ois.readUTF(); + World world = Bukkit.getWorld(worldName); + + Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); + + CompactorMode mode = CompactorMode.byId(ois.readInt()); + double currentRepair = ois.readDouble(); + long timeDisrepair = ois.readLong(); + + return new Compactor(centerLocation, inventoryLocation, powerLocation, false, mPlugin.getCompactorProperties(), + mode, currentRepair, timeDisrepair); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java new file mode 100644 index 00000000..e7010a04 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java @@ -0,0 +1,87 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.nio.charset.Charset; +import java.util.List; + +import org.bukkit.Location; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.google.common.io.Files; + +public class CompactorCsvWriter implements IFactoryWriter { + + File mFile; + + public CompactorCsvWriter(File file) { + mFile = file; + } + + @Override + public synchronized void write(List factories) { + FileBackup.backup(mFile); + + if(!mFile.exists()) { + try { + mFile.createNewFile(); + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + return; + } + } + + try { + FileOutputStream fileOutputStream = new FileOutputStream(mFile); + ObjectOutputStream oos= new ObjectOutputStream(fileOutputStream); + + int version = 1; + oos.writeInt(version); + oos.writeInt(factories.size()); + for (Compactor factory: factories) + { + Location centerLocation = factory.getCenterLocation(); + Location inventoryLocation = factory.getInventoryLocation(); + Location powerLocation = factory.getPowerSourceLocation(); + + oos.writeUTF(centerLocation.getWorld().getName()); + + oos.writeInt(centerLocation.getBlockX()); + oos.writeInt(centerLocation.getBlockY()); + oos.writeInt(centerLocation.getBlockZ()); + + oos.writeInt(inventoryLocation.getBlockX()); + oos.writeInt(inventoryLocation.getBlockY()); + oos.writeInt(inventoryLocation.getBlockZ()); + + oos.writeInt(powerLocation.getBlockX()); + oos.writeInt(powerLocation.getBlockY()); + oos.writeInt(powerLocation.getBlockZ()); + + oos.writeInt(factory.getMode().getId()); + oos.writeDouble(factory.getCurrentRepair()); + oos.writeLong(factory.getTimeDisrepair()); + } + + oos.flush(); + fileOutputStream.close(); + } catch (FileNotFoundException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") + .append(mFile.getName()).append("for writing: ").append(e.getMessage()).toString()); + return; + } catch (IOException e) { + FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") + .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); + } + + } +} From 26e84d310fecbd0eb25d1d25ba290fb5e4a2ba59 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 12 Jun 2015 02:43:36 -0400 Subject: [PATCH 087/459] For issue #94 Just copying back in Rourke's code that was regressed out --- .../listeners/FactoryModListener.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index baab613f..63ae3676 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,6 +2,9 @@ import java.util.List; +import net.minecraft.server.v1_8_R2.ItemStack; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -18,6 +21,11 @@ import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCreativeEvent; +import org.bukkit.event.inventory.InventoryInteractEvent; +import org.bukkit.inventory.AnvilInventory; +import org.bukkit.inventory.Inventory; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; @@ -489,4 +497,23 @@ public void entityTeleportEvent(EntityPortalEvent event){ event.setCancelled(true); } } + + @EventHandler(priority = EventPriority.NORMAL) + public void anvilRepairEvent(InventoryClickEvent event){ + if (!FactoryModPlugin.SHOULD_SET_ANVIL_COST) + return; + if (event instanceof InventoryCreativeEvent) + return; + Inventory inv = event.getClickedInventory(); + if (!(inv instanceof AnvilInventory)) + return; + + org.bukkit.inventory.ItemStack stack = inv.getItem(2); + if (stack == null) + return; + + ItemStack s = CraftItemStack.asNMSCopy(stack); + s.setRepairCost(FactoryModPlugin.GET_SET_ANVIL_COST); + inv.setItem(3, (CraftItemStack.asBukkitCopy(s))); + } } From 930cad4a1c146da0fadb87865a8795466bc8c1c5 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 13 Jun 2015 20:34:52 -0400 Subject: [PATCH 088/459] Fix for issue #96, null pointer as caused by misconfiguration of compactor --- config.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/config.yml b/config.yml index 13206cee..e8114f66 100644 --- a/config.yml +++ b/config.yml @@ -101,25 +101,25 @@ compactor: material: 'COAL' amount: 1 durability: 1 - fuel_time: 5 - repair_multiple: 1 - name: 'Compactor' - production_time: 20 - costs: - construction: - DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 64 - repair: - EMERALD: - material: 'EMERALD_BLOCK' - amount: 16 - recipe: - CRATE: - material: 'CHEST' - amount: 1 - display_name: Crate - lore: A crate for compacting items + fuel_time: 5 + repair_multiple: 1 + name: 'Compactor' + production_time: 20 + costs: + construction: + DIAMOND: + material: 'DIAMOND_BLOCK' + amount: 64 + repair: + EMERALD: + material: 'EMERALD_BLOCK' + amount: 16 + recipe: + CRATE: + material: 'CHEST' + amount: 1 + display_name: Crate + lore: A crate for compacting items compact_lore: Compacted Item copy_defaults: false general: From c31037018133df9592b55b47ed2ef3139b9d4ad6 Mon Sep 17 00:00:00 2001 From: ProgrammerDan Date: Tue, 2 Jun 2015 23:08:39 -0700 Subject: [PATCH 089/459] Repair factory only --- config.yml | 32 +++++++++++++------ .../igotyou/FactoryMod/FactoryModPlugin.java | 2 ++ .../igotyou/FactoryMod/FactoryObject.java | 4 +-- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/config.yml b/config.yml index e8114f66..b77f3116 100644 --- a/config.yml +++ b/config.yml @@ -79,22 +79,34 @@ repair_factory: amount: 1 durability: 1 fuel_time: 5 - repair_multiple: 1 + repair_multiple: 10 name: 'Repair Factory' production_time: 20 costs: construction: - A_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 + Coal Ore: + material: 'COAL_ORE' + amount: 256 + Iron Ore: + material: 'IRON_ORE' + amount: 8 + Redstone Ore: + material: 'REDSTONE_ORE' + amount: 8 + Gold Ore: + material: 'GOLD_ORE' + amount: 8 repair: - AA_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 + Coal Ore: + material: 'COAL_ORE' + amount: 3 recipe: - AAA_DIAMOND: - material: 'DIAMOND_BLOCK' - amount: 1 + Coal Ore: + material: 'COAL_ORE' + amount: 64 + Emerald Blocks: + material: 'EMERALD_BLOCK' + amount: 8 compactor: fuel: Charcoal: diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 6b63cb9d..5eca46de 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -406,9 +406,11 @@ public void initConfig() ConfigurationSection configPrintingPresses = config.getConfigurationSection("printing_presses"); ConfigurationSection configNetherFactory = config.getConfigurationSection("nether_factory"); + ConfigurationSection configRepairFactory=config.getConfigurationSection("repair_factory"); ConfigurationSection configCompactor=config.getConfigurationSection("compactor"); printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); + repairFactoryProperties = RepairFactoryProperties.fromConfig(this, configRepairFactory); compactorProperties = CompactorProperties.fromConfig(this, configCompactor); sendConsoleMessage("Finished initializing FactoryMod Config."); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java index 2a309ebd..d0376a69 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ b/src/com/github/igotyou/FactoryMod/FactoryObject.java @@ -34,8 +34,8 @@ public enum FactoryType PRODUCTION, PRINTING_PRESS, REPAIR_FACTORY, - NETHER_FACTORY, - COMPACTOR + COMPACTOR, + NETHER_FACTORY } From 24deb2f9abdf3f7afdd1d843f2ff70fc330c473c Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sun, 14 Jun 2015 21:50:07 -0400 Subject: [PATCH 090/459] getting rid of warnings and dead code, mostly imports --- .../igotyou/FactoryMod/ConfigManager.java | 10 ------- .../igotyou/FactoryMod/FactoryObject.java | 22 ++++----------- .../FactoryMod/Factorys/ABaseFactory.java | 3 +- .../FactoryMod/Factorys/Compactor.java | 4 +-- .../igotyou/FactoryMod/Factorys/IFactory.java | 5 ++-- .../FactoryMod/Factorys/NetherFactory.java | 28 +++++++------------ .../FactoryMod/Factorys/PrintingPress.java | 4 +-- .../Factorys/ProductionFactory.java | 21 ++------------ .../FactoryMod/Factorys/RepairFactory.java | 4 --- .../listeners/FactoryModListener.java | 12 ++++---- .../listeners/NoteStackListener.java | 7 +---- .../igotyou/FactoryMod/managers/AManager.java | 5 +--- .../FactoryMod/managers/CompactorManager.java | 5 ---- .../managers/NetherFactoryManager.java | 9 ------ .../managers/PrintingPressManager.java | 10 ------- .../managers/ProductionFactoryManager.java | 9 ------ .../managers/RepairFactoryManager.java | 24 +--------------- .../persistence/CompactorCsvReader.java | 10 ------- .../persistence/CompactorCsvWriter.java | 6 ---- .../persistence/NetherCsvReader.java | 14 +++------- .../persistence/PersistenceFactory.java | 1 + .../persistence/RepairCsvReader.java | 8 ------ .../persistence/RepairCsvWriter.java | 5 ---- .../properties/IFactoryProperties.java | 3 -- .../properties/PrintingPressProperties.java | 3 -- .../FactoryMod/recipes/ProductionRecipe.java | 6 +--- 26 files changed, 38 insertions(+), 200 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/ConfigManager.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigManager.java b/src/com/github/igotyou/FactoryMod/ConfigManager.java deleted file mode 100644 index 34cae101..00000000 --- a/src/com/github/igotyou/FactoryMod/ConfigManager.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.igotyou.FactoryMod; - -public class ConfigManager { - private static final String CONFIG_GENERAL = "config.yml"; - private static final String CONFIG_CRAFTING = "crafting.yml"; - private static final String CONFIG_PRODUCTON = "production.yml"; - private static final String CONFIG_PRINTING = "printing.yml"; - private static final String CONFIG_NETHER = "nether.yml"; - -} diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java index d0376a69..623b66de 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ b/src/com/github/igotyou/FactoryMod/FactoryObject.java @@ -9,8 +9,6 @@ import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import java.util.Date; - //original file: /** * MachineObject.java @@ -28,7 +26,7 @@ */ public class FactoryObject { - //the diffrent factory types, NOTE: these are not the sub-factory types, these are the main types. + //the different factory types, NOTE: these are not the sub-factory types, these are the main types. public enum FactoryType { PRODUCTION, @@ -197,19 +195,9 @@ public boolean getActive() */ public boolean isWhole(boolean initCall) { - //Check if power source exists - if(factoryPowerSourceLocation.getBlock().getType().getId()== 61 || factoryPowerSourceLocation.getBlock().getType().getId()== 62) - { - //Check inventory location - if(factoryInventoryLocation.getBlock().getType().getId()== 54) - { - //Check Interaction block location - if(factoryLocation.getBlock().getType().getId()==FactoryModPlugin.CENTRAL_BLOCK_MATERIAL.getId()) - { - return true; - } - } - } - return false; + // Check the types of the known locations for power, inventory, and interaction for the expected materials + //TODO: check reinforcement groups? + return (factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation.getBlock().getType() == Material.BURNING_FURNACE) + && (factoryInventoryLocation.getBlock().getType() == Material.CHEST) && (factoryLocation.getBlock().getType() == FactoryModPlugin.CENTRAL_BLOCK_MATERIAL); } } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index a2dbd4ad..bc62e04d 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; -import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -22,10 +21,10 @@ import com.github.igotyou.FactoryMod.FactoryObject; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public abstract class ABaseFactory extends FactoryObject implements IFactory { public static final BlockFace[] REDSTONE_FACES = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN}; diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index bdac7fe0..8f013b95 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -11,14 +11,12 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; -import com.github.igotyou.FactoryMod.managers.CompactorManager; import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public class Compactor extends ABaseFactory { diff --git a/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java index abbb0ffb..651b2316 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java @@ -1,12 +1,11 @@ package com.github.igotyou.FactoryMod.Factorys; +import java.util.List; + import org.bukkit.Location; -import com.github.igotyou.FactoryMod.properties.AFactoryProperties; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; - -import java.util.List; //original file: /** * Machine.java diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 7c355a42..3f572e0c 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -492,32 +492,24 @@ public Location getOverworldTeleportPlatform() public boolean isWhole(boolean initCall) { //Check if power source exists - if(factoryPowerSourceLocation.getBlock().getType().getId()== 61 || factoryPowerSourceLocation.getBlock().getType().getId()== 62) + if(super.isWhole(initCall)) { - //Check inventory location - if(factoryInventoryLocation.getBlock().getType().getId()== 54) + if (netherTeleportPlatform == null && overworldTeleportPlatform == null && initCall) { - //Check Interaction block location - if(factoryLocation.getBlock().getType()==FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) + return true; + } + else + { + if (netherTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) { - if (netherTeleportPlatform == null && overworldTeleportPlatform == null && initCall) + if (overworldTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) { return true; } - else - { - if (netherTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - if (overworldTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - return true; - } - } - } - } + } } } - return false; + return false; } public boolean isInTicketMode() diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index 7149e9ee..0114245b 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -3,12 +3,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.logging.Logger; -import java.util.logging.Level; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.inventory.Inventory; diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java index aaf2325d..d6d7cc7d 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java @@ -1,21 +1,11 @@ package com.github.igotyou.FactoryMod.Factorys; -import org.bukkit.Bukkit; +import java.util.ArrayList; +import java.util.List; + import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.block.Furnace; -import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.Attachable; -import org.bukkit.material.Lever; -import org.bukkit.material.MaterialData; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.FactoryObject; -import com.github.igotyou.FactoryMod.listeners.RedstoneListener; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.recipes.IRecipe; @@ -26,11 +16,6 @@ import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - public class ProductionFactory extends ABaseFactory { diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 5324acde..f8dd3be1 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -6,15 +6,11 @@ import net.minecraft.server.v1_8_R2.ItemStack; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; -import com.github.igotyou.FactoryMod.managers.RepairFactoryManager; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 23c4d2fa..df724646 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -3,11 +3,11 @@ import java.util.List; import net.minecraft.server.v1_8_R2.ItemStack; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -17,15 +17,15 @@ import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityPortalEvent; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryCreativeEvent; -import org.bukkit.event.inventory.InventoryInteractEvent; import org.bukkit.inventory.AnvilInventory; import org.bukkit.inventory.Inventory; + import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; @@ -35,8 +35,8 @@ import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.managers.FactoryManagerService; import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.github.igotyou.FactoryMod.utility.StringUtils; public class FactoryModListener implements Listener { diff --git a/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java b/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java index 3d312c16..623b6c10 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java @@ -13,25 +13,20 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; -import org.bukkit.event.inventory.PrepareItemCraftEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.meta.ItemMeta; - //import sun.misc.Regexp; - import com.github.igotyou.FactoryMod.FactoryModPlugin; public class NoteStackListener implements Listener { - private FactoryModPlugin plugin; + private static final Pattern stackableRegexp = Pattern.compile("^(§2.*?)( \\(x([1-9][0-9]*)\\))?$"); private static final Pattern nameRegexp = Pattern.compile("^(.*?)( §2x([1-9][0-9]*))?$"); private static final int SCALE_FACTOR = 4; private static final int MAX_SCALE = 64; public NoteStackListener(FactoryModPlugin plugin) { - this.plugin = plugin; } @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) diff --git a/src/com/github/igotyou/FactoryMod/managers/AManager.java b/src/com/github/igotyou/FactoryMod/managers/AManager.java index 55bc0375..cda4b9ea 100644 --- a/src/com/github/igotyou/FactoryMod/managers/AManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/AManager.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.File; import java.util.ArrayList; import java.util.Iterator; @@ -8,13 +7,11 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.FileBackup; import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.StringUtils; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; +import com.github.igotyou.FactoryMod.utility.StringUtils; public abstract class AManager implements IManager{ diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index 7c2feb38..bcee3681 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -2,16 +2,11 @@ import org.bukkit.Location; -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; - import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.Compactor; import com.github.igotyou.FactoryMod.utility.InteractionResponse; public class CompactorManager extends AManager { - - private ReinforcementManager rm = Citadel.getReinforcementManager(); public CompactorManager(FactoryModPlugin plugin) { super(plugin); diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index 13d0c6c6..c1deadc9 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -1,9 +1,5 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.File; -import java.util.Iterator; -import java.util.List; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -16,16 +12,11 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.FileBackup; -import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.google.common.collect.Lists; //original file: /** diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 5d0e650b..ba60eb0a 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -1,27 +1,17 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.File; -import java.util.Iterator; -import java.util.List; - import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.FileBackup; -import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.google.common.collect.Lists; //original file: /** diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java index 4ee458d2..28cb3bd7 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java @@ -1,8 +1,5 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.File; -import java.util.Iterator; -import java.util.List; import java.util.Map; import org.bukkit.Location; @@ -12,18 +9,12 @@ import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.FileBackup; -import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.google.common.collect.Lists; //original file: /** diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index a2046daf..1cf8d437 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -1,38 +1,17 @@ package com.github.igotyou.FactoryMod.managers; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; - import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.Factorys.RepairFactory; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.managers.IManager; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public class RepairFactoryManager extends AManager{ @@ -45,7 +24,6 @@ public RepairFactoryManager(FactoryModPlugin plugin) { public Class getFactoryType() { return RepairFactory.class; } - private ReinforcementManager rm = Citadel.getReinforcementManager(); //SEE RepairCsvReader.java // @Override diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java index c0289a77..fd01cfb3 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java @@ -1,15 +1,10 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; -import java.nio.charset.Charset; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -17,13 +12,8 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.Compactor; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; import com.github.igotyou.FactoryMod.Factorys.Compactor.CompactorMode; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.common.io.Files; public class CompactorCsvReader implements IFactoryReader{ diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java index e7010a04..dbaf07dd 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java @@ -1,22 +1,16 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; -import java.nio.charset.Charset; import java.util.List; import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.Compactor; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.google.common.io.Files; public class CompactorCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index c00c5b31..d8c3946c 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -1,12 +1,9 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; -import java.nio.charset.Charset; import java.util.List; import org.bukkit.Location; @@ -14,10 +11,8 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; import com.google.common.collect.Lists; -import com.google.common.io.Files; public class NetherCsvReader implements IFactoryReader { @@ -106,11 +101,10 @@ public NetherFactory read(ObjectInputStream input) throws Exception { double currentRepair = input.readDouble(); long timeDisrepair = input.readLong(); - return null; -// return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, -// active, currentRepair, timeDisrepair, -// mode, -// mPlugin.getNetherFactoryProperties(), this); + return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, + active, currentRepair, timeDisrepair, + mode, + mPlugin.getNetherFactoryProperties(), this); } } diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java index accec9db..ee170ea1 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -19,6 +19,7 @@ public class PersistenceFactory { //TODO: use type inference for return + @SuppressWarnings("unchecked") public static FactoryDao getFactoryDao(IManager factoryManager) { if(FactoryModPlugin.PERSISTENCE_FORMAT.toLowerCase().equals("txt")) { diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java index a3f4c5fd..f539919e 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java @@ -1,27 +1,19 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; -import java.nio.charset.Charset; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.Factorys.RepairFactory; import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.common.io.Files; public class RepairCsvReader implements IFactoryReader{ diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java index 81cd5f4a..33cc991d 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java @@ -1,21 +1,16 @@ package com.github.igotyou.FactoryMod.persistence; -import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; -import java.nio.charset.Charset; import java.util.List; import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.Factorys.RepairFactory; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.google.common.io.Files; public class RepairCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java index eec0f76b..e206f7dc 100644 --- a/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java @@ -1,8 +1,5 @@ package com.github.igotyou.FactoryMod.properties; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - //original file: /** * Properties.java diff --git a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java index a50a723d..4e738f1e 100644 --- a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java @@ -1,12 +1,9 @@ package com.github.igotyou.FactoryMod.properties; -import java.util.List; - import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 483b3162..712acd5b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,17 +1,13 @@ package com.github.igotyou.FactoryMod.recipes; -import java.util.HashMap; -import java.util.Random; import java.util.ArrayList; import java.util.List; -import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import org.bukkit.inventory.Inventory; - public class ProductionRecipe implements IRecipe { private String title; From 3e73759418f689147ed5a9e47c288a5f7f64512b Mon Sep 17 00:00:00 2001 From: Travis Christian Date: Sun, 14 Jun 2015 21:50:52 -0400 Subject: [PATCH 091/459] #96 missing initialization on managers --- .../FactoryMod/managers/FactoryManagerService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java index 086c40d3..4c83982e 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java @@ -13,7 +13,7 @@ import com.github.igotyou.FactoryMod.Factorys.IFactory; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.google.common.collect.Lists; + //original file: /** * MachinesManager.java @@ -62,18 +62,16 @@ public FactoryManagerService(FactoryModPlugin plugin) */ private void initializeManagers() { - //managers = new ArrayList>(); + managers = new ArrayList>(); listeners = new ArrayList(); - //if (FactoryModPlugin.PRODUCTION_ENEABLED) - //{ managers.add(new ProductionFactoryManager(plugin)); managers.add(new PrintingPressManager(plugin)); managers.add(new RepairFactoryManager(plugin)); managers.add(new CompactorManager(plugin)); managers.add(new NetherFactoryManager(plugin)); - //} } + /** * When plugin disabled, this is called. */ From c206a5923047b096d94c27477a9b48ef111de790 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 15 Jun 2015 21:01:34 -0400 Subject: [PATCH 092/459] NetherFactory needs to recompute scaling factor during repair, so NetherFactoryManager is a hard dependency. Simply fixed compilation error by pulling the manager from the plugin. Not tested locally. --- .../igotyou/FactoryMod/persistence/NetherCsvReader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index d8c3946c..0fe0a547 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -12,6 +12,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.NetherFactory; import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; +import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; import com.google.common.collect.Lists; public class NetherCsvReader implements IFactoryReader { @@ -102,9 +103,8 @@ public NetherFactory read(ObjectInputStream input) throws Exception { long timeDisrepair = input.readLong(); return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, - active, currentRepair, timeDisrepair, - mode, - mPlugin.getNetherFactoryProperties(), this); + active, currentRepair, timeDisrepair, mode, mPlugin.getNetherFactoryProperties(), + (NetherFactoryManager) mPlugin.manager.getManager(NetherFactoryManager.class)); } } From a05363cb2e0777c70711967d87efcc906c12a6d6 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 16 Jun 2015 00:53:52 -0400 Subject: [PATCH 093/459] Adding compactor create --- .../FactoryMod/managers/CompactorManager.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index bcee3681..9c407bb9 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -1,10 +1,17 @@ package com.github.igotyou.FactoryMod.managers; import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; +import com.github.igotyou.FactoryMod.utility.ItemList; +import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; public class CompactorManager extends AManager { @@ -15,7 +22,27 @@ public CompactorManager(FactoryModPlugin plugin) { @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation) { - return null; + CompactorProperties compactorProperties = plugin.getCompactorProperties(); + + if (!factoryExistsAt(factoryLocation)) + { + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + ItemList inputs = compactorProperties.getConstructionMaterials(); + boolean hasMaterials = inputs.allIn(chestInventory); + if (hasMaterials) + { + Compactor production = new Compactor(factoryLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties()); + if (compactorProperties.getConstructionMaterials().removeFrom(production.getInventory())) + { + addFactory(production); + return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + compactorProperties.getName()); + } + } + return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); + } + return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + compactorProperties.getName() + " there!"); } @Override From 1d79373b102f84ec4b37f1ea5736a445adb3f619 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 16 Jun 2015 21:42:18 -0400 Subject: [PATCH 094/459] Adding Crate recipe and some balanced costs; with these, compacting a DC costs about 2.5d --- config.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index b77f3116..37d0a4a6 100644 --- a/config.yml +++ b/config.yml @@ -119,13 +119,38 @@ compactor: production_time: 20 costs: construction: - DIAMOND: - material: 'DIAMOND_BLOCK' + Crate: + material: CHEST + amount: 64 + display_name: Crate + lore: A crate for compacting items + Redstone: + material: REDSTONE + amount: 320 + Piston: + material: PISTON_BASE amount: 64 + Diamond: + material: DIAMOND + amount: 8 + 'Civtest Lock': + material: BEDROCK + amount: 1 repair: - EMERALD: - material: 'EMERALD_BLOCK' - amount: 16 + Crate: + material: CHEST + amount: 6 + display_name: Crate + lore: A crate for compacting items + Redstone: + material: REDSTONE + amount: 32 + Piston: + material: PISTON_BASE + amount: 6 + Diamond: + material: DIAMOND + amount: 1 recipe: CRATE: material: 'CHEST' @@ -1861,6 +1886,7 @@ production_factories: - Craft_Item_Frames - Craft_Bookshelfs - Bastion_Framing + - Craft_Crate repair_multiple: 10 repair_inputs: Paper: @@ -7761,3 +7787,25 @@ production_recipes: Sea Lantern: material: SEA_LANTERN amount: 16 + Craft_Crate: + name: Craft Compactor Crate + production_time: 16 + inputs: + Chest: + material: CHEST + amount: 16 + Piston: + material: PISTON_BASE + amount: 8 + Redstone: + Material: REDSTONE + amount: 32 + 'Civtest Lock': + material: BEDROCK + amount: 1 + outputs: + Crate: + material: CHEST + amount: 16 + display_name: Crate + lore: A crate for compacting items \ No newline at end of file From fabd40d1e4f141ed111d6a146cbe4a143e0507c8 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Wed, 17 Jun 2015 04:05:13 -0400 Subject: [PATCH 095/459] Various bug fixes, mostly. --- config.yml | 2 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 13 ++++++-- .../FactoryMod/Factorys/RepairFactory.java | 33 +++++++++++-------- .../managers/FactoryManagerService.java | 4 +++ 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/config.yml b/config.yml index 37d0a4a6..e62d92f7 100644 --- a/config.yml +++ b/config.yml @@ -7798,7 +7798,7 @@ production_recipes: material: PISTON_BASE amount: 8 Redstone: - Material: REDSTONE + material: REDSTONE amount: 32 'Civtest Lock': material: BEDROCK diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 5eca46de..2b6ecf1b 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -8,6 +8,7 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.craftbukkit.libs.jline.internal.Log; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.inventory.ShapedRecipe; @@ -278,13 +279,14 @@ public void initConfig() for (String disable : disabledRecipes) { String mat = config.getString("crafting.disable." + disable + ".material",disable); - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disable)); + ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); int dur = config.getInt("crafting.disable." + disable + ".durability", 0); short s = (short) dur; recipeItemStack.setDurability(s); List tempList = getServer().getRecipesFor(recipeItemStack); for (Recipe rec : tempList) { + Log.info("Disabling recipe " + disable + " - " + rec.getResult().getType().name()); removeRecipe(rec); } } @@ -304,10 +306,12 @@ public void initConfig() for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) { - shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); + shapelessRecipe.addIngredient(input.getAmount(), input.getType()); + //shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); } recipe = shapelessRecipe; + Log.info("Enabling shapeless recipe " + recipeName + " - " + recipe.getResult().getType().name()); } else { @@ -317,11 +321,14 @@ public void initConfig() for(String inputKey : configSection.getConfigurationSection("inputs").getKeys(false)) { ItemStack input = getItems(configSection.getConfigurationSection("inputs." + inputKey)).get(0); - shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); + shapedRecipe.setIngredient(inputKey.charAt(0),input.getType()); + //shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); } recipe = shapedRecipe; + Log.info("Enabling shaped recipe " + recipeName + " - " + recipe.getResult().getType().name()); } + Bukkit.addRecipe(recipe); } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index f8dd3be1..8fe86422 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.logging.Logger; import net.minecraft.server.v1_8_R2.ItemStack; @@ -24,6 +25,8 @@ public class RepairFactory extends ABaseFactory{ private RepairFactoryProperties rfp; private RepairFactoryMode mode; + private static Logger log = Logger.getLogger(RepairFactory.class.getName()); + // Constructor for when initial creation of factory. public RepairFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, @@ -148,28 +151,22 @@ else if (currentProductionTimer >= getProductionTime()){ @Override public List togglePower(){ + log.info("Repair factory at " + this.factoryLocation.toString() + " power toggle attempt"); List response=new ArrayList(); //if the factory is turned off - if (!active) - { + if (!active) { //if the factory isn't broken or the current recipe can repair it - if(!isBroken()||isRepairing()) - { + if ( !isBroken() || isRepairing() ) { //is there fuel enough for at least once energy cycle? - if (isFuelAvailable()) - { + if ( isFuelAvailable() ) { //are there enough materials for the current recipe in the chest? - if (checkHasMaterials()) - { + if ( checkHasMaterials() ) { //turn the factory on powerOn(); //return a success message response.add(new InteractionResponse(InteractionResult.SUCCESS, "Factory activated!")); return response; - } - //there are not enough materials for the recipe! - else - { + } else { //there are not enough materials for the recipe! //return a failure message, containing which materials are needed for the recipe //[Requires the following: Amount Name, Amount Name.] //[Requires one of the following: Amount Name, Amount Name.] @@ -232,7 +229,11 @@ public double getProductionTime() { @Override public ItemList getInputs() { - return rfp.getRecipeMaterials(); + if (mode == RepairFactoryMode.RESET_ITEMS) { + return rfp.getRecipeMaterials(); + } else { + return new ItemList(); + } } @Override @@ -242,7 +243,11 @@ public ItemList getOutputs() { @Override public ItemList getRepairs() { - return rfp.getRepairMaterials(); + if (mode == RepairFactoryMode.REPAIR) { + return rfp.getRepairMaterials(); + } else { + return new ItemList(); + } } @Override diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java index 4c83982e..4d0b8c9e 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java @@ -207,6 +207,10 @@ public InteractionResponse createFactory(Location centralLocation, } } + if (response == null) { + response = new InteractionResponse(InteractionResult.FAILURE, "Couldn't create a factory, invalid ingredients"); + } + FactoryModPlugin.sendConsoleMessage("The factory could not be created: " + response.getInteractionMessage()); return response; } From b21c8d10f966df112d3b12fe48b56b2f34dc62cd Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Wed, 17 Jun 2015 08:56:36 -0400 Subject: [PATCH 096/459] Wrong logger, fixed --- src/com/github/igotyou/FactoryMod/FactoryModPlugin.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 2b6ecf1b..ce1706bf 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -8,7 +8,6 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.craftbukkit.libs.jline.internal.Log; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.inventory.ShapedRecipe; @@ -286,7 +285,7 @@ public void initConfig() List tempList = getServer().getRecipesFor(recipeItemStack); for (Recipe rec : tempList) { - Log.info("Disabling recipe " + disable + " - " + rec.getResult().getType().name()); + sendConsoleMessage("Disabling recipe " + disable + " - " + rec.getResult().getType().name()); removeRecipe(rec); } } @@ -311,7 +310,7 @@ public void initConfig() } recipe = shapelessRecipe; - Log.info("Enabling shapeless recipe " + recipeName + " - " + recipe.getResult().getType().name()); + sendConsoleMessage("Enabling shapeless recipe " + recipeName + " - " + recipe.getResult().getType().name()); } else { @@ -326,7 +325,7 @@ public void initConfig() } recipe = shapedRecipe; - Log.info("Enabling shaped recipe " + recipeName + " - " + recipe.getResult().getType().name()); + sendConsoleMessage("Enabling shaped recipe " + recipeName + " - " + recipe.getResult().getType().name()); } Bukkit.addRecipe(recipe); From 732e50feccf77fd629f6c6f573d89b0bbbc61839 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Wed, 17 Jun 2015 22:55:43 -0400 Subject: [PATCH 097/459] Few more fixes, hopefully. Compactor would create with too many items in chest, which is against convention. Repair factory wasn't outputting a failure or success message on creation, adding. --- .../igotyou/FactoryMod/FactoryModPlugin.java | 3 +- .../FactoryMod/managers/CompactorManager.java | 30 +++++++++---------- .../managers/RepairFactoryManager.java | 27 ++++++++++------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index ce1706bf..28386d73 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -277,6 +277,7 @@ public void initConfig() List disabledRecipes = config.getStringList("crafting.disable"); for (String disable : disabledRecipes) { + sendConsoleMessage("Attempting to disable recipes for " + disable); String mat = config.getString("crafting.disable." + disable + ".material",disable); ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); int dur = config.getInt("crafting.disable." + disable + ".durability", 0); @@ -285,7 +286,7 @@ public void initConfig() List tempList = getServer().getRecipesFor(recipeItemStack); for (Recipe rec : tempList) { - sendConsoleMessage("Disabling recipe " + disable + " - " + rec.getResult().getType().name()); + sendConsoleMessage("Disabling recipe " + rec.getResult().getType().name()); removeRecipe(rec); } } diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index 9c407bb9..353c30df 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -22,25 +22,25 @@ public CompactorManager(FactoryModPlugin plugin) { @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation) { - CompactorProperties compactorProperties = plugin.getCompactorProperties(); - - if (!factoryExistsAt(factoryLocation)) - { - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList inputs = compactorProperties.getConstructionMaterials(); - boolean hasMaterials = inputs.allIn(chestInventory); - if (hasMaterials) - { + CompactorProperties compactorProperties = plugin.getCompactorProperties(); + + if (!factoryExistsAt(factoryLocation)) { + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + ItemList inputs = compactorProperties.getConstructionMaterials(); + + if (inputs.oneIn(chestInventory)) { Compactor production = new Compactor(factoryLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties()); - if (compactorProperties.getConstructionMaterials().removeFrom(production.getInventory())) - { - addFactory(production); + inputs.removeFrom(production.getInventory()); + + if (addFactory(production).getInteractionResult() == InteractionResult.FAILURE) { + return new InteractionResponse(InteractionResult.FAILURE, "Unable to create a " + compactorProperties.getName()); + } else { return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + compactorProperties.getName()); } } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); + return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest to create a " + compactorProperties.getName()); } return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + compactorProperties.getName() + " there!"); } diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 1cf8d437..d9de9c39 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -100,21 +100,26 @@ public Class getFactoryType() { public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation) { RepairFactoryProperties repairFactoryProperties = plugin.getRepairFactoryProperties(); - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); + if(!factoryExistsAt(factoryLocation)) { + Block inventoryBlock = inventoryLocation.getBlock(); + Chest chest = (Chest) inventoryBlock.getState(); + Inventory chestInventory = chest.getInventory(); + ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); + if (constructionMaterials.oneIn(chestInventory)){ - RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties/*, - this*/); - repairFactoryProperties.getConstructionMaterials().removeFrom(chestInventory); - return addFactory(factory); + RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties); + constructionMaterials.removeFrom(chestInventory); + + if (addFactory(factory).getInteractionResult() == InteractionResult.FAILURE) { + return new InteractionResponse(InteractionResult.FAILURE, "Unable to construct a " + repairFactoryProperties.getName()); + } else { + return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created a " + repairFactoryProperties.getName()); + } } - else - return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly."); + return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly to create a " + repairFactoryProperties.getName()); } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); + return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + repairFactoryProperties.getName() + " there!"); } public boolean isClear(RepairFactory factory){ From 94a55e23bf0e8f29b944ff03f5fbacaf1e963afc Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Wed, 17 Jun 2015 23:51:23 -0400 Subject: [PATCH 098/459] Got recipe disabling working again. Basically rewrote it, it's better now anyway. Mostly. --- .../igotyou/FactoryMod/FactoryModPlugin.java | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 28386d73..94380691 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,5 +1,6 @@ package com.github.igotyou.FactoryMod; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -274,23 +275,33 @@ public void initConfig() SHOULD_SET_ANVIL_COST = config.getBoolean("general.should_default_anvil_cost", false); GET_SET_ANVIL_COST = config.getInt("general.set_default_anvil_cost", 37); - List disabledRecipes = config.getStringList("crafting.disable"); - for (String disable : disabledRecipes) - { - sendConsoleMessage("Attempting to disable recipes for " + disable); - String mat = config.getString("crafting.disable." + disable + ".material",disable); - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(mat)); - int dur = config.getInt("crafting.disable." + disable + ".durability", 0); - short s = (short) dur; - recipeItemStack.setDurability(s); - List tempList = getServer().getRecipesFor(recipeItemStack); - for (Recipe rec : tempList) - { - sendConsoleMessage("Disabling recipe " + rec.getResult().getType().name()); - removeRecipe(rec); + // Disable the following recipes + List toDisable = new ArrayList(); + ItemList disabledRecipes = getItems(config.getConfigurationSection("crafting.disable")); + for (NamedItemStack recipe : disabledRecipes) { + sendConsoleMessage("Attempting to disable recipes for " + recipe.getCommonName()); + + List tempList = getServer().getRecipesFor(recipe); + + for (Recipe potential : tempList) { + if (potential.getResult().isSimilar(recipe)) { + sendConsoleMessage("Found a disable recipe match " + potential.toString()); + toDisable.add(potential); + } } } - + + Iterator it = getServer().recipeIterator(); + while (it.hasNext()) { + Recipe recipe = it.next(); + for (Recipe disable : toDisable) { // why can't they just override equality tests?! + if (disable.getResult().isSimilar(recipe.getResult())) { + it.remove(); + sendConsoleMessage("Disabling recipe " + recipe.getResult().toString()); + } + } + } + //Enable the following recipes ConfigurationSection configCraftingEnable = config.getConfigurationSection("crafting.enable"); for (String recipeName : configCraftingEnable.getKeys(false)) From 6449063cfc7c903a0dd485ddec82e813d1a92bad Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Thu, 18 Jun 2015 01:46:24 -0400 Subject: [PATCH 099/459] Enumerating repairables to avoid NBT tag spawn on ancillary chest items, fixed double-dip on reset costs. --- config.yml | 97 +++++++++++++++++++ .../FactoryMod/Factorys/RepairFactory.java | 23 ++++- .../FactoryMod/managers/CompactorManager.java | 2 +- .../managers/RepairFactoryManager.java | 4 +- .../properties/RepairFactoryProperties.java | 25 ++++- 5 files changed, 141 insertions(+), 10 deletions(-) diff --git a/config.yml b/config.yml index e62d92f7..64dc5fee 100644 --- a/config.yml +++ b/config.yml @@ -107,6 +107,103 @@ repair_factory: Emerald Blocks: material: 'EMERALD_BLOCK' amount: 8 + repairable: + WOODEN_PICKAXE: + material: wooden_pickaxe + STONE_PICKAXE: + material: stone_pickaxe + IRON_PICKAXE: + material: iron_pickaxe + GOLDEN_PICKAXE: + material: golden_pickaxe + DIAMOND_PICKAXE: + material: diamond_pickaxe + WOODEN_AXE: + material: wooden_axe + STONE_AXE: + material: stone_axe + IRON_AXE: + material: iron_axe + GOLDEN_AXE: + material: golden_axe + DIAMOND_AXE: + material: diamond_axe + WOODEN_SHOVEL: + material: wooden_shovel + STONE_SHOVEL: + material: stone_shovel + IRON_SHOVEL: + material: iron_shovel + GOLDEN_SHOVEL: + material: golden_shovel + DIAMOND_SHOVEL: + material: diamond_shovel + WOODEN_HOE: + material: wooden_hoe + STONE_HOE: + material: stone_hoe + IRON_HOE: + material: iron_hoe + GOLDEN_HOE: + material: golden_hoe + DIAMOND_HOE: + material: diamond_hoe + WOODEN_SWORD: + material: wooden_sword + STONE_SWORD: + material: stone_sword + IRON_SWORD: + material: iron_sword + GOLDEN_SWORD: + material: golden_sword + DIAMOND_SWORD: + material: diamond_sword + BOW: + material: bow + FISHING_ROD: + material: fishing_rod + SHEARS: + material: shears + LEATHER_BOOTS: + material: leather_boots + CHAIN_BOOTS: + material: chainmail_boots + IRON_BOOTS: + material: iron_boots + GOLDEN_BOOTS: + material: golden_boots + DIAMOND_BOOTS: + material: diamond_boots + LEATHER_PANTS: + material: leather_leggings + CHAIN_LEGGINGS: + material: chainmail_leggings + IRON_LEGGINGS: + material: iron_leggings + GOLDEN_LEGGINGS: + material: golden_leggings + DIAMOND_LEGGINGS: + material: diamond_leggings + LEATHER_TUNIC: + material: leather_chestplate + CHAIN_CHESTPLATE: + material: chainmail_chestplate + IRON_CHESTPLATE: + material: iron_chestplate + GOLDEN_CHESTPLATE: + material: golden_chestplate + DIAMOND_CHESTPLATE: + material: diamond_chestplate + LEATHER_CAP: + material: leather_helmet + CHAIN_HELMET: + material: chainmail_helmet + IRON_HELMET: + material: iron_helmet + GOLDEN_HELMET: + material: golden_helmet + DIAMOND_HELMET: + material: diamond_helmet compactor: fuel: Charcoal: diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 8fe86422..f80a8b8e 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -1,12 +1,14 @@ package com.github.igotyou.FactoryMod.Factorys; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.logging.Logger; import net.minecraft.server.v1_8_R2.ItemStack; import org.bukkit.Location; +import org.bukkit.craftbukkit.libs.jline.internal.Log; import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; import vg.civcraft.mc.citadel.Citadel; @@ -252,18 +254,29 @@ public ItemList getRepairs() { @Override protected void recipeFinished() { - getInputs().removeOneFrom(getInventory()); + Log.info("Recipe Finished"); + //getInputs().removeOneFrom(getInventory()); // Don't double dip! Parent consume already ate recipe costs. org.bukkit.inventory.ItemStack[] contents = getInventory().getContents(); for (int x = 0; x < contents.length; x++){ org.bukkit.inventory.ItemStack stack = contents[x]; - if (stack == null) + if (stack == null) { continue; - ItemStack s = CraftItemStack.asNMSCopy(stack); - s.setRepairCost(1); - getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); + } + if (repairable(stack)) { + Log.info("Found repairable: " + stack.getType()); + ItemStack s = CraftItemStack.asNMSCopy(stack); + s.setRepairCost(1); + getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); + } else { + Log.info("Found non-repairable: " + stack.getType()); + } } } + private boolean repairable(org.bukkit.inventory.ItemStack stack) { + return rfp.getAllowedRepairable().contains(stack.getType()); + } + @Override public int getMaxRepair() { return rfp.getRepair(); diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index 353c30df..a661f26c 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -30,7 +30,7 @@ public InteractionResponse createFactory(Location factoryLocation, Inventory chestInventory = chest.getInventory(); ItemList inputs = compactorProperties.getConstructionMaterials(); - if (inputs.oneIn(chestInventory)) { + if (inputs.exactlyIn(chestInventory)) { Compactor production = new Compactor(factoryLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties()); inputs.removeFrom(production.getInventory()); diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index d9de9c39..1f323035 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -107,9 +107,9 @@ public InteractionResponse createFactory(Location factoryLocation, Inventory chestInventory = chest.getInventory(); ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); - if (constructionMaterials.oneIn(chestInventory)){ + if (constructionMaterials.exactlyIn(chestInventory)){ RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties); - constructionMaterials.removeFrom(chestInventory); + constructionMaterials.removeFrom(factory.getInventory()); if (addFactory(factory).getInteractionResult() == InteractionResult.FAILURE) { return new InteractionResponse(InteractionResult.FAILURE, "Unable to construct a " + repairFactoryProperties.getName()); diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index aadd6c29..95e62e4d 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -1,5 +1,9 @@ package com.github.igotyou.FactoryMod.properties; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -13,6 +17,7 @@ public class RepairFactoryProperties implements IFactoryProperties{ private ItemList fuel; private ItemList repairMaterials; private ItemList recipeMaterials; + private List allowedRepairable; private int energyTime; private String name; private int repair; @@ -21,7 +26,7 @@ public class RepairFactoryProperties implements IFactoryProperties{ public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, - double productionTime, ItemList recipeMaterials){ + double productionTime, ItemList recipeMaterials, List allowedRepairable){ this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -31,6 +36,7 @@ public RepairFactoryProperties(ItemList constructionMaterials, I this.repairTime = repairTime; this.productionTime = productionTime; this.recipeMaterials = recipeMaterials; + this.allowedRepairable = allowedRepairable; } public int getRepair() { @@ -53,6 +59,10 @@ public ItemList getRecipeMaterials(){ return recipeMaterials; } + public List getAllowedRepairable(){ + return allowedRepairable; + } + public int getEnergyTime() { return energyTime; @@ -82,11 +92,22 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + ItemList rfAllowed = plugin.getItems(costs.getConfigurationSection("repairable")); int rfEnergyTime = section.getInt("fuel_time"); int rfRepair = costs.getInt("repair_multiple", 1); String rfName = section.getString("name", "Repair Factory"); int repairTime = section.getInt("repair_time", 12); int productionTime = section.getInt("production_time"); - return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse); + + // We only care about raw material types for repair purposes. + Iterator canRepair = rfAllowed.iterator(); + List repairable = new ArrayList(); + + while (canRepair.hasNext()) { + NamedItemStack repair = canRepair.next(); + + repairable.add(repair.getType()); + } + return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse, repairable); } } From 437612df02061c4788a141f1b882b553a426130d Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Thu, 18 Jun 2015 02:17:47 -0400 Subject: [PATCH 100/459] Fixed configuration for repairables, still needs testing. --- config.yml | 96 +++++++++---------- .../properties/RepairFactoryProperties.java | 5 +- 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/config.yml b/config.yml index 64dc5fee..ef62216c 100644 --- a/config.yml +++ b/config.yml @@ -109,101 +109,101 @@ repair_factory: amount: 8 repairable: WOODEN_PICKAXE: - material: wooden_pickaxe + material: WOOD_PICKAXE STONE_PICKAXE: - material: stone_pickaxe + material: STONE_PICKAXE IRON_PICKAXE: - material: iron_pickaxe + material: IRON_PICKAXE GOLDEN_PICKAXE: - material: golden_pickaxe + material: GOLD_PICKAXE DIAMOND_PICKAXE: - material: diamond_pickaxe + material: DIAMOND_PICKAXE WOODEN_AXE: - material: wooden_axe + material: WOOD_AXE STONE_AXE: - material: stone_axe + material: STONE_AXE IRON_AXE: - material: iron_axe + material: IRON_AXE GOLDEN_AXE: - material: golden_axe + material: GOLD_AXE DIAMOND_AXE: - material: diamond_axe + material: DIAMOND_AXE WOODEN_SHOVEL: - material: wooden_shovel + material: WOOD_SPADE STONE_SHOVEL: - material: stone_shovel + material: STONE_SPADE IRON_SHOVEL: - material: iron_shovel + material: IRON_SPADE GOLDEN_SHOVEL: - material: golden_shovel + material: GOLD_SPADE DIAMOND_SHOVEL: - material: diamond_shovel + material: DIAMOND_SPADE WOODEN_HOE: - material: wooden_hoe + material: WOOD_HOE STONE_HOE: - material: stone_hoe + material: STONE_HOE IRON_HOE: - material: iron_hoe + material: IRON_HOE GOLDEN_HOE: - material: golden_hoe + material: GOLD_HOE DIAMOND_HOE: - material: diamond_hoe + material: DIAMOND_HOE WOODEN_SWORD: - material: wooden_sword + material: WOOD_SWORD STONE_SWORD: - material: stone_sword + material: STONE_SWORD IRON_SWORD: - material: iron_sword + material: IRON_SWORD GOLDEN_SWORD: - material: golden_sword + material: GOLD_SWORD DIAMOND_SWORD: - material: diamond_sword + material: DIAMOND_SWORD BOW: - material: bow + material: BOW FISHING_ROD: - material: fishing_rod + material: FISHING_ROD SHEARS: - material: shears + material: SHEARS LEATHER_BOOTS: - material: leather_boots + material: LEATHER_BOOTS CHAIN_BOOTS: - material: chainmail_boots + material: CHAINMAIL_BOOTS IRON_BOOTS: - material: iron_boots + material: IRON_BOOTS GOLDEN_BOOTS: - material: golden_boots + material: GOLD_BOOTS DIAMOND_BOOTS: - material: diamond_boots + material: DIAMOND_BOOTS LEATHER_PANTS: - material: leather_leggings + material: LEATHER_LEGGINGS CHAIN_LEGGINGS: - material: chainmail_leggings + material: CHAINMAIL_LEGGINGS IRON_LEGGINGS: - material: iron_leggings + material: IRON_LEGGINGS GOLDEN_LEGGINGS: - material: golden_leggings + material: GOLD_LEGGINGS DIAMOND_LEGGINGS: - material: diamond_leggings + material: DIAMOND_LEGGINGS LEATHER_TUNIC: - material: leather_chestplate + material: LEATHER_CHESTPLATE CHAIN_CHESTPLATE: - material: chainmail_chestplate + material: CHAINMAIL_CHESTPLATE IRON_CHESTPLATE: - material: iron_chestplate + material: IRON_CHESTPLATE GOLDEN_CHESTPLATE: - material: golden_chestplate + material: GOLD_CHESTPLATE DIAMOND_CHESTPLATE: - material: diamond_chestplate + material: DIAMOND_CHESTPLATE LEATHER_CAP: - material: leather_helmet + material: LEATHER_HELMET CHAIN_HELMET: - material: chainmail_helmet + material: CHAINMAIL_HELMET IRON_HELMET: - material: iron_helmet + material: IRON_HELMET GOLDEN_HELMET: - material: golden_helmet + material: GOLD_HELMET DIAMOND_HELMET: - material: diamond_helmet + material: DIAMOND_HELMET compactor: fuel: Charcoal: diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index 95e62e4d..a9032788 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -6,6 +6,7 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.craftbukkit.libs.jline.internal.Log; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemList; @@ -92,7 +93,7 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); - ItemList rfAllowed = plugin.getItems(costs.getConfigurationSection("repairable")); + ItemList rfAllowed = plugin.getItems(section.getConfigurationSection("repairable")); int rfEnergyTime = section.getInt("fuel_time"); int rfRepair = costs.getInt("repair_multiple", 1); String rfName = section.getString("name", "Repair Factory"); @@ -107,6 +108,8 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config NamedItemStack repair = canRepair.next(); repairable.add(repair.getType()); + + Log.info("Adding repairable: " + repair.getType()); } return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse, repairable); } From be31d3d2c020c7da397e6c842e895ec4904c57e4 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Thu, 18 Jun 2015 02:37:42 -0400 Subject: [PATCH 101/459] Cleanup. Still need to recheck logging technique, I hate the way things are currently being done, but just not a priority right now. --- .../FactoryMod/Factorys/RepairFactory.java | 12 +--- .../managers/RepairFactoryManager.java | 71 ------------------- .../properties/RepairFactoryProperties.java | 3 +- 3 files changed, 4 insertions(+), 82 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index f80a8b8e..36f984bc 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -1,19 +1,14 @@ package com.github.igotyou.FactoryMod.Factorys; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.logging.Logger; import net.minecraft.server.v1_8_R2.ItemStack; import org.bukkit.Location; -import org.bukkit.craftbukkit.libs.jline.internal.Log; import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; - import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; @@ -23,7 +18,6 @@ public class RepairFactory extends ABaseFactory{ - private ReinforcementManager rm = Citadel.getReinforcementManager(); private RepairFactoryProperties rfp; private RepairFactoryMode mode; @@ -254,7 +248,7 @@ public ItemList getRepairs() { @Override protected void recipeFinished() { - Log.info("Recipe Finished"); + log.finer("Recipe Finished"); //getInputs().removeOneFrom(getInventory()); // Don't double dip! Parent consume already ate recipe costs. org.bukkit.inventory.ItemStack[] contents = getInventory().getContents(); for (int x = 0; x < contents.length; x++){ @@ -263,12 +257,12 @@ protected void recipeFinished() { continue; } if (repairable(stack)) { - Log.info("Found repairable: " + stack.getType()); + log.fine("Found repairable: " + stack.getType()); ItemStack s = CraftItemStack.asNMSCopy(stack); s.setRepairCost(1); getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); } else { - Log.info("Found non-repairable: " + stack.getType()); + log.fine("Found non-repairable: " + stack.getType()); } } } diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 1f323035..44ba07ab 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -25,77 +25,6 @@ public Class getFactoryType() { return RepairFactory.class; } - //SEE RepairCsvReader.java -// @Override -// public void save(File file) throws IOException { -// repairTime=System.currentTimeMillis(); -// FileOutputStream fileOutputStream = new FileOutputStream(file); -// ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); -// int version = 1; -// oos.writeInt(version); -// oos.writeInt(factories.size()); -// for (RepairFactory factory: factories){ -// Location centerLocation = factory.getCenterLocation(); -// Location inventoryLocation = factory.getInventoryLocation(); -// Location powerLocation = factory.getPowerSourceLocation(); -// -// oos.writeUTF(centerLocation.getWorld().getName()); -// -// oos.writeInt(centerLocation.getBlockX()); -// oos.writeInt(centerLocation.getBlockY()); -// oos.writeInt(centerLocation.getBlockZ()); -// -// oos.writeInt(inventoryLocation.getBlockX()); -// oos.writeInt(inventoryLocation.getBlockY()); -// oos.writeInt(inventoryLocation.getBlockZ()); -// -// oos.writeInt(powerLocation.getBlockX()); -// oos.writeInt(powerLocation.getBlockY()); -// oos.writeInt(powerLocation.getBlockZ()); -// -// oos.writeInt(factory.getMode().getId()); -// oos.writeDouble(factory.getCurrentRepair()); -// oos.writeLong(factory.getTimeDisrepair()); -// } -// oos.flush(); -// fileOutputStream.close(); -// } - - //SEE RepairCsvWriter.java -// @Override -// public void load(File file) throws IOException { -// isLogging = false; -// try { -// repairTime=System.currentTimeMillis(); -// FileInputStream fileInputStream = new FileInputStream(file); -// ObjectInputStream ois = new ObjectInputStream(fileInputStream); -// int version = ois.readInt(); -// assert(version == 1); -// int count = ois.readInt(); -// int i = 0; -// for (i = 0; i < count; i++) -// { -// String worldName = ois.readUTF(); -// World world = Bukkit.getWorld(worldName); -// -// Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); -// Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); -// Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); -// -// RepairFactoryMode mode = RepairFactoryMode.byId(ois.readInt()); -// double currentRepair = ois.readDouble(); -// long timeDisrepair = ois.readLong(); -// -// RepairFactory factory = new RepairFactory(centerLocation, inventoryLocation, powerLocation, false, plugin.getRepairFactoryProperties(), -// this, mode, currentRepair, timeDisrepair); -// addFactory(factory); -// } -// fileInputStream.close(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// } - @Override public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation) { diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index a9032788..fc61b964 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -6,7 +6,6 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.craftbukkit.libs.jline.internal.Log; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemList; @@ -109,7 +108,7 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config repairable.add(repair.getType()); - Log.info("Adding repairable: " + repair.getType()); + FactoryModPlugin.sendConsoleMessage("Adding repairable: " + repair.getType()); } return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse, repairable); } From d17608a288a7b30876597ca80da8672ca1e571f0 Mon Sep 17 00:00:00 2001 From: ribagi Date: Tue, 2 Jun 2015 23:08:39 -0700 Subject: [PATCH 102/459] Small fixes, config good to go. --- config.yml | 3566 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 3303 insertions(+), 263 deletions(-) diff --git a/config.yml b/config.yml index ef62216c..9c26ec7c 100644 --- a/config.yml +++ b/config.yml @@ -350,7 +350,6 @@ printing_presses: durability: 2 amount: 6 security_notes_per_lot: 128 - crafting: disable: CHISSELED_STONE_BRICK: @@ -456,16 +455,17 @@ production_factories: - Bake_Bread - Bake_Cake - Bake_Pumpkin_Pie - repair_multiple: 26 + repair_multiple: 10 repair_inputs: Baked Potato: material: BAKED_POTATO - amount: 2 + amount: 5 Cookie: material: COOKIE - amount: 4 + amount: 10 Bread: material: BREAD + amount: 2 Pumpkin Pie: material: PUMPKIN_PIE Black_Wool_Processing: @@ -808,6 +808,135 @@ production_factories: repair_inputs: Diamond: material: DIAMOND + Emerald_Cauldron: + name: Emerald Cauldron + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 192 + Diamonds: + material: DIAMOND + amount: 128 + Iron: + material: IRON_INGOT + amount: 256 + recipes: + - Emerald_XP_0 + - Emerald_XP_1 + - Emerald_XP_2 + repair_multiple: 10 + repair_inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + Diamonds: + material: DIAMOND + amount: 2 + Iron: + material: IRON_INGOT + amount: 3 + Nether_Compactor: + name: Nether Compactor + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Iron Block: + material: IRON_BLOCK + amount: 64 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 64 + recipes: + - Nether_Craft_Crate_of_Acacia_Sapling + - Nether_Craft_Crate_of_Baked_Potatoes + - Nether_Craft_Crate_of_Birch_Sapling + - Nether_Craft_Crate_of_Bread + - Nether_Craft_Crate_of_Brown_Mushrooms + - Nether_Craft_Crate_of_Cacti + - Nether_Craft_Crate_of_Carrots + - Nether_Craft_Crate_of_Cocoa + - Nether_Craft_Crate_of_Cookies + - Nether_Craft_Crate_of_Dark_Oak_Sapling + - Nether_Craft_Crate_of_Fish + - Nether_Craft_Crate_of_Glass_Bottles + - Nether_Craft_Crate_of_Grass + - Nether_Craft_Crate_of_Grass_Blocks + - Nether_Craft_Crate_of_Jungle_Sapling + - Nether_Craft_Crate_of_Melons + - Nether_Craft_Crate_of_Nether_Warts + - Nether_Craft_Crate_of_Oak_Sapling + - Nether_Craft_Crate_of_Pumpkins + - Nether_Craft_Crate_of_Red_Mushrooms + - Nether_Craft_Crate_of_Red_Rose + - Nether_Craft_Crate_of_Salmon + - Nether_Craft_Crate_of_Spruce_Sapling + - Nether_Craft_Crate_of_Sugar_Cane + - Nether_Craft_Crate_of_Vine + - Nether_Craft_Crate_of_Wheat + - Nether_Craft_Crate_of_Yellow_Flower + repair_multiple: 3 + repair_inputs: + Iron Block: + material: IRON_BLOCK + amount: 2 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + Nether_Decompactor: + name: Nether Decompactor + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Diamonds: + material: DIAMOND + amount: 64 + Emeralds Blocks: + material: EMERALD_BLOCK + amount: 128 + recipes: + - Nether_Decraft_Crate_of_Acacia_Sapling + - Nether_Decraft_Crate_of_Baked_Potatoes + - Nether_Decraft_Crate_of_Birch_Sapling + - Nether_Decraft_Crate_of_Bread + - Nether_Decraft_Crate_of_Brown_Mushrooms + - Nether_Decraft_Crate_of_Cacti + - Nether_Decraft_Crate_of_Carrots + - Nether_Decraft_Crate_of_Cocoa + - Nether_Decraft_Crate_of_Cookies + - Nether_Decraft_Crate_of_Dark_Oak_Sapling + - Nether_Decraft_Crate_of_Fish + - Nether_Decraft_Crate_of_Glass_Bottles + - Nether_Decraft_Crate_of_Grass + - Nether_Decraft_Crate_of_Grass_Blocks + - Nether_Decraft_Crate_of_Jungle_Sapling + - Nether_Decraft_Crate_of_Melons + - Nether_Decraft_Crate_of_Nether_Warts + - Nether_Decraft_Crate_of_Oak_Sapling + - Nether_Decraft_Crate_of_Pumpkins + - Nether_Decraft_Crate_of_Red_Mushrooms + - Nether_Decraft_Crate_of_Red_Rose + - Nether_Decraft_Crate_of_Salmon + - Nether_Decraft_Crate_of_Spruce_Sapling + - Nether_Decraft_Crate_of_Sugar_Cane + - Nether_Decraft_Crate_of_Vine + - Nether_Decraft_Crate_of_Wheat + - Nether_Decraft_Crate_of_Yellow_Flower + repair_multiple: 6 + repair_inputs: + Diamonds: + material: DIAMOND + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 Diamond_Cauldron: name: Diamond Cauldron fuel: @@ -817,16 +946,22 @@ production_factories: inputs: Diamond: material: DIAMOND - amount: 50 + amount: 128 + Iron Ingot: + material: IRON_INGOT + amount: 256 recipes: - Diamond_XP_Bottle_0 - Diamond_XP_Bottle_1 - Diamond_XP_Bottle_2 - - Diamond_XP_Bottle_3 - repair_multiple: 5 + repair_multiple: 10 repair_inputs: Diamond: material: DIAMOND + amount: 1 + Iron Ingot: + material: IRON_INGOT + amount: 3 Diamond_Chestplate_Smithy: name: Diamond Chestplate Smithy fuel: @@ -939,6 +1074,266 @@ production_factories: repair_inputs: Diamond: material: DIAMOND + Random_Wooden_Tool_Factory: + name: Random Wooden Tool Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Sticks: + material: STICK + amount: 96 + recipes: + - Create_Wooden_Pickaxe + - Create_Wooden_Spade + - Create_Wooden_Axe + - Create_Fishing_Rod + repair_multiple: 9 + repair_inputs: + Sticks: + material: STICK + amount: 1 + Random_Leather_Armor_Factory: + name: Random Leather Armor Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Leather: + material: LEATHER + amount: 64 + recipes: + - Create_Leather_Leggings + - Create_Leather_Boots + - Create_Leather_Chestplate + - Create_Leather_Helmet + repair_multiple: 6 + repair_inputs: + Leather: + material: LEATHER + amount: 1 + Random_Wooden_Weapon_Factory: + name: Random Wooden Weapon Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Sticks: + material: STICK + amount: 32 + recipes: + - Create_Wooden_Sword + repair_multiple: 1 + repair_inputs: + Sticks: + material: STICK + amount: 3 + Random_Iron_Tool_Factory: + name: Random Iron Tool Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 96 + recipes: + - Create_Iron_Axe + - Create_Iron_Pickaxe + - Create_Iron_Spade + repair_multiple: 9 + repair_inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 1 + Random_Iron_Armor_Factory: + name: Random Iron Armor Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 64 + recipes: + - Create_Iron_Leggings + - Create_Iron_Boots + - Create_Iron_Chestplate + - Create_Iron_Helmet + repair_multiple: 6 + repair_inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 1 + Random_Iron_Weapon_Factory: + name: Random Iron Weapon Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 32 + recipes: + - Create_Iron_Sword + repair_multiple: 2 + repair_inputs: + Iron Blocks: + material: IRON_BLOCK + amount: 3 + Random_Diamond_Tool_Factory: + name: Random Diamond Tool Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 96 + recipes: + - Create_Diamond_Axe + - Create_Diamond_Pickaxe + - Create_Diamond_Spade + repair_multiple: 2 + repair_inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 9 + Random_Diamond_Armor_Factory: + name: Random Diamond Armor Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 64 + recipes: + - Create_Diamond_Leggings + - Create_Diamond_Boots + - Create_Diamond_Chestplate + - Create_Diamond_Helmet + repair_multiple: 2 + repair_inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 6 + Random_Diamond_Weapon_Factory: + name: Random Diamond Weapon Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 32 + recipes: + - Create_Bow + - Create_Diamond_Sword + repair_multiple: 2 + repair_inputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 3 + Sword_Enchantment_Factory: + name: Sword Enchantment Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 32 + Emerald Block: + material: EMERALD_BLOCK + amount: 64 + recipes: + - Enchant_Sharpness + - Enchant_Fire_Aspect + - Enchant_Looting + - Enchant_Bane_Of_Arthropods + repair_multiple: 10 + repair_inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 3 + Emerald Block: + material: EMERALD_BLOCK + amount: 6 + Armour_Enchantment_Factory: + name: Armour Enchantment Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 64 + Emerald Block: + material: EMERALD_BLOCK + amount: 96 + recipes: + - Enchant_P4_Chest + - Enchant_P4_Legs + - Enchant_P4_Boots + - Enchant_P4_Helmet + - Enchant_U3_Chest + - Enchant_U3_Legs + - Enchant_U3_Boots + - Enchant_U3_Helmet + repair_multiple: 10 + repair_inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 6 + Emerald Block: + material: EMERALD_BLOCK + amount: 9 + Tool_Enchantment_Factory: + name: Tool Enchantment Factory + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 96 + Emerald Block: + material: EMERALD_BLOCK + amount: 128 + recipes: + - Enchant_Picks_E5 + - Enchant_Picks_U3 + - Enchant_Picks_S1 + - Enchant_Picks_F3 + - Enchant_Axes_E5 + - Enchant_Axes_U3 + - Enchant_Axes_S1 + - Enchant_Axes_F3 + - Enchant_Spades_E5 + - Enchant_Spades_U3 + - Enchant_Spades_S1 + - Enchant_Spades_F3 + repair_multiple: 10 + repair_inputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 9 + Emerald Block: + material: EMERALD_BLOCK + amount: 12 Glass_Smelter: name: Glass Smelter fuel: @@ -1391,7 +1786,7 @@ production_factories: inputs: Iron Ingot: material: IRON_INGOT - amount: 200 + amount: 224 recipes: - Iron_XP_Bottle_0 - Iron_XP_Bottle_1 @@ -2750,12 +3145,10 @@ production_factories: material: STICK amount: 1024 recipes: - - Wood_XP_Bottle_0 - - Wood_XP_Bottle_1 - - Wood_XP_Bottle_2 - - Wood_XP_Bottle_3 - - Wood_XP_Bottle_4 - - Wood_XP_Bottle_5 + - Wood_XP_0 + - Wood_XP_1 + - Wood_XP_2 + - Wood_XP_3 repair_multiple: 103 repair_inputs: Stick: @@ -2888,19 +3281,6 @@ nether_factory: cost_scaling_radius: 5000 use_fuel_on_teleport: false production_recipes: - Wood_XP_Bottle_0: - name: Brew XP Bottles - 1 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 8 - Wheat: - material: WHEAT - amount: 1280 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 8 Baked_Potato: name: Bake Potato production_time: 24 @@ -2912,19 +3292,6 @@ production_recipes: Baked Potato: material: BAKED_POTATO amount: 384 - Wood_XP_Bottle_2: - name: Brew XP Bottles - 3 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 5 - Baked Potato: - material: BAKED_POTATO - amount: 1920 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 5 Dye_Black_Wool_Cyan: name: Dye Black Wool Cyan inputs: @@ -3021,38 +3388,48 @@ production_recipes: inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 128 + amount: 256 Carrot: material: CARROT_ITEM - amount: 96 + amount: 512 Melon Block: material: MELON_BLOCK - amount: 32 - Cactus: - material: CACTUS - amount: 256 - Red Rose: - material: RED_ROSE - amount: 8 - Rotten Flesh: - material: ROTTEN_FLESH + amount: 64 + Brown Mushroom: + material: BROWN_MUSHROOM + amount: 128 + Cocoa: + material: INK_SACK + amount: 64 + durability: 3 + Grass Blocks: + material: GRASS amount: 128 - Red Mushroom: - material: RED_MUSHROOM - amount: 32 - Vine: - material: VINE - amount: 32 Bread: material: BREAD amount: 128 - Grilled Pork: - material: GRILLED_PORK - amount: 32 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 + Sugar Cane: + material: SUGAR_CANE + amount: 512 + Yellow Flower: + material: YELLOW_FLOWER + amount: 32 + Oak Sapling: + material: SAPLING + amount: 8 + durability: 0 + Jungle Sapling: + material: SAPLING + amount: 8 + durability: 3 + Acacia Sapling: + material: SAPLING + amount: 8 + durability: 4 + outputs: + Emerald Block: + material: EMERALD_BLOCK + amount: 2 Dye_Brown_Wool_Orange: name: Dye Brown Wool Orange inputs: @@ -3369,25 +3746,29 @@ production_recipes: material: WOOL amount: 64 durability: 9 - Iron_XP_Bottle_1: - name: Brew XP Bottles - 2 + Iron_XP_Bottle_0: + name: Brew XP Bottles - 1 inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 14 + amount: 32 Carrot: material: CARROT_ITEM + amount: 512 + Cactus: + material: CACTUS amount: 256 - Nether Wart: - material: NETHER_STALK - amount: 256 - Baked Potato: - material: BAKED_POTATO - amount: 256 + Cocoa: + material: INK_SACK + amount: 64 + durability: 3 + Melon Block: + material: MELON_BLOCK + amount: 64 outputs: - Exp Bottle: + XP Bottles: material: EXP_BOTTLE - amount: 14 + amount: 32 Dye_White_Wool_Red: name: Dye White Wool Red inputs: @@ -3434,32 +3815,6 @@ production_recipes: material: WOOL amount: 64 durability: 10 - Wood_XP_Bottle_4: - name: Brew XP Bottles - 5 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 6 - Carrot: - material: CARROT_ITEM - amount: 1280 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 6 - Wood_XP_Bottle_5: - name: Brew XP Bottles - 6 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 8 - Hay Bale: - material: HAY_BLOCK - amount: 143 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 8 Dye_Light_Gray_Wool_Orange: name: Dye Light Gray Wool Orange inputs: @@ -4047,7 +4402,7 @@ production_recipes: outputs: Cooked Salmon: material: COOKED_FISH - amount: 128 + amount: 512 durability: 1 Produce_TNT: name: Produce TNT @@ -4106,19 +4461,6 @@ production_recipes: material: WOOL amount: 64 durability: 13 - Wood_XP_Bottle_3: - name: Brew XP Bottles - 4 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - Cookie: - material: COOKIE - amount: 1280 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 4 Iron_Chestplate: name: Forge Iron Chestplate. production_time: 40 @@ -4300,115 +4642,93 @@ production_recipes: inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 128 - Nether Wart: - material: NETHER_STALK - amount: 64 - Melon Block: - material: MELON_BLOCK - amount: 32 - Sugar Cane: - material: SUGAR_CANE - amount: 128 - Yellow Flower: - material: YELLOW_FLOWER - amount: 16 - Rotten Flesh: - material: ROTTEN_FLESH - amount: 128 - Brown Mushroom: - material: BROWN_MUSHROOM - amount: 64 - Vine: - material: VINE - amount: 32 - Baked Potato: - material: BAKED_POTATO amount: 256 - Cooked Chicken: - material: COOKED_CHICKEN - amount: 16 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 - Diamond_XP_Bottle_2: - name: Brew XP Bottles - 3 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 128 + Cactus: + material: CACTUS + amount: 512 Wheat: material: WHEAT - amount: 128 - Cocoa: - material: INK_SACK - amount: 16 - durability: 3 + amount: 384 Pumpkin: material: PUMPKIN - amount: 128 - Cactus: - material: CACTUS amount: 256 - Red Rose: - material: RED_ROSE - amount: 8 - Spider Eye: - material: SPIDER_EYE - amount: 32 - Red Mushroom: - material: RED_MUSHROOM - amount: 16 Grass: material: LONG_GRASS - amount: 32 + amount: 128 durability: 1 + Cocoa: + material: INK_SACK + amount: 64 + durability: 3 + Red Mushroom: + material: RED_MUSHROOM + amount: 128 Cooked Fish: material: COOKED_FISH amount: 16 + Red Rose: + material: RED_ROSE + amount: 16 + Cooked Salmon: + material: COOKED_FISH + amount: 8 + durability: 1 + Spruce Sapling: + material: SAPLING + amount: 8 + durability: 1 + Dark Oak Sapling: + material: SAPLING + amount: 8 + durability: 5 outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 - Diamond_XP_Bottle_3: - name: Brew XP Bottles - 4 + Emerald Block: + material: EMERALD_BLOCK + amount: 2 + Diamond_XP_Bottle_2: + name: Brew XP Bottles - 3 inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 128 - Nether Wart: - material: NETHER_STALK - amount: 64 + amount: 256 + Cookie: + material: COOKIE + amount: 768 + Baked Potato: + material: BAKED_POTATO + amount: 512 + Sugar Cane: + material: SUGAR_CANE + amount: 512 + Grass Blocks: + material: GRASS + amount: 32 Pumpkin: material: PUMPKIN + amount: 256 + Nether Wart: + material: NETHER_STALK amount: 128 - Sugar Cane: - material: SUGAR_CANE + Vine: + material: VINE amount: 128 + Red Mushroom: + material: RED_MUSHROOM + amount: 128 + Melon Block: + material: MELON_BLOCK + amount: 64 Yellow Flower: material: YELLOW_FLOWER - amount: 16 - Spider Eye: - material: SPIDER_EYE - amount: 32 - Brown Mushroom: - material: BROWN_MUSHROOM - amount: 64 - Grass: - material: LONG_GRASS - amount: 64 - durability: 1 - Cookie: - material: COOKIE - amount: 256 - Cooked Beef: - material: COOKED_BEEF amount: 32 + Birch Sapling: + material: SAPLING + amount: 8 + durability: 2 outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 + Emerald Block: + material: EMERALD_BLOCK + amount: 2 Dye_White_Wool_Gray: name: Dye White Wool Gray inputs: @@ -5140,82 +5460,73 @@ production_recipes: material: SMOOTH_BRICK amount: 64 durability: 2 - Iron_XP_Bottle_0: - name: Brew XP Bottles - 1 + Iron_XP_Bottle_1: + name: Brew XP Bottles - 2 inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 24 - Carrot: - material: CARROT_ITEM + amount: 32 + Wheat: + material: WHEAT amount: 256 - Cactus: - material: CACTUS + Baked Potato: + material: BAKED_POTATO amount: 256 - Bread: - material: BREAD + Sugar Cane: + material: SUGAR_CANE amount: 256 + Pumpkin: + material: PUMPKIN + amount: 128 outputs: - Exp Bottle: + XP Bottles: material: EXP_BOTTLE - amount: 24 + amount: 32 Iron_XP_Bottle_3: name: Brew XP Bottles - 4 inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 42 - Nether Wart: - material: NETHER_STALK + amount: 32 + Wheat: + material: WHEAT amount: 256 - Melon Block: - material: MELON_BLOCK - amount: 64 - Sugar Cane: - material: SUGAR_CANE - amount: 64 - Cookie: - material: COOKIE - amount: 512 - Baked Potato: - material: BAKED_POTATO - amount: 64 - Grilled Pork: - material: GRILLED_PORK + Cactus: + material: CACTUS + amount: 256 + Cocoa: + material: INK_SACK amount: 64 + durability: 3 + Pumpkin: + material: PUMPKIN + amount: 128 outputs: - Exp Bottle: + XP Bottles: material: EXP_BOTTLE - amount: 42 + amount: 32 Iron_XP_Bottle_2: name: Brew XP Bottles - 3 inputs: Glass Bottle: material: GLASS_BOTTLE - amount: 42 + amount: 32 Carrot: material: CARROT_ITEM - amount: 128 - Cocoa: - material: INK_SACK - amount: 64 - durability: 3 - Pumpkin: - material: PUMPKIN - amount: 64 - Cactus: - material: CACTUS - amount: 64 - Bread: - material: BREAD + amount: 512 + Baked Potato: + material: BAKED_POTATO + amount: 256 + Sugar Cane: + material: SUGAR_CANE + amount: 256 + Melon Block: + material: MELON_BLOCK amount: 64 - Cooked Beef: - material: COOKED_BEEF - amount: 32 outputs: - Exp Bottle: + XP Bottles: material: EXP_BOTTLE - amount: 42 + amount: 32 Diamond_Leggings: name: Forge Diamond Leggings. production_time: 35 @@ -5491,19 +5802,6 @@ production_recipes: Iron Hoe: material: IRON_HOE amount: 30 - Wood_XP_Bottle_1: - name: Brew XP Bottles - 2 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - Nether Wart: - material: NETHER_STALK - amount: 1280 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 4 Dye_Pink_Wool_Gray: name: Dye Pink Wool Gray inputs: @@ -7905,4 +8203,2746 @@ production_recipes: material: CHEST amount: 16 display_name: Crate - lore: A crate for compacting items \ No newline at end of file + lore: A crate for compacting items + Enchant_Sharpness: + name: Enchant With Sharpness 5. + production_time: 10 + inputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 50 + outputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + enchantments: + Sharpness: + type: DAMAGE_ALL + level: 5 + Enchant_Fire_Aspect: + name: Enchant With Fire Aspect 2. + production_time: 10 + inputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 30 + outputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + enchantments: + Fire Aspect: + type: FIRE_ASPECT + level: 2 + Enchant_Looting: + name: Enchant With Looting 3. + production_time: 10 + inputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 35 + outputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + enchantments: + Looting: + type: LOOT_BONUS_MOBS + level: 3 + Enchant_Bane_Of_Arthropods: + name: Enchant With Bane of Arthropods 5. + production_time: 10 + inputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 50 + outputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 5 + enchantments: + Bane of Arthropods 5: + type: DAMAGE_ARTHROPODS + level: 5 + Enchant_P4_Chest: + name: Enchant Chest with Prot 4 + production_time: 40 + inputs: + Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 44 + outputs: + Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 5 + enchantments: + Protection: + type: PROTECTION_ENVIRONMENTAL + level: 4 + Enchant_P4_Legs: + name: Enchant Legs with Prot 4 + production_time: 40 + inputs: + Diamond Legs: + material: DIAMOND_LEGGINGS + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 42 + outputs: + Diamond Legs: + material: DIAMOND_LEGGINGS + amount: 5 + enchantments: + Protection: + type: PROTECTION_ENVIRONMENTAL + level: 4 + Enchant_P4_Boots: + name: Enchant Boots with Prot 4 + production_time: 40 + inputs: + Diamond Boots: + material: DIAMOND_BOOTS + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 36 + outputs: + Diamond Boots: + material: DIAMOND_BOOTS + amount: 5 + enchantments: + Protection: + type: PROTECTION_ENVIRONMENTAL + level: 4 + Enchant_P4_Helmet: + name: Enchant Helmet with Prot 4 + production_time: 40 + inputs: + Diamond Helmet: + material: DIAMOND_HELMET + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 32 + outputs: + Diamond Helemt: + material: DIAMOND_HELMET + amount: 5 + enchantments: + Protection: + type: PROTECTION_ENVIRONMENTAL + level: 4 + Enchant_U3_Chest: + name: Enchant Chest with Unbreaking 3 + production_time: 40 + inputs: + Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 44 + outputs: + Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 5 + enchantments: + Unbreaking: + type: DURABILITY + level: 3 + Enchant_U3_Legs: + name: Enchant Legs with Unbreaking 3 + production_time: 40 + inputs: + Diamond Legs: + material: DIAMOND_LEGGINGS + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 42 + outputs: + Diamond Legs: + material: DIAMOND_LEGGINGS + amount: 5 + enchantments: + Unbreaking: + type: DURABILITY + level: 3 + Enchant_U3_Boots: + name: Enchant Boots with Unbreaking 3 + production_time: 40 + inputs: + Diamond Boots: + material: DIAMOND_BOOTS + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 36 + outputs: + Diamond Boots: + material: DIAMOND_BOOTS + amount: 5 + enchantments: + Unbreaking: + type: DURABILITY + level: 3 + Enchant_U3_Helmet: + name: Enchant Helmet with Unbreaking 3 + production_time: 40 + inputs: + Diamond Helmet: + material: DIAMOND_HELMET + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 32 + outputs: + Diamond Helemt: + material: DIAMOND_HELMET + amount: 5 + enchantments: + Unbreaking: + type: DURABILITY + level: 3 + Enchant_Picks_E5: + name: Enchant Pick with Efficiency 5 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 36 + outputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + enchantments: + Efficiency: + type: DIG_SPEED + level: 5 + Enchant_Spades_E5: + name: Enchant Spade with Efficiency 5 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_SPADE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 36 + outputs: + Diamond Spade: + material: DIAMOND_SPADE + amount: 5 + enchantments: + Efficiency: + type: DIG_SPEED + level: 5 + Enchant_Axes_E5: + name: Enchant Axe with Efficiency 5 + production_time: 10 + inputs: + Diamond Axe: + material: DIAMOND_AXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 36 + outputs: + Diamond Pick: + material: DIAMOND_AXE + amount: 5 + enchantments: + Efficiency: + type: DIG_SPEED + level: 5 + Enchant_Picks_U3: + name: Enchant Pick with Unbreaking 3 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 39 + outputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + enchantments: + Efficiency: + type: DURABILITY + level: 3 + Enchant_Spades_U3: + name: Enchant Spade with Unbreaking 3 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_SPADE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 39 + outputs: + Diamond Spade: + material: DIAMOND_SPADE + amount: 5 + enchantments: + Efficiency: + type: DURABILITY + level: 3 + Enchant_Axes_U3: + name: Enchant Axe with Unbreaking 3 + production_time: 10 + inputs: + Diamond Axe: + material: DIAMOND_AXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 39 + outputs: + Diamond Pick: + material: DIAMOND_AXE + amount: 5 + enchantments: + Efficiency: + type: DURABILITY + level: 3 + Enchant_Picks_S1: + name: Enchant Pick with Silk Touch + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 75 + outputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + enchantments: + Silk Touch: + type: SILK_TOUCH + level: 1 + Enchant_Spades_S1: + name: Enchant Spade with Silk Touch + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_SPADE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 75 + outputs: + Diamond Spade: + material: DIAMOND_SPADE + amount: 5 + enchantments: + Silk Touch: + type: SILK_TOUCH + level: 1 + Enchant_Axes_S1: + name: Enchant Axe with Silk Touch + production_time: 10 + inputs: + Diamond Axe: + material: DIAMOND_AXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 75 + outputs: + Diamond Pick: + material: DIAMOND_AXE + amount: 5 + enchantments: + Silk Touch: + type: SILK_TOUCH + level: 1 + Enchant_Picks_F3: + name: Enchant Pick with Fortune 3 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 40 + outputs: + Diamond Pick: + material: DIAMOND_PICKAXE + amount: 5 + enchantments: + Fortune: + type: LOOT_BONUS_BLOCKS + level: 3 + Enchant_Spades_F3: + name: Enchant Spade with Fortune 3 + production_time: 10 + inputs: + Diamond Pick: + material: DIAMOND_SPADE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 40 + outputs: + Diamond Spade: + material: DIAMOND_SPADE + amount: 5 + enchantments: + Fortune: + type: LOOT_BONUS_BLOCKS + level: 3 + Enchant_Axes_F3: + name: Enchant Axe with Fortune 3 + production_time: 10 + inputs: + Diamond Axe: + material: DIAMOND_AXE + amount: 5 + Emerald Block: + material: EMERALD_BLOCK + amount: 40 + outputs: + Diamond Pick: + material: DIAMOND_AXE + amount: 5 + enchantments: + Fortune: + type: LOOT_BONUS_BLOCKS + level: 3 + Nether_Craft_Crate_of_Melons: + name: Craft Crate of Melons + production_time: 4 + inputs: + Melon Blocks: + material: MELON_BLOCK + amount: 1024 + outputs: + Crate of Melons: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Melons + lore: Crate of Melons + Nether_Craft_Crate_of_Fish: + name: Craft Crate of Fish + production_time: 4 + inputs: + Fish: + material: COOKED_FISH + amount: 1024 + outputs: + Crate of Fish: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Fish + lore: Crate of Fish + Nether_Craft_Crate_of_Sugar_Cane: + name: Craft Crate of Sugar Cane + production_time: 4 + inputs: + Sugar Cane: + material: SUGAR_CANE + amount: 1024 + outputs: + Crate of Sugar Cane: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Sugar Cane + lore: Crate of Sugar Cane + Nether_Craft_Crate_of_Nether_Warts: + name: Craft Crate of Nether Warts + production_time: 4 + inputs: + Nether Wart: + material: NETHER_STALK + amount: 1024 + outputs: + Crate of Nether Warts: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Nether Warts + lore: Crate of Nether Warts + Nether_Craft_Crate_of_Cookies: + name: Craft Crate of Cookies + production_time: 4 + inputs: + Cookie: + material: COOKIE + amount: 1024 + outputs: + Crate of Cookies: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cookies + lore: Crate of Cookies + Nether_Craft_Crate_of_Baked_Potatoes: + name: Craft Crate of Baked Potatoes + production_time: 4 + inputs: + Potato: + material: BAKED_POTATO + amount: 1024 + outputs: + Crate of Potatoes: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Potatoes + lore: Crate of Potatoes + Nether_Craft_Crate_of_Carrots: + name: Craft Crate of Carrots + production_time: 4 + inputs: + Carrot: + material: CARROT_ITEM + amount: 1024 + outputs: + Crate of Carrots: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Carrots + lore: Crate of Carrots + Nether_Craft_Crate_of_Cocoa: + name: Craft Crate of Cocoa + production_time: 4 + inputs: + Cocoa: + material: INK_SACK + durability: 3 + amount: 1024 + outputs: + Crate of Cocoa: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cocoa + lore: Crate of Cocoa + Nether_Craft_Crate_of_Pumpkins: + name: Craft Crate of Pumpkins + production_time: 4 + inputs: + Pumpkin: + material: PUMPKIN + amount: 1024 + outputs: + Crate of Pumpkins: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Pumpkins + lore: Crate of Pumpkins + Nether_Craft_Crate_of_Cacti: + name: Craft Crate of Cacti + production_time: 4 + inputs: + Catus: + material: CACTUS + amount: 1024 + outputs: + Crate of Cacti: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cacti + lore: Crate of Cacti + Nether_Craft_Crate_of_Bread: + name: Craft Crate of Bread + production_time: 4 + inputs: + Bread: + material: BREAD + amount: 1024 + outputs: + Crate of Bread: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Bread + lore: Crate of Bread + Nether_Craft_Crate_of_Wheat: + name: Craft Crate of Wheat + production_time: 4 + inputs: + Wheat: + material: WHEAT + amount: 1024 + outputs: + Crate of Bread: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Wheat + lore: Crate of Wheat + Nether_Craft_Crate_of_Grass: + name: Craft Crate of Grass + production_time: 4 + inputs: + Grass: + material: LONG_GRASS + amount: 1024 + durability: 1 + outputs: + Crate of Grass: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Grass + lore: Crate of Grass + Nether_Craft_Crate_of_Red_Rose: + name: Craft Crate of Red Rose + production_time: 4 + inputs: + Red Roses: + material: RED_ROSE + amount: 1024 + outputs: + Crate of Red Rose: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Red Rose + lore: Crate of Red Rose + Nether_Craft_Crate_of_Vine: + name: Craft Crate of Vine + production_time: 4 + inputs: + Vine: + material: VINE + amount: 1024 + outputs: + Crate of Vine: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Vine + lore: Crate of Vine + Nether_Craft_Crate_of_Brown_Mushrooms: + name: Craft Crate of Brown Mushrooms + production_time: 4 + inputs: + Brown Mushroom: + material: BROWN_MUSHROOM + amount: 1024 + outputs: + Crate of Brown Mushrooms: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Brown Mushrooms + lore: Crate of Brown Mushrooms + Nether_Craft_Crate_of_Red_Mushrooms: + name: Craft Crate of Red Mushrooms + production_time: 4 + inputs: + Red Mushroom: + material: RED_MUSHROOM + amount: 1024 + outputs: + Crate of Red Mushrooms: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Red Mushrooms + lore: Crate of Red Mushrooms + Nether_Craft_Crate_of_Yellow_Flower: + name: Craft Crate of Yellow Flower + production_time: 4 + inputs: + Yellow Flower: + material: YELLOW_FLOWER + amount: 1024 + outputs: + Crate of Yellow Flower: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Yellow Flower + lore: Crate of Yellow Flower + Nether_Craft_Crate_of_Glass_Bottles: + name: Craft Crate of Glass Bottles + production_time: 64 + inputs: + Sand: + material: SAND + amount: 512 + outputs: + Crate of Glass Bottles: + material: WOOD + durability: 0 + amount: 8 + display_name: Crate of Glass Bottles + lore: Crate of Glass Bottles + Nether_Craft_Crate_of_Acacia_Sapling: + name: Craft Crate of Acacia Sapling + production_time: 4 + inputs: + Acacia Sapling: + material: SAPLING + durability: 4 + amount: 1024 + outputs: + Crate of Acacia Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Acacia Sapling + lore: Crate of Acacia Sapling + Nether_Craft_Crate_of_Birch_Sapling: + name: Craft Crate of Birch Sapling + production_time: 4 + inputs: + Birch Sapling: + material: SAPLING + durability: 2 + amount: 1024 + outputs: + Crate of Birch Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Birch Sapling + lore: Crate of Birch Sapling + Nether_Craft_Crate_of_Dark_Oak_Sapling: + name: Craft Crate of Dark Oak Sapling + production_time: 4 + inputs: + Dark Oak Sapling: + material: SAPLING + durability: 5 + amount: 1024 + outputs: + Crate of Dark Oak Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Dark Oak Sapling + lore: Crate of Dark Oak Sapling + Nether_Craft_Crate_of_Grass_Blocks: + name: Craft Crate of Grass Blocks + production_time: 4 + inputs: + Grass Blocks: + material: GRASS + amount: 1024 + outputs: + Crate of Grass Blocks: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Grass Blocks + lore: Crate of Grass Blocks + Nether_Craft_Crate_of_Jungle_Sapling: + name: Craft Crate of Jungle Sapling + production_time: 4 + inputs: + Jungle Sapling: + material: SAPLING + durability: 3 + amount: 1024 + outputs: + Crate of Jungle Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Jungle Sapling + lore: Crate of Jungle Sapling + Nether_Craft_Crate_of_Oak_Sapling: + name: Craft Crate of Oak Sapling + production_time: 4 + inputs: + Oak Sapling: + material: SAPLING + durability: 0 + amount: 1024 + outputs: + Crate of Oak Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Oak Sapling + lore: Crate of Oak Sapling + Nether_Craft_Crate_of_Salmon: + name: Craft Crate of Salmon + production_time: 4 + inputs: + Cooked Salmon: + material: COOKED_FISH + durability: 1 + amount: 1024 + outputs: + Crate of Salmon: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Salmon + lore: Crate of Salmon + Nether_Craft_Crate_of_Spruce_Sapling: + name: Craft Crate of Spruce Sapling + production_time: 4 + inputs: + Spruce Sapling: + material: SAPLING + durability: 1 + amount: 1024 + outputs: + Crate of Spruce Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Spruce Sapling + lore: Crate of Spruce Sapling + Nether_Decraft_Crate_of_Melons: + name: Decraft Crate of Melons + production_time: 4 + inputs: + Crate of Melons: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Melons + lore: Crate of Melons + outputs: + Melon Blocks: + material: MELON_BLOCK + amount: 1024 + Nether_Decraft_Crate_of_Fish: + name: Decraft Crate of Fish + production_time: 4 + inputs: + Crate of Fish: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Fish + lore: Crate of Fish + outputs: + Fish: + material: COOKED_FISH + amount: 1024 + Nether_Decraft_Crate_of_Sugar_Cane: + name: Decraft Crate of Sugar Cane + production_time: 4 + inputs: + Crate of Sugar Cane: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Sugar Cane + lore: Crate of Sugar Cane + outputs: + Sugar Cane: + material: SUGAR_CANE + amount: 1024 + Nether_Decraft_Crate_of_Nether_Warts: + name: Decraft Crate of Nether Warts + production_time: 4 + inputs: + Crate of Nether Warts: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Nether Warts + lore: Crate of Nether Warts + outputs: + Nether Wart: + material: NETHER_STALK + amount: 1024 + Nether_Decraft_Crate_of_Cookies: + name: Decraft Crate of Cookies + production_time: 4 + inputs: + Crate of Cookies: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cookies + lore: Crate of Cookies + outputs: + Cookie: + material: COOKIE + amount: 1024 + Nether_Decraft_Crate_of_Baked_Potatoes: + name: Decraft Crate of Baked Potatoes + production_time: 4 + inputs: + Crate of Potatoes: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Potatoes + lore: Crate of Potatoes + outputs: + Potato: + material: BAKED_POTATO + amount: 1024 + Nether_Decraft_Crate_of_Carrots: + name: Decraft Crate of Carrots + production_time: 4 + inputs: + Crate of Carrots: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Carrots + lore: Crate of Carrots + outputs: + Carrot: + material: CARROT_ITEM + amount: 1024 + Nether_Decraft_Crate_of_Cocoa: + name: Decraft Crate of Cocoa + production_time: 4 + inputs: + Crate of Cocoa: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cocoa + lore: Crate of Cocoa + outputs: + Cocoa: + material: INK_SACK + durability: 3 + amount: 1024 + Nether_Decraft_Crate_of_Pumpkins: + name: Decraft Crate of Pumpkins + production_time: 4 + inputs: + Crate of Pumpkins: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Pumpkins + lore: Crate of Pumpkins + outputs: + Pumpkin: + material: PUMPKIN + amount: 1024 + Nether_Decraft_Crate_of_Cacti: + name: Decraft Crate of Cacti + production_time: 4 + inputs: + Crate of Cacti: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Cacti + lore: Crate of Cacti + outputs: + Catus: + material: CACTUS + amount: 1024 + Nether_Decraft_Crate_of_Bread: + name: Decraft Crate of Bread + production_time: 4 + inputs: + Crate of Bread: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Bread + lore: Crate of Bread + outputs: + Bread: + material: BREAD + amount: 1024 + Nether_Decraft_Crate_of_Wheat: + name: Decraft Crate of Wheat + production_time: 4 + inputs: + Crate of Wheat: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Wheat + lore: Crate of Wheat + outputs: + Wheat: + material: WHEAT + amount: 1024 + Nether_Decraft_Crate_of_Grass: + name: Decraft Crate of Grass + production_time: 4 + inputs: + Crate of Grass: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Grass + lore: Crate of Grass + outputs: + Grass: + material: LONG_GRASS + amount: 1024 + durability: 1 + Nether_Decraft_Crate_of_Red_Rose: + name: Decraft Crate of Red Rose + production_time: 4 + inputs: + Crate of Red Rose: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Red Rose + lore: Crate of Red Rose + outputs: + Red Roses: + material: RED_ROSE + amount: 1024 + Nether_Decraft_Crate_of_Vine: + name: Decraft Crate of Vine + production_time: 4 + inputs: + Crate of Vine: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Vine + lore: Crate of Vine + outputs: + Vine: + material: VINE + amount: 1024 + Nether_Decraft_Crate_of_Brown_Mushrooms: + name: Decraft Crate of Brown Mushrooms + production_time: 4 + inputs: + Crate of Brown Mushrooms: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Brown Mushrooms + lore: Crate of Brown Mushrooms + outputs: + Brown Mushroom: + material: BROWN_MUSHROOM + amount: 1024 + Nether_Decraft_Crate_of_Red_Mushrooms: + name: Decraft Crate of Red Mushrooms + production_time: 4 + inputs: + Crate of Red Mushrooms: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Red Mushrooms + lore: Crate of Red Mushrooms + outputs: + Red Mushroom: + material: RED_MUSHROOM + amount: 1024 + Nether_Decraft_Crate_of_Yellow_Flower: + name: Decraft Crate of Yellow Flower + production_time: 4 + inputs: + Crate of Yellow Flower: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Yellow Flower + lore: Crate of Yellow Flower + outputs: + Yellow Flower: + material: YELLOW_FLOWER + amount: 1024 + Nether_Decraft_Crate_of_Glass_Bottles: + name: Decraft Crate of Glass Bottles + production_time: 64 + inputs: + Crate of Glass Bottles: + material: WOOD + durability: 0 + amount: 8 + display_name: Crate of Glass Bottles + lore: Crate of Glass Bottles + outputs: + Sand: + material: SAND + amount: 512 + Nether_Decraft_Crate_of_Acacia_Sapling: + name: Decraft Crate of Acacia Sapling + production_time: 4 + inputs: + Crate of Acacia Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Acacia Sapling + lore: Crate of Acacia Sapling + outputs: + Acacia Sapling: + material: SAPLING + durability: 4 + amount: 1024 + Nether_Decraft_Crate_of_Birch_Sapling: + name: Decraft Crate of Birch Sapling + production_time: 4 + inputs: + Crate of Birch Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Birch Sapling + lore: Crate of Birch Sapling + outputs: + Birch Sapling: + material: SAPLING + durability: 2 + amount: 1024 + Nether_Decraft_Crate_of_Dark_Oak_Sapling: + name: Decraft Crate of Dark Oak Sapling + production_time: 4 + inputs: + Crate of Dark Oak Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Dark Oak Sapling + lore: Crate of Dark Oak Sapling + outputs: + Dark Oak Sapling: + material: SAPLING + durability: 5 + amount: 1024 + Nether_Decraft_Crate_of_Grass_Blocks: + name: Decraft Crate of Grass Blocks + production_time: 4 + inputs: + Crate of Grass Blocks: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Grass Blocks + lore: Crate of Grass Blocks + outputs: + Grass Blocks: + material: GRASS + amount: 1024 + Nether_Decraft_Crate_of_Jungle_Sapling: + name: Decraft Crate of Jungle Sapling + production_time: 4 + inputs: + Crate of Jungle Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Jungle Sapling + lore: Crate of Jungle Sapling + outputs: + Jungle Sapling: + material: SAPLING + durability: 3 + amount: 1024 + Nether_Decraft_Crate_of_Oak_Sapling: + name: Decraft Crate of Oak Sapling + production_time: 4 + inputs: + Crate of Oak Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Oak Sapling + lore: Crate of Oak Sapling + outputs: + Oak Sapling: + material: SAPLING + durability: 0 + amount: 1024 + Nether_Decraft_Crate_of_Salmon: + name: Decraft Crate of Salmon + production_time: 4 + inputs: + Crate of Salmon: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Salmon + lore: Crate of Salmon + outputs: + Cooked Salmon: + material: COOKED_FISH + durability: 1 + amount: 1024 + Nether_Decraft_Crate_of_Spruce_Sapling: + name: Decraft Crate of Spruce Sapling + production_time: 4 + inputs: + Crate of Spruce Sapling: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Spruce Sapling + lore: Crate of Spruce Sapling + outputs: + Spruce Sapling: + material: SAPLING + durability: 1 + amount: 1024 + Create_Diamond_Axe: + name: Create Diamond Axe + production_time: 40 + inputs: + Diamond Axe: + material: DIAMOND_AXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Diamond Axe: + material: DIAMOND_AXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Diamond_Pickaxe: + name: Create Diamond Pickaxe + production_time: 40 + inputs: + Diamond Pickaxe: + material: DIAMOND_PICKAXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Diamond Pickaxe: + material: DIAMOND_PICKAXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Diamond_Spade: + name: Create Diamond Spade + production_time: 40 + inputs: + Diamond Spade: + material: DIAMOND_SPADE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Diamond Spade: + material: DIAMOND_SPADE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Iron_Axe: + name: Create Iron Axe + production_time: 40 + inputs: + Iron Axe: + material: IRON_AXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Axe: + material: IRON_AXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Iron_Pickaxe: + name: Create Iron Pickaxe + production_time: 40 + inputs: + Iron Pickaxe: + material: IRON_PICKAXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Pickaxe: + material: IRON_PICKAXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Iron_Spade: + name: Create Iron Spade + production_time: 40 + inputs: + Iron Spade: + material: IRON_SPADE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Spade: + material: IRON_SPADE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Wooden_Axe: + name: Create Wooden_Axe + production_time: 40 + inputs: + Wooden Axe: + material: WOOD_PICKAXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Wooden Axe: + material: WOOD_PICKAXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Wooden_Spade: + name: Create Wooded Spade + production_time: 40 + inputs: + Wooden Spade: + material: WOOD_SPADE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Wooden Spade: + material: WOOD_SPADE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Wooden_Axe: + name: Create Wooden Axe + production_time: 40 + inputs: + Wooden Axe: + material: WOOD_AXE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Wooden Axe: + material: WOOD_AXE + amount: 1 + enchantments: + Efficiency 4: + type: DIG_SPEED + level: 4 + probability: 0.1 + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.08 + Fortune 3: + type: LOOT_BONUS_BLOCKS + level: 3 + probability: 0.42 + Silk Touch 1: + type: SILK_TOUCH + level: 1 + probability: 0.02 + Efficiency 3: + type: DIG_SPEED + level: 3 + probability: 0.02 + Fortune 2: + type: LOOT_BONUS_BLOCKS + level: 2 + probability: 0.36 + Create_Fishing_Rod: + name: Create Fishing Rod + production_time: 40 + inputs: + Fishing Rod: + material: FISHING_ROD + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 1 + outputs: + Enchanted Fishing Rod: + material: FISHING_ROD + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.57 + Lure 2: + type: LURE + level: 2 + probability: 0.16 + Luck of the Sea 2: + type: LUCK + level: 2 + probability: 0.16 + Lure 3: + type: LURE + level: 3 + probability: 0.06 + Luck of the Sea 3: + type: LUCK + level: 3 + probability: 0.05 + Create_Bow: + name: Create Bow + production_time: 40 + inputs: + Bow: + material: BOW + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Bow: + material: BOW + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.16 + Power 4: + type: ARROW_DAMAGE + level: 4 + probability: 0.26 + Power 3: + type: ARROW_DAMAGE + level: 3 + probability: 0.18 + Flame 1: + type: ARROW_FIRE + level: 1 + probability: 0.12 + Punch 1: + type: ARROW_KNOCKBACK + level: 1 + probability: 0.07 + Infinity 1: + type: ARROW_INFINITE + level: 1 + probability: 0.06 + Punch 2: + type: ARROW_KNOCKBACK + level: 2 + probability: 0.05 + Create_Diamond_Sword: + name: Create Diamond Sword + production_time: 40 + inputs: + Diamond Sword: + material: DIAMOND_SWORD + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Diamond Sword: + material: DIAMOND_SWORD + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.27 + Knockback 2: + type: KNOCKBACK + level: 2 + probability: 0.26 + Sharpness 3: + type: DAMAGE_ALL + level: 3 + probability: 0.04 + Smite 4: + type: DAMAGE_UNDEAD + level: 4 + probability: 0.17 + Bane of Arthropods 4: + type: DAMAGE_ARTHROPODS + level: 4 + probability: 0.16 + Sharpness 4: + type: DAMAGE_ALL + level: 4 + probability: 0.03 + Fire Aspect 2: + type: FIRE_ASPECT + level: 2 + probability: 0.02 + Looting 3: + type: LOOT_BONUS_MOBS + level: 3 + probability: 0.0115 + Looting 2: + type: LOOT_BONUS_MOBS + level: 2 + probability: 0.007 + Smite 5: + type: DAMAGE_UNDEAD + level: 5 + probability: 0.012 + Bane of Arthropods 5: + type: DAMAGE_ARTHROPODS + level: 5 + probability: 0.0105 + Fire Aspect 1: + type: FIRE_ASPECT + level: 1 + probability: 0.0075 + Bane of Arthropods 3: + type: DAMAGE_ARTHROPODS + level: 3 + probability: 0.003 + Smite 3: + type: DAMAGE_UNDEAD + level: 3 + probability: 0.003 + Create_Diamond_Leggings: + name: Create Diamond Leggings + production_time: 40 + inputs: + Diamond Leggings: + material: DIAMOND_LEGGINGS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 3 + outputs: + Enchanted Diamond Leggings: + material: DIAMOND_LEGGINGS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.16 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.26 + Projectile Protection 3: + type: PROTECTION_PROJECTILE + level: 3 + probability: 0.18 + ProjectileProtection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.12 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.07 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.06 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.05 + Create_Diamond_Boots: + name: Create Diamond Boots + production_time: 40 + inputs: + Diamond Boots: + material: DIAMOND_BOOTS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 3 + outputs: + Enchanted Diamond Boots: + material: DIAMOND_BOOTS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.07 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Feather Falling 4: + type: PROTECTION_FALL + level: 4 + probability: 0.25 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.24 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.14 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.13 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Create_Diamond_Chestplate: + name: Create Diamond Chestplate + production_time: 40 + inputs: + Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 3 + outputs: + Enchanted Diamond Chestplate: + material: DIAMOND_CHESTPLATE + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.04 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.27 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Thorns 2: + type: THORNS + level: 2 + probability: 0.19 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.18 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.12 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.12 + Thorn 1: + type: THORNS + level: 1 + probability: 0.01 + Create_Diamond_Helmet: + name: Create Diamond Helmet + production_time: 40 + inputs: + Diamond Helmet: + material: DIAMOND_HELMET + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 3 + outputs: + Enchanted Diamond Helmet: + material: DIAMOND_HELMET + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.06 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.19 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Aqua Affinity 1: + type: WATER_WORKER + level: 1 + probability: 0.18 + Respiration 3: + type: OXYGEN + level: 3 + probability: 0.17 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.13 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.10 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Respiration 2: + type: OXYGEN + level: 2 + probability: 0.01 + Create_Iron_Sword: + name: Create Iron Sword + production_time: 40 + inputs: + Iron Sword: + material: IRON_SWORD + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Sword: + material: IRON_SWORD + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.27 + Knockback 2: + type: KNOCKBACK + level: 2 + probability: 0.26 + Sharpness 3: + type: DAMAGE_ALL + level: 3 + probability: 0.04 + Smite 4: + type: DAMAGE_UNDEAD + level: 4 + probability: 0.17 + Bane of Arthropods 4: + type: DAMAGE_ARTHROPODS + level: 4 + probability: 0.16 + Sharpness 4: + type: DAMAGE_ALL + level: 4 + probability: 0.03 + Fire Aspect 2: + type: FIRE_ASPECT + level: 2 + probability: 0.02 + Looting 3: + type: LOOT_BONUS_MOBS + level: 3 + probability: 0.0115 + Looting 2: + type: LOOT_BONUS_MOBS + level: 2 + probability: 0.007 + Smite 5: + type: DAMAGE_UNDEAD + level: 5 + probability: 0.012 + Bane of Arthropods 5: + type: DAMAGE_ARTHROPODS + level: 5 + probability: 0.0105 + Fire Aspect 1: + type: FIRE_ASPECT + level: 1 + probability: 0.0075 + Bane of Arthropods 3: + type: DAMAGE_ARTHROPODS + level: 3 + probability: 0.003 + Smite 3: + type: DAMAGE_UNDEAD + level: 3 + probability: 0.003 + Create_Iron_Leggings: + name: Create Iron Leggings + production_time: 40 + inputs: + Iron Leggings: + material: IRON_LEGGINGS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Leggings: + material: IRON_LEGGINGS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.16 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.26 + Projectile Protection 3: + type: PROTECTION_PROJECTILE + level: 3 + probability: 0.18 + ProjectileProtection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.12 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.07 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.06 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.05 + Create_Iron_Boots: + name: Create Iron Boots + production_time: 40 + inputs: + Iron Boots: + material: IRON_BOOTS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Boots: + material: IRON_BOOTS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.07 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Feather Falling 4: + type: PROTECTION_FALL + level: 4 + probability: 0.25 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.24 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.14 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.13 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Create_Iron_Chestplate: + name: Create Iron Chestplate + production_time: 40 + inputs: + Iron Chestplate: + material: IRON_CHESTPLATE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Chestplate: + material: IRON_CHESTPLATE + amount: 1 + enchantments: + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.04 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.27 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Thorns 2: + type: THORNS + level: 2 + probability: 0.19 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.18 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.12 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.12 + Thorn 1: + type: THORNS + level: 1 + probability: 0.01 + Create_Iron_Helmet: + name: Create Iron Helmet + production_time: 40 + inputs: + Iron Helmet: + material: IRON_HELMET + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Iron Helmet: + material: IRON_HELMET + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.06 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.19 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Aqua Affinity 1: + type: WATER_WORKER + level: 1 + probability: 0.18 + Respiration 3: + type: OXYGEN + level: 3 + probability: 0.17 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.13 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.10 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Respiration 2: + type: OXYGEN + level: 2 + probability: 0.01 + Create_Wooden_Sword: + name: Create Wooden Sword + production_time: 40 + inputs: + Wooden Sword: + material: WOOD_SWORD + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 2 + outputs: + Enchanted Wooden Sword: + material: WOOD_SWORD + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.27 + Knockback 2: + type: KNOCKBACK + level: 2 + probability: 0.26 + Sharpness 3: + type: DAMAGE_ALL + level: 3 + probability: 0.04 + Smite 4: + type: DAMAGE_UNDEAD + level: 4 + probability: 0.17 + Bane of Arthropods 4: + type: DAMAGE_ARTHROPODS + level: 4 + probability: 0.16 + Sharpness 4: + type: DAMAGE_ALL + level: 4 + probability: 0.03 + Fire Aspect 2: + type: FIRE_ASPECT + level: 2 + probability: 0.02 + Looting 3: + type: LOOT_BONUS_MOBS + level: 3 + probability: 0.0115 + Looting 2: + type: LOOT_BONUS_MOBS + level: 2 + probability: 0.007 + Smite 5: + type: DAMAGE_UNDEAD + level: 5 + probability: 0.012 + Bane of Arthropods 5: + type: DAMAGE_ARTHROPODS + level: 5 + probability: 0.0105 + Fire Aspect 1: + type: FIRE_ASPECT + level: 1 + probability: 0.0075 + Bane of Arthropods 3: + type: DAMAGE_ARTHROPODS + level: 3 + probability: 0.003 + Smite 3: + type: DAMAGE_UNDEAD + level: 3 + probability: 0.003 + Create_Leather_Leggings: + name: Create Leather Leggings + production_time: 40 + inputs: + Leather Leggings: + material: LEATHER_LEGGINGS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 1 + outputs: + Enchanted Leather Leggings: + material: LEATHER_LEGGINGS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.16 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.26 + Projectile Protection 3: + type: PROTECTION_PROJECTILE + level: 3 + probability: 0.18 + ProjectileProtection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.12 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.07 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.06 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.05 + Create_Leather_Boots: + name: Create Leather Boots + production_time: 40 + inputs: + Leather Boots: + material: LEATHER_BOOTS + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 1 + outputs: + Enchanted Leather Boots: + material: LEATHER_BOOTS + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.07 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Feather Falling 4: + type: PROTECTION_FALL + level: 4 + probability: 0.25 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.24 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.14 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.13 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Create_Leather_Chestplate: + name: Create Leather Chestplate + production_time: 40 + inputs: + Leather Chestplate: + material: LEATHER_CHESTPLATE + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 1 + outputs: + Enchanted Leather Chestplate: + material: LEATHER_CHESTPLATE + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.04 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.27 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Thorns 2: + type: THORNS + level: 2 + probability: 0.19 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.18 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.12 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.12 + Thorn 1: + type: THORNS + level: 1 + probability: 0.01 + Create_Leather_Helmet: + name: Create Leather Helmet + production_time: 40 + inputs: + Leather Helmet: + material: LEATHER_HELMET + amount: 1 + Emerald Blocks: + material: EMERALD_BLOCK + amount: 1 + outputs: + Enchanted Leather Helmet: + material: LEATHER_HELMET + amount: 1 + enchantments: + Unbreaking 3: + type: DURABILITY + level: 3 + probability: 0.06 + Protection 3: + type: PROTECTION_ENVIRONMENTAL + level: 3 + probability: 0.04 + Projectile Protection 4: + type: PROTECTION_PROJECTILE + level: 4 + probability: 0.19 + Protection 4: + type: PROTECTION_ENVIRONMENTAL + level: 4 + probability: 0.03 + Aqua Affinity 1: + type: WATER_WORKER + level: 1 + probability: 0.18 + Respiration 3: + type: OXYGEN + level: 3 + probability: 0.17 + Fire Protection 3: + type: PROTECTION_FIRE + level: 3 + probability: 0.13 + Fire Protection 4: + type: PROTECTION_FIRE + level: 4 + probability: 0.10 + Blast Protection 4: + type: PROTECTION_EXPLOSIONS + level: 4 + probability: 0.10 + Respiration 2: + type: OXYGEN + level: 2 + probability: 0.01 + Wood_XP_0: + name: Wood XP Factory 1 + production_time: 80 + inputs: + Ender Pearls: + material: ENDER_PEARL + amount: 2 + Hay Bales: + material: HAY_BLOCK + amount: 3 + Glass Bottle: + material: GLASS_BOTTLE + amount: 4 + outputs: + XP Bottles: + material: EXP_BOTTLE + amount: 4 + Wood_XP_1: + name: Wood XP Factory 2 + production_time: 80 + inputs: + Endstone: + material: ENDER_STONE + amount: 16 + Nether Warts: + material: NETHER_WARTS + amount: 25 + Glass Bottle: + material: GLASS_BOTTLE + amount: 4 + outputs: + XP Bottles: + material: EXP_BOTTLE + amount: 4 + Wood_XP_2: + name: Wood XP Factory 3 + production_time: 80 + inputs: + Carrot: + material: CARROT + amount: 64 + Soul Sand: + material: SOUL_SAND + amount: 64 + Glass Bottle: + material: GLASS_BOTTLE + amount: 4 + outputs: + XP Bottles: + material: EXP_BOTTLE + amount: 4 + Wood_XP_3: + name: Wood XP Factory 4 + production_time: 80 + inputs: + Glowstone: + material: GLOWSTONE + amount: 16 + Potatoes: + material: POTATO_ITEM + amount: 64 + Glass Bottle: + material: GLASS_BOTTLE + amount: 4 + outputs: + XP Bottles: + material: EXP_BOTTLE + amount: 4 + Emerald_XP_0: + name: Emerald XP Block 1 + inputs: + Crate of Glass Bottles: + material: WOOD + durability: 0 + amount: 128 + display_name: Crate of Glass Bottles + lore: Crate of Glass Bottles + Crate of Carrots: + material: WOOD + durability: 0 + amount: 256 + display_name: Crate of Carrots + lore: Crate of Carrots + Crate of Sugar Cane: + material: WOOD + durability: 0 + amount: 256 + display_name: Crate of Sugar Cane + lore: Crate of Sugar Cane + Crate of Bread: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Bread + lore: Crate of Bread + Crate of Grass Blocks: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Grass Blocks + lore: Crate of Grass Blocks + Crate of Brown Mushrooms: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Brown Mushrooms + lore: Crate of Brown Mushrooms + Crate of Cocoa: + material: WOOD + durability: 0 + amount: 32 + display_name: Crate of Cocoa + lore: Crate of Cocoa + Crate of Melons: + material: WOOD + durability: 0 + amount: 32 + display_name: Crate of Melons + lore: Crate of Melons + Crate of Yellow Flower: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Yellow Flower + lore: Crate of Yellow Flower + Crate of Oak Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Oak Sapling + lore: Crate of Oak Sapling + Crate of Jungle Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Jungle Sapling + lore: Crate of Jungle Sapling + Crate of Acacia Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Acacia Sapling + lore: Crate of Acacia Sapling + outputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 84 + Emerald_XP_1: + name: Emerald XP Block 2 + inputs: + Crate of Glass Bottles: + material: WOOD + durability: 0 + amount: 128 + display_name: Crate of Glass Bottles + lore: Crate of Glass Bottles + Crate of Cacti: + material: WOOD + durability: 0 + amount: 256 + display_name: Crate of Cacti + lore: Crate of Cacti + Crate of Wheat: + material: WOOD + durability: 0 + amount: 192 + display_name: Crate of Wheat + lore: Crate of Wheat + Crate of Pumpkins: + material: WOOD + durability: 0 + amount: 128 + display_name: Crate of Pumpkins + lore: Crate of Pumpkins + Crate of Grass Blocks: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Grass + lore: Crate of Grass + Crate of Cocoa: + material: WOOD + durability: 0 + amount: 32 + display_name: Crate of Cocoa + lore: Crate of Cocoa + Crate of Red Mushrooms: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Red Mushrooms + lore: Crate of Red Mushrooms + Crate of Fish: + material: WOOD + durability: 0 + amount: 8 + display_name: Crate of Fish + lore: Crate of Fish + Crate of Salmon: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Salmon + lore: Crate of Salmon + Crate of Red Rose: + material: WOOD + durability: 0 + amount: 8 + display_name: Crate of Red Rose + lore: Crate of Red Rose + Crate of Spruce Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Spruce Sapling + lore: Crate of Spruce Sapling + Crate of Dark Oak Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Dark Oak Sapling + lore: Crate of Dark Oak Sapling + outputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 84 + Emerald_XP_2: + name: Emerald XP Block 3 + inputs: + Crate of Glass Bottles: + material: WOOD + durability: 0 + amount: 128 + display_name: Crate of Glass Bottles + lore: Crate of Glass Bottles + Crate of Cookies: + material: WOOD + durability: 0 + amount: 384 + display_name: Crate of Cookies + lore: Crate of Cookies + Crate of Potatoes: + material: WOOD + durability: 0 + amount: 256 + display_name: Crate of Potatoes + lore: Crate of Potatoes + Crate of Sugar Cane: + material: WOOD + durability: 0 + amount: 256 + display_name: Crate of Sugar Cane + lore: Crate of Sugar Cane + Crate of Pumpkins: + material: WOOD + durability: 0 + amount: 128 + display_name: Crate of Pumpkins + lore: Crate of Pumpkins + Crate of Nether Warts: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Nether Warts + lore: Crate of Nether Warts + Crate of Vine: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Vine + lore: Crate of Vine + Crate of Melons: + material: WOOD + durability: 0 + amount: 32 + display_name: Crate of Melons + lore: Crate of Melons + Crate of Red Mushrooms: + material: WOOD + durability: 0 + amount: 64 + display_name: Crate of Red Mushrooms + lore: Crate of Red Mushrooms + Crate of Yellow Flower: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Yellow Flower + lore: Crate of Yellow Flower + Crate of Grass: + material: WOOD + durability: 0 + amount: 16 + display_name: Crate of Grass Blocks + lore: Crate of Grass Blocks + Crate of Birch Sapling: + material: WOOD + durability: 0 + amount: 4 + display_name: Crate of Birch Sapling + lore: Crate of Birch Sapling + outputs: + Emerald Blocks: + material: EMERALD_BLOCK + amount: 84 From 338179062b4d335334fac2ac814bea1b0a267e80 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 20 Jun 2015 00:58:45 -0400 Subject: [PATCH 103/459] enchantment line doubled, fixed. --- config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config.yml b/config.yml index 9c26ec7c..cfc896c1 100644 --- a/config.yml +++ b/config.yml @@ -10281,7 +10281,6 @@ production_recipes: Enchanted Iron Chestplate: material: IRON_CHESTPLATE amount: 1 - enchantments: enchantments: Unbreaking 3: type: DURABILITY From a3a8eefa985170c724b99b2dee0c43252af2ea01 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 20 Jun 2015 01:09:29 -0400 Subject: [PATCH 104/459] Balancing compactor costs relative to targets for general compactor, per Matta --- config.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/config.yml b/config.yml index cfc896c1..003108e0 100644 --- a/config.yml +++ b/config.yml @@ -846,12 +846,9 @@ production_factories: material: COAL durability: 1 inputs: - Iron Block: - material: IRON_BLOCK - amount: 64 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 64 + Diamonds: + material: DIAMOND + amount: 64 recipes: - Nether_Craft_Crate_of_Acacia_Sapling - Nether_Craft_Crate_of_Baked_Potatoes @@ -882,11 +879,8 @@ production_factories: - Nether_Craft_Crate_of_Yellow_Flower repair_multiple: 3 repair_inputs: - Iron Block: - material: IRON_BLOCK - amount: 2 - Emerald Blocks: - material: EMERALD_BLOCK + Diamond: + material: DIAMOND amount: 2 Nether_Decompactor: name: Nether Decompactor @@ -897,10 +891,7 @@ production_factories: inputs: Diamonds: material: DIAMOND - amount: 64 - Emeralds Blocks: - material: EMERALD_BLOCK - amount: 128 + amount: 128 recipes: - Nether_Decraft_Crate_of_Acacia_Sapling - Nether_Decraft_Crate_of_Baked_Potatoes @@ -933,9 +924,6 @@ production_factories: repair_inputs: Diamonds: material: DIAMOND - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK amount: 2 Diamond_Cauldron: name: Diamond Cauldron From 890b7f60eb0f05dd57c7217614d7b7889b1d4a2b Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 19 Jun 2015 08:51:02 -0400 Subject: [PATCH 105/459] Some small tweaks. Added reset level if ttk changes his mind. some recipe test cruft, removed the double slab recipes as MC has removed support for them and they are just causing NPEs. Compactor balance costs commit, against approved target costs. fix for repair time & fuel consumption Found some more factorymod issues; amountAvailable() does not return multiples, just counts, and badly, making all the rest suffer. Anyway, put a workaround in the config. Finalizing the reset costs relative to TTKs edict now, almost done, then config + factory should be set. Feel free to put this latest change on civtest if people want to try it out. --- config.yml | 74 ++++--------------- .../igotyou/FactoryMod/FactoryModPlugin.java | 20 ++--- .../FactoryMod/Factorys/RepairFactory.java | 35 +++++---- .../properties/RepairFactoryProperties.java | 12 ++- .../igotyou/FactoryMod/utility/ItemList.java | 18 ++++- 5 files changed, 69 insertions(+), 90 deletions(-) diff --git a/config.yml b/config.yml index ef62216c..75453bca 100644 --- a/config.yml +++ b/config.yml @@ -79,9 +79,9 @@ repair_factory: amount: 1 durability: 1 fuel_time: 5 - repair_multiple: 10 - name: 'Repair Factory' + name: 'Reset Factory' production_time: 20 + reset_level: 1 costs: construction: Coal Ore: @@ -96,10 +96,11 @@ repair_factory: Gold Ore: material: 'GOLD_ORE' amount: 8 + repair_multiple: 30 repair: Coal Ore: material: 'COAL_ORE' - amount: 3 + amount: 1 recipe: Coal Ore: material: 'COAL_ORE' @@ -221,15 +222,18 @@ compactor: amount: 64 display_name: Crate lore: A crate for compacting items - Redstone: + 'Redstone Blocks': material: REDSTONE - amount: 320 + amount: 64 Piston: material: PISTON_BASE amount: 64 - Diamond: - material: DIAMOND + 'Diamond Blocks': + material: DIAMOND_BLOCK amount: 8 + 'Emerald Blocks': + material: EMERALD_BLOCK + amount: 16 'Civtest Lock': material: BEDROCK amount: 1 @@ -241,13 +245,16 @@ compactor: lore: A crate for compacting items Redstone: material: REDSTONE - amount: 32 + amount: 58 Piston: material: PISTON_BASE amount: 6 Diamond: material: DIAMOND - amount: 1 + amount: 7 + Emerald: + material: EMERALD + amount: 14 recipe: CRATE: material: 'CHEST' @@ -381,55 +388,6 @@ crafting: Exp Bottle: material: EXP_BOTTLE amount: 9 - Stone to Double Slab: - inputs: - s: - Stone: - material: STONE - shape: - - sss - - sss - output: - Double Stone Slab: - material: DOUBLE_STEP - Slab to Double Slab: - inputs: - s: - Stone Slab: - material: STEP - shape: - - s - - s - output: - Double Stone Slab: - material: DOUBLE_STEP - Slab to Smooth Double Stone Slab: - inputs: - s: - Stone Slab: - material: STEP - shape: - - ss - - ss - output: - Smooth Slab: - material: DOUBLE_STEP - durability: 8 - amount: 2 - Sandstone Slab to Smooth Double Sandstone Slab: - inputs: - s: - Sandstone Slab: - material: STEP - durability: 1 - shape: - - ss - - ss - output: - Smooth Double Sandstone Slab: - material: DOUBLE_STEP - durability: 9 - amount: 2 production_factories: Bakery: name: Bakery diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 94380691..5c2da7af 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -309,6 +309,7 @@ public void initConfig() ConfigurationSection configSection=configCraftingEnable.getConfigurationSection(recipeName); Recipe recipe; List shape = configSection.getStringList("shape"); + NamedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); if(shape.isEmpty()) @@ -326,6 +327,12 @@ public void initConfig() } else { + for (String line : shape) { + sendConsoleMessage("New Shape Line: [" + line + "]"); + } + + sendConsoleMessage("output: " + output.toString()); + ShapedRecipe shapedRecipe = new ShapedRecipe(output); shapedRecipe.shape(shape.toArray(new String[shape.size()])); @@ -556,19 +563,6 @@ private NamedItemStack createItemStack(Material material, int stackSize, short d return namedItemStack; } - private void removeRecipe(Recipe removalRecipe) - { - Iterator it = getServer().recipeIterator(); - while (it.hasNext()) - { - Recipe recipe = it.next(); - if (recipe.getResult().getType() == removalRecipe.getResult().getType()) - { - it.remove(); - } - } - } - public static IFactoryProperties getProperties(FactoryType factoryType, String subFactoryType) { switch(factoryType) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 36f984bc..7b9ef84a 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -84,13 +84,14 @@ public void update() else { powerOff(); } - } - //if the production timer has reached the recipes production time remove input from chest, and add output material + } //if the production timer has reached the recipes production time remove input from chest, and add output material else if (currentProductionTimer >= getProductionTime()){ //Repairs the factory + repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); currentProductionTimer = 0; + currentEnergyTimer = 0; powerOff(); } } @@ -220,12 +221,16 @@ public double getEnergyTime() { @Override public double getProductionTime() { - return rfp.getProductionTime(); + if (mode.equals(RepairFactoryMode.REPAIR)) { + return rfp.getRepairTime(); + } else { + return rfp.getProductionTime(); + } } @Override public ItemList getInputs() { - if (mode == RepairFactoryMode.RESET_ITEMS) { + if (mode.equals(RepairFactoryMode.RESET_ITEMS)) { return rfp.getRecipeMaterials(); } else { return new ItemList(); @@ -239,7 +244,7 @@ public ItemList getOutputs() { @Override public ItemList getRepairs() { - if (mode == RepairFactoryMode.REPAIR) { + if (mode.equals( RepairFactoryMode.REPAIR)) { return rfp.getRepairMaterials(); } else { return new ItemList(); @@ -259,7 +264,7 @@ protected void recipeFinished() { if (repairable(stack)) { log.fine("Found repairable: " + stack.getType()); ItemStack s = CraftItemStack.asNMSCopy(stack); - s.setRepairCost(1); + s.setRepairCost(rfp.getResetLevel()); getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); } else { log.fine("Found non-repairable: " + stack.getType()); @@ -294,19 +299,19 @@ public List getCentralBlockResponse() { public List getChestResponse(){ List responses=new ArrayList(); String status=active ? "On" : "Off"; - double time = 0; + //double time = 0; int maxRepair = getMaxRepair(); boolean maintenanceActive = maxRepair!=0; String response = "Current costs are : "; // the response specific to the mode. - if (mode.getId() == 0){ - time = getEnergyTime(); + if (mode.equals(RepairFactoryMode.REPAIR)){ + //time = getEnergyTime(); response += getRepairs().toString(); - } - else if (mode.getId() == 1){ - time = getProductionTime(); + } else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ + //time = getProductionTime(); response += getInputs().toString(); } - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/time)+"% done." : ""; + + String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); responses.add(new InteractionResponse(InteractionResult.SUCCESS, rfp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); @@ -315,9 +320,11 @@ else if (mode.getId() == 1){ if(!getRepairs().isEmpty()&&maintenanceActive&& mode == RepairFactoryMode.REPAIR) { - int amountAvailable=getRepairs().amountAvailable(getInventory()); + // amountAvailable() is pretty broken, so addressing it in config for now. + int amountAvailable= getRepairs().amountAvailable(getInventory()); int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); + log.info(String.format("Repair mode: available %d repaired %d maxrepair %d percentRepaired %d", amountAvailable, amountRepaired, maxRepair, percentRepaired)); responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); } diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index fc61b964..c1697c20 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -23,10 +23,11 @@ public class RepairFactoryProperties implements IFactoryProperties{ private int repair; private double repairTime; private double productionTime; + private int resetLevel; public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, - double productionTime, ItemList recipeMaterials, List allowedRepairable){ + double productionTime, int resetLevel, ItemList recipeMaterials, List allowedRepairable){ this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -35,6 +36,7 @@ public RepairFactoryProperties(ItemList constructionMaterials, I this.repair = repair; this.repairTime = repairTime; this.productionTime = productionTime; + this.resetLevel = resetLevel; this.recipeMaterials = recipeMaterials; this.allowedRepairable = allowedRepairable; } @@ -82,6 +84,10 @@ public double getProductionTime(){ return productionTime; } + public int getResetLevel() { + return resetLevel; + } + public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){ ItemList rfFuel = plugin.getItems(section.getConfigurationSection("fuel")); if (rfFuel.isEmpty()){ @@ -98,6 +104,7 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config String rfName = section.getString("name", "Repair Factory"); int repairTime = section.getInt("repair_time", 12); int productionTime = section.getInt("production_time"); + int resetLevel = section.getInt("reset_level"); // We only care about raw material types for repair purposes. Iterator canRepair = rfAllowed.iterator(); @@ -110,6 +117,7 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config FactoryModPlugin.sendConsoleMessage("Adding repairable: " + repair.getType()); } - return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, rfRepair, repairTime, productionTime, rfRecipeUse, repairable); + return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, + rfRepair, repairTime, productionTime, resetLevel, rfRecipeUse, repairable); } } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index 01cf325e..2f31c49c 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -28,6 +28,8 @@ public class ItemList extends ArrayList { public boolean exactlyIn(Inventory inventory) { + //TODO: This is pretty broken too; won't handle split stacks right, a number of + // other edge cases; we've been very lucky so far. boolean returnValue=true; //Checks that the ItemList ItemStacks are contained in the inventory for(ItemStack itemStack:this) @@ -52,6 +54,7 @@ public boolean exactlyIn(Inventory inventory) } return returnValue; } + // TODO: Same issues exist here, I need to fix these. public boolean oneIn(Inventory inventory) { if(this.isEmpty()) @@ -74,6 +77,9 @@ public boolean allIn(Inventory inventory) { for(ItemStack itemStack:this) { + // TODO: Naive check. What about if you have 2 stacks of the same item, + // but only 1 in the chest? This test will return true for both stacks, + // which is the wrong answer. if (amountAvailable(inventory, itemStack) removeOneFrom(Inventory inventory) } return itemList; } + // TODO: Same risks here; these need to be addressed. public ItemList getDifference(Inventory inventory) { ItemList missingItems=new ItemList(); @@ -140,6 +147,8 @@ public ItemList getDifference(Inventory inventory) } public int amountAvailable(Inventory inventory) { + //TODO This is a very broken, so review: + // basically won't count correctly for repairs where a single-item repair cost is greater than a stack. int amountAvailable=0; for(ItemStack itemStack:this) { @@ -215,7 +224,8 @@ public String toString() } return returnString; } - //Returns the number of multiples of an ItemStack that are availible + //Returns the number of an ItemStack's MATERIAL that are available. + // TODO: Does not return multiple as previously advertised. private int amountAvailable(Inventory inventory, ItemStack itemStack) { int totalMaterial = 0; @@ -230,8 +240,9 @@ private int amountAvailable(Inventory inventory, ItemStack itemStack) */ if (itemStack.isSimilar(currentItemStack) || (itemStack.getType() == Material.NETHER_WARTS && currentItemStack.getType() == Material.NETHER_WARTS)) - { - totalMaterial += currentItemStack.getAmount(); + { + totalMaterial += currentItemStack.getAmount(); // not multiples + //totalMaterial += (int) Math.floor((double)currentItemStack.getAmount() / (double)itemStack.getAmount()); // return the actual number of multiples ... } } } @@ -273,6 +284,7 @@ else if(currentItemStack.getAmount() > materialsToRemove) } return materialsToRemove == 0; } + /* TODO: int version is just wrong. Use double version. */ public ItemList getMultiple(int multiplier) { ItemList multipliedItemList=new ItemList(); From 34c32eb6d7a160e161b50130630e513c7167d73c Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 20 Jun 2015 12:42:54 -0400 Subject: [PATCH 106/459] Added default level for reset and fixed default factory name to reset factory --- .../FactoryMod/properties/RepairFactoryProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index c1697c20..bbb9ac7a 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -101,10 +101,10 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config ItemList rfAllowed = plugin.getItems(section.getConfigurationSection("repairable")); int rfEnergyTime = section.getInt("fuel_time"); int rfRepair = costs.getInt("repair_multiple", 1); - String rfName = section.getString("name", "Repair Factory"); + String rfName = section.getString("name", "Reset Factory"); int repairTime = section.getInt("repair_time", 12); int productionTime = section.getInt("production_time"); - int resetLevel = section.getInt("reset_level"); + int resetLevel = section.getInt("reset_level", 1); // We only care about raw material types for repair purposes. Iterator canRepair = rfAllowed.iterator(); From 80a82f5063a4db98e2c482e75722a48dc43d5a78 Mon Sep 17 00:00:00 2001 From: dbear20 Date: Sat, 20 Jun 2015 18:03:43 -0400 Subject: [PATCH 107/459] Update config.yml Fixed a couple item id's that prevent recipes from working and fixed a couple grass/grass block crate names not matching config name the latter should have no effect on any recipe function. --- config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 003108e0..0562a56a 100644 --- a/config.yml +++ b/config.yml @@ -10652,8 +10652,8 @@ production_recipes: Endstone: material: ENDER_STONE amount: 16 - Nether Warts: - material: NETHER_WARTS + Nether Wart: + material: NETHER_WART amount: 25 Glass Bottle: material: GLASS_BOTTLE @@ -10667,7 +10667,7 @@ production_recipes: production_time: 80 inputs: Carrot: - material: CARROT + material: CARROT_ITEM amount: 64 Soul Sand: material: SOUL_SAND @@ -10802,7 +10802,7 @@ production_recipes: amount: 128 display_name: Crate of Pumpkins lore: Crate of Pumpkins - Crate of Grass Blocks: + Crate of Grass: material: WOOD durability: 0 amount: 64 @@ -10917,7 +10917,7 @@ production_recipes: amount: 16 display_name: Crate of Yellow Flower lore: Crate of Yellow Flower - Crate of Grass: + Crate of Grass Blocks: material: WOOD durability: 0 amount: 16 From f4ee6722a80072b2a0477a35e60fdaea2c270273 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 20 Jun 2015 19:31:03 -0400 Subject: [PATCH 108/459] General fixes, readability, etc. Confirmed locally all behaviors on repair factory are unchanged. Fixed some config errors for compactor. Verified locally that the compactor can be installed. Generally applied lessons learned from reset factory to compactor. Beginning process of debugging compactor. Current version in this commit locks the server on recipe end, ordering of generating output and removing input is reversed, etc. Repair of compactor works great now though. --- config.yml | 2 +- .../FactoryMod/Factorys/Compactor.java | 151 ++++++------------ .../FactoryMod/Factorys/RepairFactory.java | 125 +++++---------- .../igotyou/FactoryMod/utility/ItemList.java | 5 +- 4 files changed, 93 insertions(+), 190 deletions(-) diff --git a/config.yml b/config.yml index 75453bca..c3d661e0 100644 --- a/config.yml +++ b/config.yml @@ -223,7 +223,7 @@ compactor: display_name: Crate lore: A crate for compacting items 'Redstone Blocks': - material: REDSTONE + material: REDSTONE_BLOCK amount: 64 Piston: material: PISTON_BASE diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index 8f013b95..878f4819 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -8,9 +8,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; - import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; @@ -20,7 +17,6 @@ public class Compactor extends ABaseFactory { - private ReinforcementManager rm = Citadel.getReinforcementManager(); private CompactorProperties cp; private CompactorMode mode; @@ -42,7 +38,7 @@ public Compactor(Location factoryLocation, } public boolean isRepairing() { - return mode == CompactorMode.REPAIR; + return mode.equals(CompactorMode.REPAIR); } public ItemList getFuel() { @@ -54,23 +50,29 @@ public double getEnergyTime() { } public double getProductionTime() { - return cp.getProductionTime(); + if (mode.equals(CompactorMode.REPAIR)) { + return cp.getRepairTime(); + } else { + return cp.getProductionTime(); + } } public ItemList getInputs() { ItemList inputs = new ItemList(); Inventory inv = getInventory(); - if(mode == CompactorMode.DECOMPACT) { + if(mode.equals(CompactorMode.DECOMPACT)) { for(ItemStack is : inv.getContents()) { - if(is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { - inputs.add(new NamedItemStack(is.getType(), is.getMaxStackSize(), is.getDurability(), is.getItemMeta().getDisplayName())); + if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + NamedItemStack cloned = new NamedItemStack(is.getType(), 1 /*is.getAmount()*/, is.getDurability(), is.getItemMeta().getDisplayName()); + cloned.getItemMeta().setLore(is.getItemMeta().getLore()); + inputs.add(cloned); return inputs; } } - inputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Compacted Item")); - } else if (mode == CompactorMode.COMPACT) { + inputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Decompacted Item")); + } else if (mode.equals(CompactorMode.COMPACT)) { for(ItemStack is : inv.getContents()) { - if(is.getAmount() == is.getMaxStackSize()) { + if(is != null && is.getAmount() == is.getMaxStackSize()) { if(!is.getItemMeta().hasLore()) { inputs.add(new NamedItemStack(is.getType(), is.getAmount(), is.getDurability(), is.getItemMeta().getDisplayName())); inputs.addAll(cp.getRecipeMaterials()); @@ -86,17 +88,17 @@ public ItemList getInputs() { public ItemList getOutputs() { ItemList outputs = new ItemList(); Inventory inv = getInventory(); - if(mode == CompactorMode.DECOMPACT) { + if (mode.equals( CompactorMode.DECOMPACT )) { for(ItemStack is : inv.getContents()) { - if(is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { outputs.add(new NamedItemStack(is.getType(), is.getMaxStackSize(), is.getDurability(), is.getItemMeta().getDisplayName())); return outputs; } } outputs.add(new NamedItemStack(Material.AIR, 64, (short)1, "Decompacted Items")); - } else if (mode == CompactorMode.COMPACT) { - for(ItemStack is : inv.getContents()) { - if(is.getAmount() == is.getMaxStackSize()) { + } else if (mode.equals( CompactorMode.COMPACT )) { + for (ItemStack is : inv.getContents()) { + if(is != null && is.getAmount() == is.getMaxStackSize()) { NamedItemStack compactedItemStack = new NamedItemStack(is.getType(), 1, is.getDurability(), is.getItemMeta().getDisplayName()); compactedItemStack.getItemMeta().getLore().add(cp.getCompactLore()); outputs.add(compactedItemStack); @@ -109,100 +111,53 @@ public ItemList getOutputs() { } public ItemList getRepairs() { - return cp.getRepairMaterials(); + if (mode.equals( CompactorMode.REPAIR)) { + return cp.getRepairMaterials(); + } else { + return new ItemList(); + } } public void update() { - if(mode == CompactorMode.REPAIR) { - if(active) { - if(checkHasMaterials()) { - if(currentProductionTimer < getProductionTime()) { - if(isFuelAvailable()) { - if(currentEnergyTimer == getEnergyTime() - 1) { - getFuel().removeFrom(getPowerSourceInventory()); - currentEnergyTimer = 0; - fuelConsumed(); - } else { - currentEnergyTimer++; - } - currentProductionTimer++; - postUpdate(); + if(active) { + if(checkHasMaterials()) { + if(currentProductionTimer < getProductionTime()) { + if(isFuelAvailable()) { + if(currentEnergyTimer == getEnergyTime() - 1) { + getFuel().removeFrom(getPowerSourceInventory()); + currentEnergyTimer = 0; + fuelConsumed(); } else { - powerOff(); + currentEnergyTimer++; } - } else if(currentProductionTimer >= getProductionTime()) { - repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); - currentProductionTimer = 0; + currentProductionTimer++; + postUpdate(); + } else { powerOff(); } - } else { - powerOff(); - } - } - } else if(mode == CompactorMode.COMPACT) { - if(active) { - if(checkHasMaterials()) { - if(currentProductionTimer < getProductionTime()) { - if(isFuelAvailable()) { - if(currentEnergyTimer == getEnergyTime() - 1) { - getFuel().removeFrom(getPowerSourceInventory()); - currentEnergyTimer = 0; - fuelConsumed(); - } else { - currentEnergyTimer++; - } - currentProductionTimer++; - postUpdate(); - } else { - powerOff(); - } - } else if(currentProductionTimer >= getProductionTime()) { + } else if(currentProductionTimer >= getProductionTime()) { + if (mode.equals(CompactorMode.REPAIR)) { + repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); + } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { consumeInputs(); recipeFinished(); - - currentProductionTimer = 0; - powerOff(); - } - } else { - powerOff(); - } - } - } else if(mode == CompactorMode.DECOMPACT) { - if(active) { - if(checkHasMaterials()) { - if(currentProductionTimer < getProductionTime()) { - if(isFuelAvailable()) { - if(currentEnergyTimer == getEnergyTime() - 1) { - getFuel().removeFrom(getPowerSourceInventory()); - currentEnergyTimer = 0; - fuelConsumed(); - } else { - currentEnergyTimer++; - } - currentProductionTimer++; - postUpdate(); - } else { - powerOff(); - } - } else if(currentProductionTimer >= getProductionTime()) { - consumeInputs(); - - recipeFinished(); - - currentProductionTimer = 0; - powerOff(); - } - } else { + } + currentProductionTimer = 0; + currentEnergyTimer = 0; powerOff(); } + } else { + powerOff(); } } } protected void recipeFinished() { + ItemList output = getOutputs(); //.putIn(getInventory()); getInputs().removeOneFrom(getInventory()); - getOutputs().putIn(getInventory()); + output.putIn(getInventory()); + } public int getMaxRepair() { @@ -225,19 +180,17 @@ public List getCentralBlockResponse() { public List getChestResponse(){ List responses=new ArrayList(); String status=active ? "On" : "Off"; - double time = 0; int maxRepair = getMaxRepair(); boolean maintenanceActive = maxRepair!=0; String response = "Current costs are : "; // the response specific to the mode. - if (mode.getId() == 0){ - time = getEnergyTime(); + if (mode.equals(CompactorMode.REPAIR)){ response += getRepairs().toString(); } - else if (mode.getId() == 1){ - time = getProductionTime(); + else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)){ response += getInputs().toString(); } - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/time)+"% done." : ""; + + String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); responses.add(new InteractionResponse(InteractionResult.SUCCESS, cp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 7b9ef84a..76390e8c 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -56,92 +56,49 @@ public ItemList getFuel() { @Override public void update() { - if (mode == RepairFactoryMode.REPAIR){ - //if factory is turned on - if (active){ - //if the materials required to produce the current recipe are in the factory inventory - if (checkHasMaterials()){ - //if the factory has been working for less than the required time for the recipe - if (currentProductionTimer < getProductionTime()){ - //if the factory power source inventory has enough fuel for at least 1 energyCycle - if (isFuelAvailable()){ - //if the time since fuel was last consumed is equal to how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime()-1){ - //remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); - //0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); - } - else { - currentEnergyTimer++; - } - //increment the production timer - currentProductionTimer ++; - postUpdate(); + //if factory is turned on + if (active){ + //if the materials required to produce the current recipe are in the factory inventory + if (checkHasMaterials()){ + //if the factory has been working for less than the required time for the recipe + if (currentProductionTimer < getProductionTime()){ + //if the factory power source inventory has enough fuel for at least 1 energyCycle + if (isFuelAvailable()){ + //if the time since fuel was last consumed is equal to how often fuel needs to be consumed + if (currentEnergyTimer == getEnergyTime()-1){ + //remove one fuel. + getFuel().removeFrom(getPowerSourceInventory()); + //0 seconds since last fuel consumption + currentEnergyTimer = 0; + fuelConsumed(); + } else { + currentEnergyTimer++; } - //if there is no fuel Available turn off the factory - else { - powerOff(); - } - } //if the production timer has reached the recipes production time remove input from chest, and add output material - else if (currentProductionTimer >= getProductionTime()){ - //Repairs the factory - - repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); - - currentProductionTimer = 0; - currentEnergyTimer = 0; + //increment the production timer + currentProductionTimer ++; + postUpdate(); + } else { //if there is no fuel Available turn off the factory powerOff(); } - } - else { - powerOff(); - } - } - } - else if (mode == RepairFactoryMode.RESET_ITEMS) { - if (active){ - //if the materials required to produce the current recipe are in the factory inventory - if (checkHasMaterials()){ - //if the factory has been working for less than the required time for the recipe - if (currentProductionTimer < getProductionTime()){ - //if the factory power source inventory has enough fuel for at least 1 energyCycle - if (isFuelAvailable()){ - //if the time since fuel was last consumed is equal to how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime()-1){ - //remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); - //0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); - } - else { - currentEnergyTimer++; - } - //increment the production timer - currentProductionTimer ++; - postUpdate(); - } - //if there is no fuel Available turn off the factory - else { - powerOff(); - } - } + } else if (currentProductionTimer >= getProductionTime()){ //if the production timer has reached the recipes production time remove input from chest, and add output material - else if (currentProductionTimer >= getProductionTime()){ + + if (mode == RepairFactoryMode.REPAIR) { + //Repairs the factory + repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); + } else if (mode == RepairFactoryMode.RESET_ITEMS) { consumeInputs(); // consumes the items needed. // Sets all the items to the miniumum needed repair cost. recipeFinished(); - - currentProductionTimer = 0; - powerOff(); } - } - else { + + currentProductionTimer = 0; + currentEnergyTimer = 0; powerOff(); } + } else { + powerOff(); } } } @@ -187,25 +144,17 @@ else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ } return response; } - } - //if there isn't enough fuel for at least one energy cycle - else - { + } else { //if there isn't enough fuel for at least one energy cycle //return a error message int multiplesRequired=(int)Math.ceil(getProductionTime()/(double)getEnergyTime()); response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is missing fuel! ("+getFuel().getMultiple(multiplesRequired).toString()+")")); return response; } - } - else - { + } else { response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is in disrepair!")); return response; } - } - //if the factory is on already - else - { + } else { //if the factory is on already //turn the factory off powerOff(); //return success message @@ -304,10 +253,8 @@ public List getChestResponse(){ boolean maintenanceActive = maxRepair!=0; String response = "Current costs are : "; // the response specific to the mode. if (mode.equals(RepairFactoryMode.REPAIR)){ - //time = getEnergyTime(); response += getRepairs().toString(); } else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ - //time = getProductionTime(); response += getInputs().toString(); } @@ -324,7 +271,7 @@ public List getChestResponse(){ int amountAvailable= getRepairs().amountAvailable(getInventory()); int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); - log.info(String.format("Repair mode: available %d repaired %d maxrepair %d percentRepaired %d", amountAvailable, amountRepaired, maxRepair, percentRepaired)); + log.finer(String.format("Repair mode: available %d repaired %d maxrepair %d percentRepaired %d", amountAvailable, amountRepaired, maxRepair, percentRepaired)); responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index 2f31c49c..7cb60bb8 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -29,7 +29,10 @@ public class ItemList extends ArrayList { public boolean exactlyIn(Inventory inventory) { //TODO: This is pretty broken too; won't handle split stacks right, a number of - // other edge cases; we've been very lucky so far. + // other edge cases; we've been very lucky so far. Basically only lucky b/c + // the "stack size" of input items is not divided, the requirement comes in as + // a single "stack" of say 96 items, etc. so this works. + // So not exactly "broken" but not clean, either. boolean returnValue=true; //Checks that the ItemList ItemStacks are contained in the inventory for(ItemStack itemStack:this) From 8eb97de7e31c575bff308fc5ed67e743b7e5dbbd Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 21 Jun 2015 00:59:32 -0400 Subject: [PATCH 109/459] Compactor is working. Need to test edge cases. New balance costs for Compactor and Repair factory applied, these are final to my knowledge. Noted during testing that redstone control of factories is broken, will need to review and repair later as compactor is a bit grindy otherwise. A few other tweaks and fixes and futurebugs identified as well; addressed a fail condition where certain item stacks have no maxstacksize, which will crash the server. This has been addressed. --- config.yml | 38 ++++++---- .../FactoryMod/Factorys/Compactor.java | 72 ++++++++++++------- .../igotyou/FactoryMod/utility/ItemList.java | 7 +- .../FactoryMod/utility/NamedItemStack.java | 4 ++ 4 files changed, 83 insertions(+), 38 deletions(-) diff --git a/config.yml b/config.yml index c3d661e0..98e5c46a 100644 --- a/config.yml +++ b/config.yml @@ -80,7 +80,7 @@ repair_factory: durability: 1 fuel_time: 5 name: 'Reset Factory' - production_time: 20 + production_time: 10 reset_level: 1 costs: construction: @@ -89,25 +89,37 @@ repair_factory: amount: 256 Iron Ore: material: 'IRON_ORE' - amount: 8 + amount: 16 Redstone Ore: material: 'REDSTONE_ORE' - amount: 8 - Gold Ore: - material: 'GOLD_ORE' - amount: 8 - repair_multiple: 30 + amount: 16 + Diamond Ore: + material: 'DIAMOND_ORE' + amount: 16 + Emerald Blocks: + material: 'EMERALD_BLOCK' + amount: 16 + repair_multiple: 2 repair: Coal Ore: material: 'COAL_ORE' + amount: 10 + Iron Ore: + material: 'IRON_ORE' + amount: 1 + Redstone Ore: + material: 'REDSTONE_ORE' + amount: 1 + Diamond Ore: + material: 'DIAMOND_ORE' + amount: 1 + Emerald Blocks: + material: 'EMERALD_BLOCK' amount: 1 recipe: - Coal Ore: - material: 'COAL_ORE' - amount: 64 Emerald Blocks: material: 'EMERALD_BLOCK' - amount: 8 + amount: 7 repairable: WOODEN_PICKAXE: material: WOOD_PICKAXE @@ -211,10 +223,10 @@ compactor: material: 'COAL' amount: 1 durability: 1 - fuel_time: 5 + fuel_time: 1 repair_multiple: 1 name: 'Compactor' - production_time: 20 + production_time: 1 costs: construction: Crate: diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index 878f4819..db8b9caa 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -4,9 +4,9 @@ import java.util.List; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; @@ -63,24 +63,24 @@ public ItemList getInputs() { if(mode.equals(CompactorMode.DECOMPACT)) { for(ItemStack is : inv.getContents()) { if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { - NamedItemStack cloned = new NamedItemStack(is.getType(), 1 /*is.getAmount()*/, is.getDurability(), is.getItemMeta().getDisplayName()); - cloned.getItemMeta().setLore(is.getItemMeta().getLore()); - inputs.add(cloned); + NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + clone.setAmount(1); + inputs.add(clone); + return inputs; } } - inputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Decompacted Item")); } else if (mode.equals(CompactorMode.COMPACT)) { for(ItemStack is : inv.getContents()) { - if(is != null && is.getAmount() == is.getMaxStackSize()) { - if(!is.getItemMeta().hasLore()) { - inputs.add(new NamedItemStack(is.getType(), is.getAmount(), is.getDurability(), is.getItemMeta().getDisplayName())); - inputs.addAll(cp.getRecipeMaterials()); - return inputs; - } + if(is != null && is.getAmount() == is.getMaxStackSize() && !is.getItemMeta().hasLore()) { + NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + inputs.add(clone); + + + inputs.addAll(cp.getRecipeMaterials()); + return inputs; } } - return cp.getRecipeMaterials(); } return inputs; } @@ -91,21 +91,31 @@ public ItemList getOutputs() { if (mode.equals( CompactorMode.DECOMPACT )) { for(ItemStack is : inv.getContents()) { if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { - outputs.add(new NamedItemStack(is.getType(), is.getMaxStackSize(), is.getDurability(), is.getItemMeta().getDisplayName())); + NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + clone.setAmount(clone.getMaxStackSize()); + ItemMeta cloneMeta = clone.getItemMeta(); + cloneMeta.setLore(null); + clone.setItemMeta(cloneMeta); + outputs.add(clone); + return outputs; } } - outputs.add(new NamedItemStack(Material.AIR, 64, (short)1, "Decompacted Items")); } else if (mode.equals( CompactorMode.COMPACT )) { for (ItemStack is : inv.getContents()) { - if(is != null && is.getAmount() == is.getMaxStackSize()) { - NamedItemStack compactedItemStack = new NamedItemStack(is.getType(), 1, is.getDurability(), is.getItemMeta().getDisplayName()); - compactedItemStack.getItemMeta().getLore().add(cp.getCompactLore()); - outputs.add(compactedItemStack); + if(is != null && is.getAmount() == is.getMaxStackSize() && !is.getItemMeta().hasLore()) { + NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + clone.setAmount(1); + ItemMeta cloneMeta = clone.getItemMeta(); + List lore = new ArrayList(); + lore.add(cp.getCompactLore()); + cloneMeta.setLore(lore); + clone.setItemMeta(cloneMeta); + + outputs.add(clone); return outputs; } } - outputs.add(new NamedItemStack(Material.AIR, 1, (short)1, "Compacted Item")); } return outputs; } @@ -139,7 +149,7 @@ public void update() { if (mode.equals(CompactorMode.REPAIR)) { repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { - consumeInputs(); + // consumeInputs(); one or the other :( recipeFinished(); } @@ -153,9 +163,22 @@ public void update() { } } + @Override + public boolean checkHasMaterials() { + if (mode.equals(CompactorMode.REPAIR)) { + return getAllInputs().allIn(getInventory()); + } else { + if (getInputs().isEmpty()) { + return false; + } else { + return true; + } + } + } + protected void recipeFinished() { ItemList output = getOutputs(); //.putIn(getInventory()); - getInputs().removeOneFrom(getInventory()); + getInputs().removeFrom(getInventory()); output.putIn(getInventory()); } @@ -185,9 +208,10 @@ public List getChestResponse(){ String response = "Current costs are : "; // the response specific to the mode. if (mode.equals(CompactorMode.REPAIR)){ response += getRepairs().toString(); - } - else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)){ - response += getInputs().toString(); + } else if (mode.equals(CompactorMode.COMPACT) ) { + response += (getInputs().isEmpty() ? "Nothing to compact." : getInputs().toString() ); + } else if (mode.equals(CompactorMode.DECOMPACT)){ + response += (getInputs().isEmpty() ? "Nothing to decompact." : getInputs().toString() + " " + cp.getCompactLore() ); } String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index 7cb60bb8..f3b6627c 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Random; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.Inventory; @@ -168,7 +169,11 @@ public void putIn(Inventory inventory,List probabilist { for(ItemStack itemStack:this) { - int maxStackSize=itemStack.getMaxStackSize(); + // Terrifying hardcode, but I think sometimes itemStack.maxsize == 0, yikes! + if (itemStack.getMaxStackSize() <= 0) { + Bukkit.getLogger().warning("Item Stack has maxsize of 0, something is very wrong."); + } + int maxStackSize=(itemStack.getMaxStackSize() == 0 ? 64 : itemStack.getMaxStackSize()); int amount=itemStack.getAmount(); while(amount>maxStackSize) { diff --git a/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java b/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java index 8fbfdf2f..31785c97 100644 --- a/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java +++ b/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java @@ -25,6 +25,10 @@ public NamedItemStack (final Material type, final int amount, final short damage super(type,amount,damage); this.commonName=commonName; } + public NamedItemStack(final ItemStack itemStack, final String commonName) { + super(itemStack); + this.commonName = commonName; + } public NamedItemStack clone() { try{ From 55a03e656f57a5b96fde76a68d4b5868661643ce Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 21 Jun 2015 02:40:00 -0400 Subject: [PATCH 110/459] Small fix to repairs for compactor to allow more than a single 100% repair. Tested a few specific compactor functions, namely around books to ensure no duplication was possible against printing press, and none possibility of dup with vanilla recipe crafting. --- config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 98e5c46a..2477ce79 100644 --- a/config.yml +++ b/config.yml @@ -224,7 +224,6 @@ compactor: amount: 1 durability: 1 fuel_time: 1 - repair_multiple: 1 name: 'Compactor' production_time: 1 costs: @@ -249,24 +248,25 @@ compactor: 'Civtest Lock': material: BEDROCK amount: 1 + repair_multiple: 3 repair: Crate: material: CHEST - amount: 6 + amount: 2 display_name: Crate lore: A crate for compacting items Redstone: material: REDSTONE - amount: 58 + amount: 19 Piston: material: PISTON_BASE - amount: 6 + amount: 2 Diamond: material: DIAMOND - amount: 7 + amount: 3 Emerald: material: EMERALD - amount: 14 + amount: 4 recipe: CRATE: material: 'CHEST' From 3e6feaa55a64157c24124ab2d74a3b08e383b479 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 22 Jun 2015 03:15:50 -0400 Subject: [PATCH 111/459] Compactor outwits all known duplications and only will compact simple items that lack complex ItemMeta. I've tested against every item in the Matta XP Emeralrd Tier diamond recipe (over 27 items) and they all work, both compacting and decompacting. --- .../FactoryMod/Factorys/Compactor.java | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index db8b9caa..9aa4dae6 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -20,6 +20,7 @@ public class Compactor extends ABaseFactory { private CompactorProperties cp; private CompactorMode mode; + public Compactor(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, CompactorProperties compactorProperties) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, FactoryType.COMPACTOR, "Compactor"); @@ -62,7 +63,7 @@ public ItemList getInputs() { Inventory inv = getInventory(); if(mode.equals(CompactorMode.DECOMPACT)) { for(ItemStack is : inv.getContents()) { - if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + if(canDecompact(is)) { NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(1); inputs.add(clone); @@ -72,11 +73,10 @@ public ItemList getInputs() { } } else if (mode.equals(CompactorMode.COMPACT)) { for(ItemStack is : inv.getContents()) { - if(is != null && is.getAmount() == is.getMaxStackSize() && !is.getItemMeta().hasLore()) { + if(canCompact(is)) { NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); inputs.add(clone); - inputs.addAll(cp.getRecipeMaterials()); return inputs; } @@ -85,12 +85,42 @@ public ItemList getInputs() { return inputs; } + /** + * Returns true is the item stack is not null, if the item is a full sized stack, with size + * more than one (to prevent simply adding lore to single items), that the item does NOT have + * lore, and that the item has simple metadata (not a book, fireworks, banners, beacons, other + * "special" items that generate a host of edge cases like duplication and cheap dye and other + * problems.) + * + * @param is the ItemStack to check validity of compaction + * @return true if can be compacted, false otherwise + */ + private boolean canCompact(ItemStack is) { + return is != null && is.getAmount() == is.getMaxStackSize() && is.getAmount() > 1 && + !is.getItemMeta().hasLore() && is.getItemMeta().getClass().getSuperclass().equals(java.lang.Object.class); + + /* bit of a hack at the end, but effectively only items with "simple" meta, where the implementation + * is strictly a subclass of Object, and not a subclass of bukkit's CraftMetaItem. */ + } + + /** + * Returns true if the item stack is not null, and has lore where the lore contains + * the special lore of this factory, and where the item has simple metadata (see canCompact). + * @param is the ItemStack to check validity of decompaction + * @return true if can be decompacted, false otherwise + */ + private boolean canDecompact(ItemStack is) { + return is != null && is.getItemMeta().hasLore() && + is.getItemMeta().getLore().contains(cp.getCompactLore()) && + is.getItemMeta().getClass().getSuperclass().equals(java.lang.Object.class); + } + public ItemList getOutputs() { ItemList outputs = new ItemList(); Inventory inv = getInventory(); if (mode.equals( CompactorMode.DECOMPACT )) { for(ItemStack is : inv.getContents()) { - if(is != null && is.getItemMeta().hasLore() && is.getItemMeta().getLore().contains(cp.getCompactLore())) { + if(canDecompact(is)) { NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(clone.getMaxStackSize()); ItemMeta cloneMeta = clone.getItemMeta(); @@ -103,7 +133,7 @@ public ItemList getOutputs() { } } else if (mode.equals( CompactorMode.COMPACT )) { for (ItemStack is : inv.getContents()) { - if(is != null && is.getAmount() == is.getMaxStackSize() && !is.getItemMeta().hasLore()) { + if(canCompact(is)) { NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(1); ItemMeta cloneMeta = clone.getItemMeta(); @@ -209,9 +239,11 @@ public List getChestResponse(){ if (mode.equals(CompactorMode.REPAIR)){ response += getRepairs().toString(); } else if (mode.equals(CompactorMode.COMPACT) ) { - response += (getInputs().isEmpty() ? "Nothing to compact." : getInputs().toString() ); + ItemList inputs = getInputs(); + response += (inputs.isEmpty() ? "Nothing to compact." : inputs.toString() ); } else if (mode.equals(CompactorMode.DECOMPACT)){ - response += (getInputs().isEmpty() ? "Nothing to decompact." : getInputs().toString() + " " + cp.getCompactLore() ); + ItemList inputs = getInputs(); + response += (inputs.isEmpty() ? "Nothing to decompact." : inputs.toString() + " " + cp.getCompactLore() ); } String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; From 6d97b64dfcdc31f529e9ed5fd3185916b3d81493 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 22 Jun 2015 09:38:23 -0400 Subject: [PATCH 112/459] Enchantment Options, allow optional specifying of at-least-one enchantment and safe-only enchantment combinations. --- .../FactoryMod/Factorys/ABaseFactory.java | 12 +++++- .../recipes/EnchantmentOptions.java | 43 +++++++++++++++++++ .../igotyou/FactoryMod/utility/ItemList.java | 11 ++--- 3 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index bc62e04d..81eddce1 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -19,6 +19,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.FactoryObject; +import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; @@ -229,9 +230,18 @@ public void consumeInputs() { getInputs().removeFrom(getInventory()); } + /** + * Implementations should override this to define any controls on enchantment. + * + * @return an instance of EnchantmentOptions + */ + public EnchantmentOptions getEnchantmentOptions() { + return EnchantmentOptions.DEFAULT; + } + public void produceOutputs() { //Adds outputs to chest with appropriate enchantments - getOutputs().putIn(getInventory(),getEnchantments()); + getOutputs().putIn(getInventory(),getEnchantments(), getEnchantmentOptions()); } public ItemList getAllInputs() { diff --git a/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java b/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java new file mode 100644 index 00000000..0c9c8b20 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java @@ -0,0 +1,43 @@ +package com.github.igotyou.FactoryMod.recipes; + +/** + * Wrapper for current and all future enchantment control options. + * + * @author ProgrammerDan + * @since v1.4.0 + * + */ +public class EnchantmentOptions { + private boolean safeOnly; + private boolean ensureOne; + + public static final EnchantmentOptions DEFAULT = new EnchantmentOptions(false, false); + + /** + * Standard constructor, sets the flag values. + * + * @param safeOnly true if only MC combinable enchantments allowed + * @param ensureOne true if should ensure at least one enchantment. + */ + public EnchantmentOptions(boolean safeOnly, boolean ensureOne) { + this.safeOnly = safeOnly; + this.ensureOne = ensureOne; + } + + /** + * Returns true if only safe to combine enchantments should be allowed. + * + * @return the value of the control flag. + */ + public boolean getSafeOnly() { + return this.safeOnly; + } + + /** + * Return true if only mod should ensure at least one enchantment on output. + * @return + */ + public boolean getEnsureOne() { + return this.ensureOne; + } +} diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index f3b6627c..c92e431d 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -17,6 +17,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; /** @@ -161,12 +162,12 @@ public int amountAvailable(Inventory inventory) } return amountAvailable; } - public void putIn(Inventory inventory) - { - putIn(inventory,new ArrayList()); + + public void putIn(Inventory inventory) { + putIn(inventory,new ArrayList(), EnchantmentOptions.DEFAULT); } - public void putIn(Inventory inventory,List probabilisticEnchaments) - { + + public void putIn(Inventory inventory,List probabilisticEnchaments, EnchantmentOptions enchantmentOptions) { for(ItemStack itemStack:this) { // Terrifying hardcode, but I think sometimes itemStack.maxsize == 0, yikes! From a41e96bfb8e403a849ebb8e35791d3631540b692 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 22 Jun 2015 09:49:25 -0400 Subject: [PATCH 113/459] Added configuration section enchantment_options to recipe load with options safe_only and ensure_one -- meaning should be obvious but will describe more fully in docs. --- .../igotyou/FactoryMod/FactoryModPlugin.java | 12 +++++++++++- .../FactoryMod/Factorys/ProductionFactory.java | 8 +++++++- .../FactoryMod/recipes/ProductionRecipe.java | 14 ++++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 5c2da7af..970ccf97 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -34,6 +34,7 @@ import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; +import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; @@ -373,11 +374,20 @@ public void initConfig() ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); //Outputs of the recipe, empty of there are no inputs ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); + //EnchantmentOptions of the recipe, all false if nothing set. + ConfigurationSection configEnchant = configSection.getConfigurationSection("enchantment_options"); + EnchantmentOptions enchantmentOptions = null; + if (configEnchant != null) { + enchantmentOptions = new EnchantmentOptions(configEnchant.getBoolean("safe_only", false), + configEnchant.getBoolean("ensure_one", false)); + } else { + enchantmentOptions = EnchantmentOptions.DEFAULT; + } //Enchantments of the recipe, empty of there are no inputs List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); //Whether this recipe can only be used once boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantments, useOnce, new ItemList()); + ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantmentOptions, enchantments, useOnce, new ItemList()); productionRecipes.put(title, recipe); //Store the titles of the recipes that this should point to List currentOutputRecipes = Lists.newArrayList(); diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java index d6d7cc7d..1388c984 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java @@ -8,6 +8,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; +import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; @@ -231,7 +232,7 @@ public List getChestResponse() protected void recipeFinished() { //Remove upgrade and replace it with its upgraded form - currentRecipe.getUpgrades().removeOneFrom(getInventory()).putIn(getInventory(),currentRecipe.getEnchantments()); + currentRecipe.getUpgrades().removeOneFrom(getInventory()).putIn(getInventory(),currentRecipe.getEnchantments(), currentRecipe.getEnchantmentOptions()); //Adds new recipes to the factory for (int i = 0; i < currentRecipe.getOutputRecipes().size();i++) @@ -279,6 +280,11 @@ public double getEnergyTime() { public double getProductionTime() { return currentRecipe.getProductionTime(); } + + @Override + public EnchantmentOptions getEnchantmentOptions() { + return currentRecipe.getEnchantmentOptions(); + } @Override public int getMaxRepair() { diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 712acd5b..dcdd8c24 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -19,10 +19,11 @@ public class ProductionRecipe implements IRecipe private ItemList repairs; private List outputRecipes; private List enchantments; + private EnchantmentOptions enchantmentOptions; private boolean useOnce; public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, - ItemList outputs,List enchantments,boolean useOnce, ItemList repairs) + ItemList outputs, EnchantmentOptions enchantmentOptions, List enchantments,boolean useOnce, ItemList repairs) { this.title=title; this.recipeName = recipeName; @@ -31,6 +32,7 @@ public ProductionRecipe(String title,String recipeName,int productionTime,ItemLi this.upgrades=upgrades; this.outputs = outputs; this.outputRecipes=new ArrayList(); + this.enchantmentOptions = enchantmentOptions; this.enchantments=enchantments; this.useOnce=useOnce; this.repairs=repairs; @@ -38,7 +40,7 @@ public ProductionRecipe(String title,String recipeName,int productionTime,ItemLi public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) { - this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),new ArrayList(),false,repairs); + this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),null,new ArrayList(),false,repairs); } public boolean hasMaterials(Inventory inventory) @@ -103,4 +105,12 @@ public boolean getUseOnce() { return useOnce; } + + public EnchantmentOptions getEnchantmentOptions() { + if (enchantmentOptions == null) { + return EnchantmentOptions.DEFAULT; + } else { + return enchantmentOptions; + } + } } From f76e4ebbea448f32597fd270f36a260bce249c83 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 23 Jun 2015 00:09:11 -0400 Subject: [PATCH 114/459] Fleshing out enchantment selection, pulling in ability to (1) limit to safe only enchantments and (2) ensure at least one enchantment is picked, with two overlapping checks to absolutely guarantee at least one enchantment while still paying respect to the probabilities in the recipe. --- .../igotyou/FactoryMod/utility/ItemList.java | 83 ++++++++++++++----- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index c92e431d..af6e11d3 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -10,6 +10,7 @@ import java.util.ListIterator; import java.util.Map; import java.util.Random; +import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -168,22 +169,18 @@ public void putIn(Inventory inventory) { } public void putIn(Inventory inventory,List probabilisticEnchaments, EnchantmentOptions enchantmentOptions) { - for(ItemStack itemStack:this) - { + for(ItemStack itemStack:this) { // Terrifying hardcode, but I think sometimes itemStack.maxsize == 0, yikes! if (itemStack.getMaxStackSize() <= 0) { Bukkit.getLogger().warning("Item Stack has maxsize of 0, something is very wrong."); } int maxStackSize=(itemStack.getMaxStackSize() == 0 ? 64 : itemStack.getMaxStackSize()); int amount=itemStack.getAmount(); - while(amount>maxStackSize) - { + while(amount>maxStackSize) { ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments); - for(Enchantment enchantment:enchantments.keySet()) - { - if(enchantment.canEnchantItem(itemStack)) - { + Map enchantments=getEnchantments(probabilisticEnchaments, enchantmentOptions); + for(Enchantment enchantment:enchantments.keySet()) { + if(enchantment.canEnchantItem(itemStack)) { itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); } } @@ -192,11 +189,9 @@ public void putIn(Inventory inventory,List probabilist amount-=maxStackSize; } ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments); - for(Enchantment enchantment:enchantments.keySet()) - { - if(enchantment.canEnchantItem(itemStack)) - { + Map enchantments=getEnchantments(probabilisticEnchaments, enchantmentOptions); + for(Enchantment enchantment:enchantments.keySet()) { + if(enchantment.canEnchantItem(itemStack)) { itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); } } @@ -205,20 +200,68 @@ public void putIn(Inventory inventory,List probabilist } } - public HashMap getEnchantments(List probabilisticEnchaments) + /** + * Attempts to pick a subset from available enchantments, using independent probabilities. + * If enchantment_options:ensure_one is set on the recipe, will pick one using + * cumulative probabilities if the independent probability selection fails to pick any. + * if *that* fails, it picks one at random from the full set. + * + * @param probabilisticEnchantments The set of applicable enchantments. + * @param enchantmentOptions The options for applying enchantments + * @return a set of enchantments to apply. + */ + public HashMap getEnchantments(List probabilisticEnchantments, EnchantmentOptions enchantmentOptions) { HashMap enchantments = new HashMap(); Random rand = new Random(); - for(int i=0;i=rand.nextDouble()) - { - enchantments.put(probabilisticEnchaments.get(i).getEnchantment(),probabilisticEnchaments.get(i).getLevel()); + double sum = 0.0d; + for(ProbabilisticEnchantment pe : probabilisticEnchantments) { + sum += pe.getProbability(); + if(pe.getProbability()>=rand.nextDouble()) { + // Logic fun: go ahead and add if safe only is false, otherwise check if safe. + if (!enchantmentOptions.getSafeOnly() || checkSafe(enchantments.keySet(), pe.getEnchantment())) { + enchantments.put(pe.getEnchantment(),pe.getLevel()); + } + } + } + // Force at least one, try to pick fairly (based on cumulative distribution first) + if (enchantmentOptions.getEnsureOne() && enchantments.size() == 0) { + double which = rand.nextDouble() * sum; + double sofar = 0.0d; + for (ProbabilisticEnchantment pe : probabilisticEnchantments) { + if (pe.getProbability() + sofar >= which) { + enchantments.put(pe.getEnchantment(), pe.getLevel()); + break; + } else { + sofar += pe.getProbability(); + } + } + if (enchantments.size() == 0) { // someone forgot to give any probabilities? + int i = rand.nextInt(probabilisticEnchantments.size()); + enchantments.put(probabilisticEnchantments.get(i).getEnchantment(),probabilisticEnchantments.get(i).getLevel()); } } return enchantments; } + /** + * Test function to ensure "safe" enchantment sets. Call before adding a new enchantment to a set + * of enchantments. + * + * @param current The current safe set + * @param test The new enchantment to test + * @return True if this new enchantment does not conflict with any prior enchantments, false otherwise. + */ + private boolean checkSafe(Set current, Enchantment test) { + for (Enchantment ench : current) { + if (test.conflictsWith(ench)) { + return false; + } + } + return true; + } + + public String toString() { String returnString=""; From 89006551150e35b9bc03a92f9bf1b37a2d319407 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 23 Jun 2015 01:19:54 -0400 Subject: [PATCH 115/459] Adding enchantment_options sections to each random enchantment recipe, to both ensure at least one enchantment and to ensure safe enchantment combinations. --- config.yml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/config.yml b/config.yml index a00ea234..a9c8160b 100644 --- a/config.yml +++ b/config.yml @@ -9382,6 +9382,9 @@ production_recipes: Enchanted Diamond Axe: material: DIAMOND_AXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9421,6 +9424,9 @@ production_recipes: Enchanted Diamond Pickaxe: material: DIAMOND_PICKAXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9460,6 +9466,9 @@ production_recipes: Enchanted Diamond Spade: material: DIAMOND_SPADE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9499,6 +9508,9 @@ production_recipes: Enchanted Iron Axe: material: IRON_AXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9538,6 +9550,9 @@ production_recipes: Enchanted Iron Pickaxe: material: IRON_PICKAXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9577,6 +9592,9 @@ production_recipes: Enchanted Iron Spade: material: IRON_SPADE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9616,6 +9634,9 @@ production_recipes: Enchanted Wooden Axe: material: WOOD_PICKAXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9655,6 +9676,9 @@ production_recipes: Enchanted Wooden Spade: material: WOOD_SPADE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9694,6 +9718,9 @@ production_recipes: Enchanted Wooden Axe: material: WOOD_AXE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Efficiency 4: type: DIG_SPEED @@ -9733,6 +9760,9 @@ production_recipes: Enchanted Fishing Rod: material: FISHING_ROD amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -9768,6 +9798,9 @@ production_recipes: Enchanted Bow: material: BOW amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -9811,6 +9844,9 @@ production_recipes: Enchanted Diamond Sword: material: DIAMOND_SWORD amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -9882,6 +9918,9 @@ production_recipes: Enchanted Diamond Leggings: material: DIAMOND_LEGGINGS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -9925,6 +9964,9 @@ production_recipes: Enchanted Diamond Boots: material: DIAMOND_BOOTS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -9972,6 +10014,9 @@ production_recipes: Enchanted Diamond Chestplate: material: DIAMOND_CHESTPLATE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10023,6 +10068,9 @@ production_recipes: Enchanted Diamond Helmet: material: DIAMOND_HELMET amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10078,6 +10126,9 @@ production_recipes: Enchanted Iron Sword: material: IRON_SWORD amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10149,6 +10200,9 @@ production_recipes: Enchanted Iron Leggings: material: IRON_LEGGINGS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10192,6 +10246,9 @@ production_recipes: Enchanted Iron Boots: material: IRON_BOOTS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10239,6 +10296,9 @@ production_recipes: Enchanted Iron Chestplate: material: IRON_CHESTPLATE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10290,6 +10350,9 @@ production_recipes: Enchanted Iron Helmet: material: IRON_HELMET amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10345,6 +10408,9 @@ production_recipes: Enchanted Wooden Sword: material: WOOD_SWORD amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10416,6 +10482,9 @@ production_recipes: Enchanted Leather Leggings: material: LEATHER_LEGGINGS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10459,6 +10528,9 @@ production_recipes: Enchanted Leather Boots: material: LEATHER_BOOTS amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10506,6 +10578,9 @@ production_recipes: Enchanted Leather Chestplate: material: LEATHER_CHESTPLATE amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY @@ -10557,6 +10632,9 @@ production_recipes: Enchanted Leather Helmet: material: LEATHER_HELMET amount: 1 + enchantment_options: + safe_only: true + ensure_one: true enchantments: Unbreaking 3: type: DURABILITY From 276fcaf996991fcf0b963d5949441d2c7cbbde63 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 23 Jun 2015 20:18:35 -0400 Subject: [PATCH 116/459] Repair cost fixes, remove anthropod from deterministic, fixed nether wart xp recipe component (again?) --- config.yml | 62 ++++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/config.yml b/config.yml index a9c8160b..deffe1e8 100644 --- a/config.yml +++ b/config.yml @@ -818,7 +818,7 @@ production_factories: inputs: Diamonds: material: DIAMOND - amount: 64 + amount: 70 recipes: - Nether_Craft_Crate_of_Acacia_Sapling - Nether_Craft_Crate_of_Baked_Potatoes @@ -861,7 +861,7 @@ production_factories: inputs: Diamonds: material: DIAMOND - amount: 128 + amount: 130 recipes: - Nether_Decraft_Crate_of_Acacia_Sapling - Nether_Decraft_Crate_of_Baked_Potatoes @@ -1140,11 +1140,11 @@ production_factories: amount: 32 recipes: - Create_Iron_Sword - repair_multiple: 2 + repair_multiple: 3 repair_inputs: Iron Blocks: material: IRON_BLOCK - amount: 3 + amount: 1 Random_Diamond_Tool_Factory: name: Random Diamond Tool Factory fuel: @@ -1159,11 +1159,10 @@ production_factories: - Create_Diamond_Axe - Create_Diamond_Pickaxe - Create_Diamond_Spade - repair_multiple: 2 + repair_multiple: 9 repair_inputs: Emerald Blocks: material: EMERALD_BLOCK - amount: 9 Random_Diamond_Armor_Factory: name: Random Diamond Armor Factory fuel: @@ -1179,11 +1178,10 @@ production_factories: - Create_Diamond_Boots - Create_Diamond_Chestplate - Create_Diamond_Helmet - repair_multiple: 2 + repair_multiple: 6 repair_inputs: Emerald Blocks: material: EMERALD_BLOCK - amount: 6 Random_Diamond_Weapon_Factory: name: Random Diamond Weapon Factory fuel: @@ -1197,11 +1195,10 @@ production_factories: recipes: - Create_Bow - Create_Diamond_Sword - repair_multiple: 2 + repair_multiple: 3 repair_inputs: Emerald Blocks: material: EMERALD_BLOCK - amount: 3 Sword_Enchantment_Factory: name: Sword Enchantment Factory fuel: @@ -1219,14 +1216,13 @@ production_factories: - Enchant_Sharpness - Enchant_Fire_Aspect - Enchant_Looting - - Enchant_Bane_Of_Arthropods repair_multiple: 10 repair_inputs: - Diamond Block: - material: DIAMOND_BLOCK + Diamonds: + material: DIAMOND amount: 3 - Emerald Block: - material: EMERALD_BLOCK + Emeralds: + material: EMERALD amount: 6 Armour_Enchantment_Factory: name: Armour Enchantment Factory @@ -1252,11 +1248,11 @@ production_factories: - Enchant_U3_Helmet repair_multiple: 10 repair_inputs: - Diamond Block: - material: DIAMOND_BLOCK + Diamonds: + material: DIAMOND amount: 6 - Emerald Block: - material: EMERALD_BLOCK + Emeralds: + material: EMERALD amount: 9 Tool_Enchantment_Factory: name: Tool Enchantment Factory @@ -1286,11 +1282,11 @@ production_factories: - Enchant_Spades_F3 repair_multiple: 10 repair_inputs: - Diamond Block: - material: DIAMOND_BLOCK + Diamonds: + material: DIAMOND amount: 9 - Emerald Block: - material: EMERALD_BLOCK + Emeralds: + material: EMERALD amount: 12 Glass_Smelter: name: Glass Smelter @@ -8216,24 +8212,6 @@ production_recipes: Looting: type: LOOT_BONUS_MOBS level: 3 - Enchant_Bane_Of_Arthropods: - name: Enchant With Bane of Arthropods 5. - production_time: 10 - inputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 50 - outputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - enchantments: - Bane of Arthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 Enchant_P4_Chest: name: Enchant Chest with Prot 4 production_time: 40 @@ -10701,7 +10679,7 @@ production_recipes: material: ENDER_STONE amount: 16 Nether Wart: - material: NETHER_WART + material: NETHER_STALK amount: 25 Glass Bottle: material: GLASS_BOTTLE From c41e64ff64ec5d799f5967ca8d6b851345c555fe Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Tue, 23 Jun 2015 22:22:43 -0400 Subject: [PATCH 117/459] @Goldmattress clarified was a leftover from earlier revision, revised crates of glass bottles down to 32 each recipe. --- config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index deffe1e8..99f75c44 100644 --- a/config.yml +++ b/config.yml @@ -10728,7 +10728,7 @@ production_recipes: Crate of Glass Bottles: material: WOOD durability: 0 - amount: 128 + amount: 32 display_name: Crate of Glass Bottles lore: Crate of Glass Bottles Crate of Carrots: @@ -10807,7 +10807,7 @@ production_recipes: Crate of Glass Bottles: material: WOOD durability: 0 - amount: 128 + amount: 32 display_name: Crate of Glass Bottles lore: Crate of Glass Bottles Crate of Cacti: @@ -10886,7 +10886,7 @@ production_recipes: Crate of Glass Bottles: material: WOOD durability: 0 - amount: 128 + amount: 32 display_name: Crate of Glass Bottles lore: Crate of Glass Bottles Crate of Cookies: From 34e0939e74b6f23ae75ad08abb5587cc86fdc007 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Wed, 24 Jun 2015 02:03:29 -0400 Subject: [PATCH 118/459] Just some label fixes for clarity. Tested every XP recipe, all worked as described with ingredient as described. --- config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 99f75c44..05b63a97 100644 --- a/config.yml +++ b/config.yml @@ -8590,7 +8590,7 @@ production_recipes: name: Craft Crate of Fish production_time: 4 inputs: - Fish: + Cooked Fish: material: COOKED_FISH amount: 1024 outputs: @@ -8646,7 +8646,7 @@ production_recipes: name: Craft Crate of Baked Potatoes production_time: 4 inputs: - Potato: + Baked Potato: material: BAKED_POTATO amount: 1024 outputs: @@ -8703,7 +8703,7 @@ production_recipes: name: Craft Crate of Cacti production_time: 4 inputs: - Catus: + Cactus: material: CACTUS amount: 1024 outputs: @@ -8984,7 +8984,7 @@ production_recipes: display_name: Crate of Fish lore: Crate of Fish outputs: - Fish: + Cooked Fish: material: COOKED_FISH amount: 1024 Nether_Decraft_Crate_of_Sugar_Cane: @@ -9040,7 +9040,7 @@ production_recipes: display_name: Crate of Potatoes lore: Crate of Potatoes outputs: - Potato: + Baked Potato: material: BAKED_POTATO amount: 1024 Nether_Decraft_Crate_of_Carrots: @@ -9097,7 +9097,7 @@ production_recipes: display_name: Crate of Cacti lore: Crate of Cacti outputs: - Catus: + Cactus: material: CACTUS amount: 1024 Nether_Decraft_Crate_of_Bread: From d4ec16b840a2ab0e67785ba86dc312d320013558 Mon Sep 17 00:00:00 2001 From: hlprimm Date: Wed, 24 Jun 2015 10:27:01 -0500 Subject: [PATCH 119/459] Fixed duplicate create_wooden_axe and typo wooded -> wooden --- config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 05b63a97..1703ce71 100644 --- a/config.yml +++ b/config.yml @@ -9598,8 +9598,8 @@ production_recipes: type: LOOT_BONUS_BLOCKS level: 2 probability: 0.36 - Create_Wooden_Axe: - name: Create Wooden_Axe + Create_Wooden_Pickaxe: + name: Create Wooden Pickaxe production_time: 40 inputs: Wooden Axe: @@ -9641,7 +9641,7 @@ production_recipes: level: 2 probability: 0.36 Create_Wooden_Spade: - name: Create Wooded Spade + name: Create Wooden Spade production_time: 40 inputs: Wooden Spade: From 27e9d51282f7a52e03e7b4be018959b4d813a66a Mon Sep 17 00:00:00 2001 From: hlprimm Date: Wed, 24 Jun 2015 10:42:47 -0500 Subject: [PATCH 120/459] More axe to pickaxe fixes --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 1703ce71..7fd05e36 100644 --- a/config.yml +++ b/config.yml @@ -9602,14 +9602,14 @@ production_recipes: name: Create Wooden Pickaxe production_time: 40 inputs: - Wooden Axe: + Wooden Pickaxe: material: WOOD_PICKAXE amount: 1 Emerald Blocks: material: EMERALD_BLOCK amount: 2 outputs: - Enchanted Wooden Axe: + Enchanted Wooden Pickaxe: material: WOOD_PICKAXE amount: 1 enchantment_options: From be522766afa501aa85f0f54c41dedd4455f54bb3 Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Thu, 25 Jun 2015 19:14:55 +0300 Subject: [PATCH 121/459] Fix for NF --- .../igotyou/FactoryMod/Factorys/NetherFactory.java | 10 +++------- .../FactoryMod/managers/NetherFactoryManager.java | 2 +- .../FactoryMod/persistence/NetherCsvReader.java | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index 3f572e0c..f138bbcb 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -30,7 +30,6 @@ public class NetherFactory extends ABaseFactory private Location netherTeleportPlatform; private Location overworldTeleportPlatform; private NetherOperationMode mode; - private NetherFactoryManager netherManager; public NetherOperationMode getMode() { return mode; } @@ -39,14 +38,13 @@ public NetherOperationMode getMode() { * Constructor called when creating portal */ public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, - NetherFactoryProperties netherFactoryProperties, NetherFactoryManager netherManager) + NetherFactoryProperties netherFactoryProperties) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.NETHER_FACTORY, "Nether factory"); this.netherTeleportPlatform = nTeleportPlatform; this.overworldTeleportPlatform = oTeleportPlatform; this.netherFactoryProperties = netherFactoryProperties; this.mode = NetherOperationMode.REPAIR; - this.netherManager = netherManager; } /** @@ -54,15 +52,13 @@ public NetherFactory (Location factoryLocation, Location factoryInventoryLocatio */ public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, boolean active, double currentMaintenance, - long timeDisrepair, NetherOperationMode mode, NetherFactoryProperties netherFactoryProperties, - NetherFactoryManager netherManager) + long timeDisrepair, NetherOperationMode mode, NetherFactoryProperties netherFactoryProperties) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.NETHER_FACTORY, active, "Nether factory", 0 , 0, currentMaintenance, timeDisrepair); this.netherFactoryProperties = netherFactoryProperties; this.netherTeleportPlatform = nTeleportPlatform; this.overworldTeleportPlatform = oTeleportPlatform; this.mode = mode; - this.netherManager = netherManager; } @Override @@ -449,7 +445,7 @@ public ItemList getRepairs() { switch(mode) { case REPAIR: repairMaterials.addAll(netherFactoryProperties.getRepairMaterials()); - repairMaterials = repairMaterials.getMultiple(netherManager.getScalingFactor(factoryLocation)); + repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactoryManager.class)).getScalingFactor(factoryLocation)); break; default: break; diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java index c1deadc9..21585b02 100644 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java @@ -132,7 +132,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve } Location oneUp = markerLocation.clone(); oneUp.add(0,1,0); - NetherFactory netherFactory = new NetherFactory(factoryLocation, inventoryLocation, powerSourceLocation, netherLocation, oneUp, plugin.getNetherFactoryProperties(), this); + NetherFactory netherFactory = new NetherFactory(factoryLocation, inventoryLocation, powerSourceLocation, netherLocation, oneUp, plugin.getNetherFactoryProperties()); if (constructionMaterials.removeFrom(netherFactory.getInventory())) { addFactory(netherFactory); diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index 0fe0a547..4eae654d 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -103,8 +103,7 @@ public NetherFactory read(ObjectInputStream input) throws Exception { long timeDisrepair = input.readLong(); return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, - active, currentRepair, timeDisrepair, mode, mPlugin.getNetherFactoryProperties(), - (NetherFactoryManager) mPlugin.manager.getManager(NetherFactoryManager.class)); + active, currentRepair, timeDisrepair, mode, mPlugin.getNetherFactoryProperties()); } } From 5d12be0d968bb95326aa66c070c823e709e52d07 Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Thu, 25 Jun 2015 19:54:19 +0300 Subject: [PATCH 122/459] repairMaterials = --- src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index f138bbcb..e57568e6 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -445,7 +445,7 @@ public ItemList getRepairs() { switch(mode) { case REPAIR: repairMaterials.addAll(netherFactoryProperties.getRepairMaterials()); - repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactoryManager.class)).getScalingFactor(factoryLocation)); + repairMaterials = repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactoryManager.class)).getScalingFactor(factoryLocation)); break; default: break; From 070ec6f63c4bf6a467bca0572f1ad83d2c2af09d Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Fri, 26 Jun 2015 04:09:23 +0300 Subject: [PATCH 123/459] Fix for NF --- .../FactoryMod/Factorys/NetherFactory.java | 2 +- target/FactoryMod-1.4.0-null.jar | Bin 0 -> 179610 bytes target/maven-archiver/pom.properties | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 target/FactoryMod-1.4.0-null.jar create mode 100644 target/maven-archiver/pom.properties diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index e57568e6..ca9f58ce 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -445,7 +445,7 @@ public ItemList getRepairs() { switch(mode) { case REPAIR: repairMaterials.addAll(netherFactoryProperties.getRepairMaterials()); - repairMaterials = repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactoryManager.class)).getScalingFactor(factoryLocation)); + repairMaterials = repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactory.class)).getScalingFactor(factoryLocation)); break; default: break; diff --git a/target/FactoryMod-1.4.0-null.jar b/target/FactoryMod-1.4.0-null.jar new file mode 100644 index 0000000000000000000000000000000000000000..7c6a69feb2a450c80ade37f7c7ad35af88ab4153 GIT binary patch literal 179610 zcmbrlbC74jmM&V=W!tvx>az7K+qPX@wr$(CZQC}xx@^3jJ7?}YGxx@vdGU5c?#$Tx zTVH+|xmM)*W2L+_2q-krzde(L8)E-!@Q)YN-yR^UEJ!CQE5;!I4;UoS#9x?w)pMiq z-`~IfHq?KH0R&|w#YB~q=>cN*fT>9tX*&9OIB7cSnW@=EMaCtTy<S|P680172MKmvzNyYoWf23HPr1}ohsa_FnBWl#7 z*vG74cmv%@lyvEJ>4E-36%bHz&ia265BgV?k)6%|*8P7XVE%zHvv4+dG5l|UDE}E~ zVP@y-VdwHs1}Xn#Zv6kdftZ1jvz?;{z|Q!;v8DKzw*R1U`fo@m|0RjFg_E<1t%>7* z$MUbG*cjLvnEhvx|GE#<|5A$mUxNRo#>nKKmh@kFsQxvNqupOBXA6^mUekZ2A^(>& zjwVJH_WwUQT%0YeEu206X*vJZMG*e#_}{T*W8i9H``>_x|4;B=*QWn>$EE+*{z&&f zvj4xhCnV6n>DCOh-WT~xA^x}hThP!uI~urJIMI99SWik$NizUslG=fr~${v698JOiK@DTV@3I~Dd`z1fFxL>3tEF>LpAChjN-i?EXzN|@V`$s zO;ls4_jj`wOo4z{|4#OAG5n7R{f~wIlhFTnC~xgzW?@TjWNqN&H0=eYue`i`!}UBf z<(b|^Yb+Qt9p(oGT;N9uMNE{wC(uG}0A)T(gf%c`OgdmTIZvP%hovV%cn4ZDUhy(|nhGf1Nol!%PIc@%`OXd$RqT_BqRGmiKh$C(q~O zCjxMv^=k+C4+B%Jw#F(FM6K2C652VW7#n!E)a92A!~L<74tr0I$sjBd$Gi{W!oI>HA8C+75z78 zkQUBouAys#GLH7Y)&&%BuLCS zR;hGPOP-fBms{M%B%JS1C`HSgYezM=RZ9k_fc)NG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LcSAUcHdB*D9g7JTYOVJL)hcY)Yi&nRv@JyIjUn|4;lL3w zL^w0#n>F)x5``e)ijfr*fxSP$WK$Z1bw67Ir#s Date: Fri, 26 Jun 2015 04:11:39 +0300 Subject: [PATCH 124/459] oops --- target/FactoryMod-1.4.0-null.jar | Bin 179610 -> 0 bytes target/maven-archiver/pom.properties | 5 ----- 2 files changed, 5 deletions(-) delete mode 100644 target/FactoryMod-1.4.0-null.jar delete mode 100644 target/maven-archiver/pom.properties diff --git a/target/FactoryMod-1.4.0-null.jar b/target/FactoryMod-1.4.0-null.jar deleted file mode 100644 index 7c6a69feb2a450c80ade37f7c7ad35af88ab4153..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 179610 zcmbrlbC74jmM&V=W!tvx>az7K+qPX@wr$(CZQC}xx@^3jJ7?}YGxx@vdGU5c?#$Tx zTVH+|xmM)*W2L+_2q-krzde(L8)E-!@Q)YN-yR^UEJ!CQE5;!I4;UoS#9x?w)pMiq z-`~IfHq?KH0R&|w#YB~q=>cN*fT>9tX*&9OIB7cSnW@=EMaCtTy<S|P680172MKmvzNyYoWf23HPr1}ohsa_FnBWl#7 z*vG74cmv%@lyvEJ>4E-36%bHz&ia265BgV?k)6%|*8P7XVE%zHvv4+dG5l|UDE}E~ zVP@y-VdwHs1}Xn#Zv6kdftZ1jvz?;{z|Q!;v8DKzw*R1U`fo@m|0RjFg_E<1t%>7* z$MUbG*cjLvnEhvx|GE#<|5A$mUxNRo#>nKKmh@kFsQxvNqupOBXA6^mUekZ2A^(>& zjwVJH_WwUQT%0YeEu206X*vJZMG*e#_}{T*W8i9H``>_x|4;B=*QWn>$EE+*{z&&f zvj4xhCnV6n>DCOh-WT~xA^x}hThP!uI~urJIMI99SWik$NizUslG=fr~${v698JOiK@DTV@3I~Dd`z1fFxL>3tEF>LpAChjN-i?EXzN|@V`$s zO;ls4_jj`wOo4z{|4#OAG5n7R{f~wIlhFTnC~xgzW?@TjWNqN&H0=eYue`i`!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&bgGdF3M#~<~%fUto-3xuPM?(5N8KxI0C>mn(FO%Nfxkxr0I1zI{WE2+b z3fL1&PHNEZp~lLMShdKS&nrF&D0-;W{xnBgKMtmU;sFfqy8 zCquK=Bcg3Z0*d4x9Nta(bsr>Q*8XthoD;@dKBCJuIv6#mMV`BeSVQL4n;&K1EU8?I z=VW}py9wg-;v&T>9hSl4Q;`&I%y6gp0mLhVc%Eb9n{e-yvs+CeVI zo^MJ_Wf-47&NB-_ymgrLcSAUcHdB*D9g7JTYOVJL)hcY)Yi&nRv@JyIjUn|4;lL3w zL^w0#n>F)x5``e)ijfr*fxSP$WK$Z1bw67Ir#s Date: Fri, 26 Jun 2015 00:48:44 -0400 Subject: [PATCH 125/459] Spade recipe input was listed as diamond pickaxe, fixed to say diamond spade. --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 7fd05e36..01a7364b 100644 --- a/config.yml +++ b/config.yml @@ -8378,7 +8378,7 @@ production_recipes: name: Enchant Spade with Efficiency 5 production_time: 10 inputs: - Diamond Pick: + Diamond Spade: material: DIAMOND_SPADE amount: 5 Emerald Block: @@ -8432,7 +8432,7 @@ production_recipes: name: Enchant Spade with Unbreaking 3 production_time: 10 inputs: - Diamond Pick: + Diamond Spade: material: DIAMOND_SPADE amount: 5 Emerald Block: @@ -8486,7 +8486,7 @@ production_recipes: name: Enchant Spade with Silk Touch production_time: 10 inputs: - Diamond Pick: + Diamond Spade: material: DIAMOND_SPADE amount: 5 Emerald Block: @@ -8540,7 +8540,7 @@ production_recipes: name: Enchant Spade with Fortune 3 production_time: 10 inputs: - Diamond Pick: + Diamond Spade: material: DIAMOND_SPADE amount: 5 Emerald Block: From 6feb39a09a19df1b25aafef2e1dc94aba3f873d8 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 26 Jun 2015 03:13:46 -0400 Subject: [PATCH 126/459] Fix for dup issue. --- src/com/github/igotyou/FactoryMod/Factorys/Compactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index 9aa4dae6..efce92b4 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -198,7 +198,7 @@ public boolean checkHasMaterials() { if (mode.equals(CompactorMode.REPAIR)) { return getAllInputs().allIn(getInventory()); } else { - if (getInputs().isEmpty()) { + if (getInputs().isEmpty() || !getInputs().allIn(getInventory())) { return false; } else { return true; From 9bbb6d2bb5241913975c9ccd599b25d4e4e18a2b Mon Sep 17 00:00:00 2001 From: Jean-Luc Taylor Date: Thu, 25 Jun 2015 23:02:21 -0500 Subject: [PATCH 127/459] Updated Emerald Cauldron Recipes to base off of General Compactor; Unlocked General Compactor --- config.yml | 236 +++++++++++++++++++---------------------------------- 1 file changed, 86 insertions(+), 150 deletions(-) diff --git a/config.yml b/config.yml index 01a7364b..e6474202 100644 --- a/config.yml +++ b/config.yml @@ -245,9 +245,6 @@ compactor: 'Emerald Blocks': material: EMERALD_BLOCK amount: 16 - 'Civtest Lock': - material: BEDROCK - amount: 1 repair_multiple: 3 repair: Crate: @@ -8149,9 +8146,6 @@ production_recipes: Redstone: material: REDSTONE amount: 32 - 'Civtest Lock': - material: BEDROCK - amount: 1 outputs: Crate: material: CHEST @@ -10726,77 +10720,58 @@ production_recipes: name: Emerald XP Block 1 inputs: Crate of Glass Bottles: - material: WOOD - durability: 0 + material: GLASS_BOTTLE amount: 32 - display_name: Crate of Glass Bottles - lore: Crate of Glass Bottles + lore: Compacted Item Crate of Carrots: - material: WOOD - durability: 0 + material: CARROT_ITEM amount: 256 - display_name: Crate of Carrots - lore: Crate of Carrots + lore: Compacted Item Crate of Sugar Cane: - material: WOOD - durability: 0 + material: SUGAR_CANE amount: 256 - display_name: Crate of Sugar Cane - lore: Crate of Sugar Cane + lore: Compacted Item Crate of Bread: - material: WOOD - durability: 0 + material: BREAD amount: 64 - display_name: Crate of Bread - lore: Crate of Bread + lore: Compacted Item Crate of Grass Blocks: - material: WOOD - durability: 0 + material: GRASS + durability: 2 amount: 64 - display_name: Crate of Grass Blocks - lore: Crate of Grass Blocks + lore: Compacted Item Crate of Brown Mushrooms: - material: WOOD - durability: 0 + material: BROWN_MUSHROOM amount: 64 - display_name: Crate of Brown Mushrooms - lore: Crate of Brown Mushrooms + lore: Compacted Item Crate of Cocoa: - material: WOOD - durability: 0 + material: INK_SACK + durability: 3 amount: 32 - display_name: Crate of Cocoa - lore: Crate of Cocoa + lore: Compacted Item Crate of Melons: - material: WOOD - durability: 0 + material: MELON_BLOCK amount: 32 - display_name: Crate of Melons - lore: Crate of Melons - Crate of Yellow Flower: - material: WOOD - durability: 0 + lore: Compacted Item + Crate of Dandelions: + material: YELLOW_FLOWER amount: 16 - display_name: Crate of Yellow Flower - lore: Crate of Yellow Flower + lore: Compacted Item Crate of Oak Sapling: - material: WOOD + material: SAPLING durability: 0 amount: 4 - display_name: Crate of Oak Sapling - lore: Crate of Oak Sapling + lore: Compacted Item Crate of Jungle Sapling: - material: WOOD - durability: 0 + material: SAPLING + durability: 3 amount: 4 - display_name: Crate of Jungle Sapling - lore: Crate of Jungle Sapling + lore: Compacted Item Crate of Acacia Sapling: - material: WOOD - durability: 0 + material: SAPLING + durability: 4 amount: 4 - display_name: Crate of Acacia Sapling - lore: Crate of Acacia Sapling + lore: Compacted Item outputs: Emerald Blocks: material: EMERALD_BLOCK @@ -10805,77 +10780,60 @@ production_recipes: name: Emerald XP Block 2 inputs: Crate of Glass Bottles: - material: WOOD - durability: 0 + material: GLASS_BOTTLE amount: 32 - display_name: Crate of Glass Bottles - lore: Crate of Glass Bottles + lore: Compacted Item Crate of Cacti: - material: WOOD - durability: 0 + material: CACTUS amount: 256 - display_name: Crate of Cacti - lore: Crate of Cacti + lore: Compacted Item Crate of Wheat: - material: WOOD - durability: 0 + material: WHEAT amount: 192 - display_name: Crate of Wheat - lore: Crate of Wheat + lore: Compacted Item Crate of Pumpkins: - material: WOOD - durability: 0 + material: PUMPKIN amount: 128 - display_name: Crate of Pumpkins - lore: Crate of Pumpkins + lore: Compacted Item Crate of Grass: - material: WOOD - durability: 0 + material: LONG_GRASS + durability: 1 amount: 64 - display_name: Crate of Grass - lore: Crate of Grass + lore: Compacted Item Crate of Cocoa: - material: WOOD - durability: 0 + material: INK_SACK + durability: 3 amount: 32 - display_name: Crate of Cocoa - lore: Crate of Cocoa + lore: Compacted Item Crate of Red Mushrooms: - material: WOOD - durability: 0 + material: RED_MUSHROOM amount: 64 - display_name: Crate of Red Mushrooms - lore: Crate of Red Mushrooms + lore: Compacted Item Crate of Fish: - material: WOOD + material: COOKED_FISH durability: 0 amount: 8 - display_name: Crate of Fish - lore: Crate of Fish + lore: Compacted Item Crate of Salmon: - material: WOOD - durability: 0 + material: COOKED_FISH + durability: 1 amount: 4 - display_name: Crate of Salmon - lore: Crate of Salmon - Crate of Red Rose: - material: WOOD + lore: Compacted Item + Crate of Poppies: + material: RED_ROSE durability: 0 amount: 8 - display_name: Crate of Red Rose - lore: Crate of Red Rose + lore: Compacted Item Crate of Spruce Sapling: - material: WOOD - durability: 0 + material: SAPLING + durability: 1 amount: 4 - display_name: Crate of Spruce Sapling - lore: Crate of Spruce Sapling + lore: Compacted Item Crate of Dark Oak Sapling: - material: WOOD - durability: 0 + material: SAPLING + durability: 5 amount: 4 - display_name: Crate of Dark Oak Sapling - lore: Crate of Dark Oak Sapling + lore: Compacted Item outputs: Emerald Blocks: material: EMERALD_BLOCK @@ -10884,77 +10842,55 @@ production_recipes: name: Emerald XP Block 3 inputs: Crate of Glass Bottles: - material: WOOD - durability: 0 + material: GLASS_BOTTLE amount: 32 - display_name: Crate of Glass Bottles - lore: Crate of Glass Bottles + lore: Compacted Item Crate of Cookies: - material: WOOD - durability: 0 + material: COOKIE amount: 384 - display_name: Crate of Cookies - lore: Crate of Cookies + lore: Compacted Item Crate of Potatoes: - material: WOOD - durability: 0 + material: POTATO_ITEM amount: 256 - display_name: Crate of Potatoes - lore: Crate of Potatoes + lore: Compacted Item Crate of Sugar Cane: - material: WOOD - durability: 0 + material: SUGAR_CANE amount: 256 - display_name: Crate of Sugar Cane - lore: Crate of Sugar Cane + lore: Compacted Item Crate of Pumpkins: - material: WOOD - durability: 0 + material: PUMPKIN amount: 128 - display_name: Crate of Pumpkins - lore: Crate of Pumpkins + lore: Compacted Item Crate of Nether Warts: - material: WOOD - durability: 0 + material: NETHER_STALK amount: 64 - display_name: Crate of Nether Warts - lore: Crate of Nether Warts + lore: Compacted Item Crate of Vine: - material: WOOD - durability: 0 + material: VINE amount: 64 - display_name: Crate of Vine - lore: Crate of Vine + lore: Compacted Item Crate of Melons: - material: WOOD - durability: 0 + material: MELON_BLOCK amount: 32 - display_name: Crate of Melons - lore: Crate of Melons + lore: Compacted Item Crate of Red Mushrooms: - material: WOOD - durability: 0 + material: RED_MUSHROOM amount: 64 - display_name: Crate of Red Mushrooms - lore: Crate of Red Mushrooms - Crate of Yellow Flower: - material: WOOD - durability: 0 + lore: Compacted Item + Crate of Dandelions: + material: YELLOW_FLOWER amount: 16 - display_name: Crate of Yellow Flower - lore: Crate of Yellow Flower + lore: Compacted Item Crate of Grass Blocks: - material: WOOD - durability: 0 + material: GRASS + durability: 2 amount: 16 - display_name: Crate of Grass Blocks - lore: Crate of Grass Blocks + lore: Compacted Item Crate of Birch Sapling: - material: WOOD - durability: 0 + material: SAPLING + durability: 2 amount: 4 - display_name: Crate of Birch Sapling - lore: Crate of Birch Sapling + lore: Compacted Item outputs: Emerald Blocks: material: EMERALD_BLOCK From 1faa5f6c1c6502de14f42d4d307ed2be18e1bb65 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 27 Jun 2015 04:15:42 -0400 Subject: [PATCH 128/459] Compactor is continuous (solve #107), fixed some recipe label and content issues, still needs testing of every XP materal from GC to input on ECauldron. --- config.yml | 150 +++++++++--------- .../igotyou/FactoryMod/FactoryModPlugin.java | 3 +- .../FactoryMod/Factorys/Compactor.java | 24 ++- .../properties/CompactorProperties.java | 17 +- 4 files changed, 98 insertions(+), 96 deletions(-) diff --git a/config.yml b/config.yml index e6474202..01ad4bbd 100644 --- a/config.yml +++ b/config.yml @@ -235,35 +235,35 @@ compactor: lore: A crate for compacting items 'Redstone Blocks': material: REDSTONE_BLOCK - amount: 64 + amount: 16 Piston: material: PISTON_BASE + amount: 128 + 'Iron Ingots': + material: IRON_INGOT amount: 64 - 'Diamond Blocks': - material: DIAMOND_BLOCK - amount: 8 - 'Emerald Blocks': - material: EMERALD_BLOCK - amount: 16 - repair_multiple: 3 + 'Slime Balls': + material: SLIME_BALL + amount: 48 + repair_multiple: 6 repair: Crate: material: CHEST - amount: 2 + amount: 1 display_name: Crate lore: A crate for compacting items Redstone: material: REDSTONE - amount: 19 + amount: 2 Piston: material: PISTON_BASE amount: 2 - Diamond: - material: DIAMOND - amount: 3 - Emerald: - material: EMERALD - amount: 4 + 'Iron Ingots': + material: IRON_INGOT + amount: 1 + 'Slime Balls': + material: SLIME_BALL + amount: 1 recipe: CRATE: material: 'CHEST' @@ -271,6 +271,7 @@ compactor: display_name: Crate lore: A crate for compacting items compact_lore: Compacted Item + continuous: true copy_defaults: false general: central_block: WORKBENCH @@ -813,9 +814,10 @@ production_factories: material: COAL durability: 1 inputs: - Diamonds: - material: DIAMOND - amount: 70 + Bedrock: + material: BEDROCK + amount: 3456 + lore: 'Admin Crimes Only' recipes: - Nether_Craft_Crate_of_Acacia_Sapling - Nether_Craft_Crate_of_Baked_Potatoes @@ -844,11 +846,12 @@ production_factories: - Nether_Craft_Crate_of_Vine - Nether_Craft_Crate_of_Wheat - Nether_Craft_Crate_of_Yellow_Flower - repair_multiple: 3 + repair_multiple: 54 repair_inputs: - Diamond: - material: DIAMOND - amount: 2 + Bedrock: + material: BEDROCK + amount: 64 + lore: 'Admin Crimes Only' Nether_Decompactor: name: Nether Decompactor fuel: @@ -8139,17 +8142,17 @@ production_recipes: inputs: Chest: material: CHEST - amount: 16 - Piston: - material: PISTON_BASE - amount: 8 - Redstone: - material: REDSTONE - amount: 32 + amount: 27 + 'Iron Ingot': + material: IRON_INGOT + amount: 4 + Fence: + material: FENCE + amount: 256 outputs: Crate: material: CHEST - amount: 16 + amount: 54 display_name: Crate lore: A crate for compacting items Enchant_Sharpness: @@ -10719,55 +10722,53 @@ production_recipes: Emerald_XP_0: name: Emerald XP Block 1 inputs: - Crate of Glass Bottles: + Compacted Glass Bottles: material: GLASS_BOTTLE - amount: 32 + amount: 96 lore: Compacted Item - Crate of Carrots: + Compacted Carrots: material: CARROT_ITEM amount: 256 lore: Compacted Item - Crate of Sugar Cane: + Compacted Sugar Cane: material: SUGAR_CANE amount: 256 lore: Compacted Item - Crate of Bread: + Compacted Bread: material: BREAD amount: 64 lore: Compacted Item - Crate of Grass Blocks: + Compacted Grass Blocks: material: GRASS - durability: 2 amount: 64 lore: Compacted Item - Crate of Brown Mushrooms: + Compacted Brown Mushrooms: material: BROWN_MUSHROOM amount: 64 lore: Compacted Item - Crate of Cocoa: + Compacted Cocoa: material: INK_SACK durability: 3 amount: 32 lore: Compacted Item - Crate of Melons: + Compacted Melons: material: MELON_BLOCK amount: 32 lore: Compacted Item - Crate of Dandelions: + Compacted Yellow Flowers: material: YELLOW_FLOWER amount: 16 lore: Compacted Item - Crate of Oak Sapling: + Compacted Oak Sapling: material: SAPLING - durability: 0 amount: 4 lore: Compacted Item - Crate of Jungle Sapling: + Compacted Jungle Sapling: material: SAPLING durability: 3 amount: 4 lore: Compacted Item - Crate of Acacia Sapling: + Compacted Acacia Sapling: material: SAPLING durability: 4 amount: 4 @@ -10779,57 +10780,55 @@ production_recipes: Emerald_XP_1: name: Emerald XP Block 2 inputs: - Crate of Glass Bottles: + Compacted Glass Bottles: material: GLASS_BOTTLE - amount: 32 + amount: 96 lore: Compacted Item - Crate of Cacti: + Compacted Cacti: material: CACTUS amount: 256 lore: Compacted Item - Crate of Wheat: + Compacted Wheat: material: WHEAT amount: 192 lore: Compacted Item - Crate of Pumpkins: + Compacted Pumpkins: material: PUMPKIN amount: 128 lore: Compacted Item - Crate of Grass: + Compacted Grass: material: LONG_GRASS durability: 1 amount: 64 lore: Compacted Item - Crate of Cocoa: + Compacted Cocoa: material: INK_SACK durability: 3 amount: 32 lore: Compacted Item - Crate of Red Mushrooms: + Compacted Red Mushrooms: material: RED_MUSHROOM amount: 64 lore: Compacted Item - Crate of Fish: + Compacted Cooked Fish: material: COOKED_FISH - durability: 0 amount: 8 lore: Compacted Item - Crate of Salmon: + Compacted Cooked Salmon: material: COOKED_FISH durability: 1 amount: 4 lore: Compacted Item - Crate of Poppies: + Compacted Red Rose: material: RED_ROSE - durability: 0 amount: 8 lore: Compacted Item - Crate of Spruce Sapling: + Compacted Spruce Sapling: material: SAPLING durability: 1 amount: 4 lore: Compacted Item - Crate of Dark Oak Sapling: + Compacted Dark Oak Sapling: material: SAPLING durability: 5 amount: 4 @@ -10841,52 +10840,51 @@ production_recipes: Emerald_XP_2: name: Emerald XP Block 3 inputs: - Crate of Glass Bottles: + Compacted Glass Bottles: material: GLASS_BOTTLE - amount: 32 + amount: 96 lore: Compacted Item - Crate of Cookies: + Compacted Cookies: material: COOKIE amount: 384 lore: Compacted Item - Crate of Potatoes: - material: POTATO_ITEM + Compacted Baked Potatoes: + material: BAKED_POTATO amount: 256 lore: Compacted Item - Crate of Sugar Cane: + Compacted Sugar Cane: material: SUGAR_CANE amount: 256 lore: Compacted Item - Crate of Pumpkins: + Compacted Pumpkins: material: PUMPKIN amount: 128 lore: Compacted Item - Crate of Nether Warts: + Compacted Nether Warts: material: NETHER_STALK amount: 64 lore: Compacted Item - Crate of Vine: + Compacted Vine: material: VINE amount: 64 lore: Compacted Item - Crate of Melons: + Compacted Melons: material: MELON_BLOCK amount: 32 lore: Compacted Item - Crate of Red Mushrooms: + Compacted Red Mushrooms: material: RED_MUSHROOM amount: 64 lore: Compacted Item - Crate of Dandelions: + Compacted Yellow Flower: material: YELLOW_FLOWER amount: 16 lore: Compacted Item - Crate of Grass Blocks: + Compacted Grass Blocks: material: GRASS - durability: 2 amount: 16 lore: Compacted Item - Crate of Birch Sapling: + Compacted Birch Sapling: material: SAPLING durability: 2 amount: 4 diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 970ccf97..1b16a269 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -45,8 +45,6 @@ public class FactoryModPlugin extends JavaPlugin { - public CompactorProperties compactorProperties; - /* Special Values */ public static final String VERSION = "v1.4.0"; //Current version of plugin public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin @@ -176,6 +174,7 @@ public class FactoryModPlugin extends JavaPlugin public PrintingPressProperties printingPressProperties; public NetherFactoryProperties netherFactoryProperties; public RepairFactoryProperties repairFactoryProperties; + public CompactorProperties compactorProperties; public void onEnable() { diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index efce92b4..106ccc66 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -179,13 +179,16 @@ public void update() { if (mode.equals(CompactorMode.REPAIR)) { repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { - // consumeInputs(); one or the other :( - recipeFinished(); } - currentProductionTimer = 0; - currentEnergyTimer = 0; - powerOff(); + + currentProductionTimer = 0; + currentEnergyTimer = 0; + + // keep going? + if (!cp.getContinuous() || mode.equals(CompactorMode.REPAIR)) { + powerOff(); + } } } else { powerOff(); @@ -196,21 +199,16 @@ public void update() { @Override public boolean checkHasMaterials() { if (mode.equals(CompactorMode.REPAIR)) { - return getAllInputs().allIn(getInventory()); + return super.checkHasMaterials(); } else { - if (getInputs().isEmpty() || !getInputs().allIn(getInventory())) { - return false; - } else { - return true; - } + return super.checkHasMaterials() && !getInputs().isEmpty(); } } protected void recipeFinished() { - ItemList output = getOutputs(); //.putIn(getInventory()); + ItemList output = getOutputs(); getInputs().removeFrom(getInventory()); output.putIn(getInventory()); - } public int getMaxRepair() { diff --git a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java index 3541d4b0..67b60e72 100644 --- a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java @@ -18,12 +18,13 @@ public class CompactorProperties extends AFactoryProperties{ private double repairTime; private double productionTime; private String compactLore; + private boolean continuous; public CompactorProperties(ItemList constructionMaterials, - ItemList fuel, - ItemList repairMaterials, - ItemList recipeMaterials, int energyTime, - int repair, String name, double repairTime, double productionTime, String compactLore) { + ItemList fuel, ItemList repairMaterials, + ItemList recipeMaterials, int energyTime, int repair, + String name, double repairTime, double productionTime, String compactLore, + boolean continuous) { this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -34,6 +35,7 @@ public CompactorProperties(ItemList constructionMaterials, this.repairTime = repairTime; this.productionTime = productionTime; this.compactLore = compactLore; + this.continuous = continuous; } public ItemList getConstructionMaterials() { @@ -72,6 +74,10 @@ public String getCompactLore() { return compactLore; } + public boolean getContinuous() { + return continuous; + } + public static CompactorProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection config) { ItemList cFuel = plugin.getItems(config.getConfigurationSection("fuel")); if(cFuel.isEmpty()) { @@ -88,7 +94,8 @@ public static CompactorProperties fromConfig(FactoryModPlugin plugin, Configurat int repairTime = config.getInt("repair_time", 12); int productionTime = config.getInt("production_time"); String compactLore = config.getString("compact_lore", "Compacted Item"); - return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore); + boolean continuous = config.getBoolean("continuous", false); + return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore, continuous); } } From 937eba6990a8676ab18b5d2a62091e076dc4b070 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 27 Jun 2015 16:37:17 -0400 Subject: [PATCH 129/459] Lots of fixes here. revamped exclusion, configurable so as we find dup errors we can add them. Added the ones I know about -- maps, books, banners, and paper. Added auto-stop when factory chest is full. Altered messaging to indicate its full, what is up next, etc. to better demonstrate compactor is a continuous process. Retained general exclusion that items with lore cannot be compacted (to prevent infinite compaction). --- config.yml | 16 +++ .../FactoryMod/Factorys/ABaseFactory.java | 5 + .../FactoryMod/Factorys/Compactor.java | 98 +++++++++++++------ .../properties/CompactorProperties.java | 32 +++++- .../igotyou/FactoryMod/utility/ItemList.java | 62 +++++++++++- 5 files changed, 176 insertions(+), 37 deletions(-) diff --git a/config.yml b/config.yml index 01ad4bbd..556acde0 100644 --- a/config.yml +++ b/config.yml @@ -272,6 +272,22 @@ compactor: lore: A crate for compacting items compact_lore: Compacted Item continuous: true + specific_exclusions: + excluded_types: + Written Book: + material: WRITTEN_BOOK + Book: + material: BOOK + Book and Quill: + material: BOOK_AND_QUILL + Enchanted Book: + material: ENCHANTED_BOOK + Paper: + material: PAPER + Map: + material: EMPTY_MAP + Filled Map: + material: MAP copy_defaults: false general: central_block: WORKBENCH diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index 81eddce1..5a1fb138 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -116,6 +116,11 @@ public void powerOff() } } + public boolean checkHasSpace() { + ItemList output = getOutputs(); + return output.testPutIn(getInventory()); + } + public boolean checkHasMaterials() { return getAllInputs().allIn(getInventory()); } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index 106ccc66..fb58a323 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -88,31 +88,53 @@ public ItemList getInputs() { /** * Returns true is the item stack is not null, if the item is a full sized stack, with size * more than one (to prevent simply adding lore to single items), that the item does NOT have - * lore, and that the item has simple metadata (not a book, fireworks, banners, beacons, other - * "special" items that generate a host of edge cases like duplication and cheap dye and other - * problems.) + * lore, and that the item type isn't on the general exclusions nor is the item similar + * to any specific exclusions. + * + * Logic is structure to fail fast; e.g. quickest test is first, down in order to slowest test + * with success at each gate resulting in a slower test, so failure is fast and success is + * comprehensive. * * @param is the ItemStack to check validity of compaction * @return true if can be compacted, false otherwise */ private boolean canCompact(ItemStack is) { - return is != null && is.getAmount() == is.getMaxStackSize() && is.getAmount() > 1 && - !is.getItemMeta().hasLore() && is.getItemMeta().getClass().getSuperclass().equals(java.lang.Object.class); - - /* bit of a hack at the end, but effectively only items with "simple" meta, where the implementation - * is strictly a subclass of Object, and not a subclass of bukkit's CraftMetaItem. */ + if (is != null && is.getAmount() == is.getMaxStackSize() && + is.getAmount() > 1 && !is.getItemMeta().hasLore()) { + if (!cp.getGeneralExclusions().contains(is.getType())) { + for (ItemStack specExclude : cp.getSpecificExclusions()) { + if (specExclude.isSimilar(is)) { + return false; + } + } + return true; + } // else return false + } + return false; } /** * Returns true if the item stack is not null, and has lore where the lore contains - * the special lore of this factory, and where the item has simple metadata (see canCompact). + * the special lore of this factory, and where the item is not excluded. See canCompact. + * + * This is also fail-fast. + * * @param is the ItemStack to check validity of decompaction * @return true if can be decompacted, false otherwise */ private boolean canDecompact(ItemStack is) { - return is != null && is.getItemMeta().hasLore() && - is.getItemMeta().getLore().contains(cp.getCompactLore()) && - is.getItemMeta().getClass().getSuperclass().equals(java.lang.Object.class); + if (is != null && is.getItemMeta().hasLore() && + is.getItemMeta().getLore().contains(cp.getCompactLore()) ) { + if (!cp.getGeneralExclusions().contains(is.getType())) { + for (ItemStack specExclude : cp.getSpecificExclusions()) { + if (specExclude.isSimilar(is)) { + return false; + } + } + return true; + } // else return false + } + return false; } public ItemList getOutputs() { @@ -176,17 +198,24 @@ public void update() { powerOff(); } } else if(currentProductionTimer >= getProductionTime()) { - if (mode.equals(CompactorMode.REPAIR)) { - repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); - } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { - recipeFinished(); - } - - currentProductionTimer = 0; - currentEnergyTimer = 0; + if (checkHasSpace()) { + if (mode.equals(CompactorMode.REPAIR)) { + repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); + } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { + recipeFinished(); + } + + currentProductionTimer = 0; + currentEnergyTimer = 0; + + // keep going? + if (!cp.getContinuous() || mode.equals(CompactorMode.REPAIR)) { + powerOff(); + } + } else { // No room, shut off. + currentProductionTimer = 0; + currentEnergyTimer = 0; - // keep going? - if (!cp.getContinuous() || mode.equals(CompactorMode.REPAIR)) { powerOff(); } } @@ -233,23 +262,28 @@ public List getChestResponse(){ String status=active ? "On" : "Off"; int maxRepair = getMaxRepair(); boolean maintenanceActive = maxRepair!=0; - String response = "Current costs are : "; // the response specific to the mode. - if (mode.equals(CompactorMode.REPAIR)){ - response += getRepairs().toString(); - } else if (mode.equals(CompactorMode.COMPACT) ) { + String response = ""; // the response specific to the mode. + + if (mode.equals(CompactorMode.COMPACT) ) { ItemList inputs = getInputs(); - response += (inputs.isEmpty() ? "Nothing to compact." : inputs.toString() ); + response = (inputs.isEmpty() ? "Nothing to compact." : "Next stack to compact: " + inputs.toString() ); } else if (mode.equals(CompactorMode.DECOMPACT)){ ItemList inputs = getInputs(); - response += (inputs.isEmpty() ? "Nothing to decompact." : inputs.toString() + " " + cp.getCompactLore() ); + if (inputs.isEmpty()) { + response = "Nothing to decompact."; + } else { + if (checkHasSpace()) { + response = "Next up for decompact: " + inputs.toString() + " " + cp.getCompactLore(); + } else { + response = "Make room in the chest to decompact"; + } + } } String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); responses.add(new InteractionResponse(InteractionResult.SUCCESS, cp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); if(!getRepairs().isEmpty()&&maintenanceActive&& mode == CompactorMode.REPAIR) { @@ -257,7 +291,11 @@ public List getChestResponse(){ int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); + } else { + responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); } + + responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); return responses; } diff --git a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java index 67b60e72..2b572454 100644 --- a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java @@ -1,5 +1,9 @@ package com.github.igotyou.FactoryMod.properties; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -13,18 +17,21 @@ public class CompactorProperties extends AFactoryProperties{ private ItemList fuel; private ItemList repairMaterials; private ItemList recipeMaterials; + private ItemList specificExclusions; + private List generalExlusions; private int energyTime; private int repair; private double repairTime; private double productionTime; private String compactLore; private boolean continuous; + public CompactorProperties(ItemList constructionMaterials, ItemList fuel, ItemList repairMaterials, ItemList recipeMaterials, int energyTime, int repair, String name, double repairTime, double productionTime, String compactLore, - boolean continuous) { + boolean continuous, ItemList specificExclusion, List generalExclusion) { this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -36,6 +43,8 @@ public CompactorProperties(ItemList constructionMaterials, this.productionTime = productionTime; this.compactLore = compactLore; this.continuous = continuous; + this.specificExclusions = specificExclusion; + this.generalExlusions = generalExclusion; } public ItemList getConstructionMaterials() { @@ -53,6 +62,14 @@ public ItemList getRepairMaterials() { public ItemList getRecipeMaterials() { return recipeMaterials; } + + public ItemList getSpecificExclusions() { + return specificExclusions; + } + + public List getGeneralExclusions() { + return generalExlusions; + } public int getEnergyTime() { return energyTime; @@ -88,6 +105,8 @@ public static CompactorProperties fromConfig(FactoryModPlugin plugin, Configurat ItemList constructionCost = plugin.getItems(costs.getConfigurationSection("construction")); ItemList repairCost = plugin.getItems(costs.getConfigurationSection("repair")); ItemList recipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + ItemList specificExclusion = plugin.getItems(config.getConfigurationSection("specific_exclusions")); + ItemList generalExclusion = plugin.getItems(config.getConfigurationSection("excluded_types")); int energyTime = config.getInt("fuel_time"); int repair = costs.getInt("repair_multiple", 1); String name = config.getString("name", "Compactor"); @@ -95,7 +114,16 @@ public static CompactorProperties fromConfig(FactoryModPlugin plugin, Configurat int productionTime = config.getInt("production_time"); String compactLore = config.getString("compact_lore", "Compacted Item"); boolean continuous = config.getBoolean("continuous", false); - return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore, continuous); + Iterator genExcludeIter = generalExclusion.iterator(); + List generalExclude = new ArrayList(); + + while (genExcludeIter.hasNext()) { + NamedItemStack exclude = genExcludeIter.next(); + + generalExclude.add(exclude.getType()); + } + + return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore, continuous, specificExclusion, generalExclude); } } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index af6e11d3..0d58a21a 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -13,11 +13,17 @@ import java.util.Set; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.block.BlockState; +import org.bukkit.block.DoubleChest; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; @@ -164,11 +170,12 @@ public int amountAvailable(Inventory inventory) return amountAvailable; } - public void putIn(Inventory inventory) { - putIn(inventory,new ArrayList(), EnchantmentOptions.DEFAULT); + public boolean putIn(Inventory inventory) { + return putIn(inventory, new ArrayList(), EnchantmentOptions.DEFAULT); } - public void putIn(Inventory inventory,List probabilisticEnchaments, EnchantmentOptions enchantmentOptions) { + public boolean putIn(Inventory inventory,List probabilisticEnchaments, EnchantmentOptions enchantmentOptions) { + boolean putFailed = false; for(ItemStack itemStack:this) { // Terrifying hardcode, but I think sometimes itemStack.maxsize == 0, yikes! if (itemStack.getMaxStackSize() <= 0) { @@ -185,7 +192,10 @@ public void putIn(Inventory inventory,List probabilist } } itemClone.setAmount(maxStackSize); - inventory.addItem(itemClone); + HashMap leftover = inventory.addItem(itemClone); + if (!leftover.isEmpty()) { + putFailed = true; + } amount-=maxStackSize; } ItemStack itemClone=itemStack.clone(); @@ -196,8 +206,12 @@ public void putIn(Inventory inventory,List probabilist } } itemClone.setAmount(amount); - inventory.addItem(itemClone); + HashMap leftover = inventory.addItem(itemClone); + if (!leftover.isEmpty()) { + putFailed = true; + } } + return !putFailed; } /** @@ -369,4 +383,42 @@ public ItemList getMultiple(double multiplier) } return multipliedItemList; } + + public boolean testPutIn(Inventory inventory) { + return testPutIn(inventory, new ArrayList(), EnchantmentOptions.DEFAULT); + } + + public boolean testPutIn(Inventory inventory, List probabilisticEnchantments, + EnchantmentOptions enchantmentOptions) { + if (this.isEmpty()) { // "fail" fast. + return true; + } + + // Bukkit API lacks a way to test adding stuff. That sucks. + // Instead, we'll create a temporary "merged" inventory, and + // see if we can add everything into it without overflowing + Inventory merger = FactoryModPlugin.getPlugin().getServer().createInventory(null, inventory.getSize()); + for (ItemStack slot : inventory) { + if (slot != null) { + HashMap k = merger.addItem(slot); + + if (!k.isEmpty()) { + // big problem. Try to find out where; someone has an overloaded chest/inventory + // that violates MC's stacking rules. + Location loc = null; + InventoryHolder held = inventory.getHolder(); + if (held instanceof DoubleChest) { + loc = ((DoubleChest) held).getLocation(); + } else if (held instanceof BlockState) { + loc = ((BlockState) held).getLocation(); + } else if (held instanceof Entity) { + loc = ((Entity) held).getLocation(); + } + Bukkit.getLogger().severe("Factory inventory cannot fit into itself, SEVERE at " + StringUtils.formatCoords(loc)); + return false; + } + } + } + return this.putIn(merger, probabilisticEnchantments, enchantmentOptions); + } } From bcbf6b610dfeb8b22ddf7be3aa28a70b91a266bc Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 27 Jun 2015 19:57:23 -0400 Subject: [PATCH 130/459] Small tweak, meant to put with the others but forgot to save before walking out --- src/com/github/igotyou/FactoryMod/Factorys/Compactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index fb58a323..f9e9ad0c 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -266,7 +266,7 @@ public List getChestResponse(){ if (mode.equals(CompactorMode.COMPACT) ) { ItemList inputs = getInputs(); - response = (inputs.isEmpty() ? "Nothing to compact." : "Next stack to compact: " + inputs.toString() ); + response = (inputs.isEmpty() ? "Nothing to compact." : "Next up to compact: " + inputs.toString() ); } else if (mode.equals(CompactorMode.DECOMPACT)){ ItemList inputs = getInputs(); if (inputs.isEmpty()) { From 81ecd1c8b7d970bb6eb865dce5518b972d09e4c9 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 28 Jun 2015 01:19:37 -0400 Subject: [PATCH 131/459] Turns out the testPutIn method was effectively reorgnizing chest contents before testing, meaning lots of false positives for distributed stackis. Fix. --- .../igotyou/FactoryMod/utility/ItemList.java | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java index 0d58a21a..15c99b80 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemList.java @@ -398,25 +398,14 @@ public boolean testPutIn(Inventory inventory, List pro // Instead, we'll create a temporary "merged" inventory, and // see if we can add everything into it without overflowing Inventory merger = FactoryModPlugin.getPlugin().getServer().createInventory(null, inventory.getSize()); - for (ItemStack slot : inventory) { - if (slot != null) { - HashMap k = merger.addItem(slot); + for (int i = 0; i < inventory.getSize(); i++) { + ItemStack slot = inventory.getItem(i); - if (!k.isEmpty()) { - // big problem. Try to find out where; someone has an overloaded chest/inventory - // that violates MC's stacking rules. - Location loc = null; - InventoryHolder held = inventory.getHolder(); - if (held instanceof DoubleChest) { - loc = ((DoubleChest) held).getLocation(); - } else if (held instanceof BlockState) { - loc = ((BlockState) held).getLocation(); - } else if (held instanceof Entity) { - loc = ((Entity) held).getLocation(); - } - Bukkit.getLogger().severe("Factory inventory cannot fit into itself, SEVERE at " + StringUtils.formatCoords(loc)); - return false; - } + // duplicate exactly, otherwise get weird edge effects + if (slot != null) { + merger.setItem(i, slot); + } else { + merger.clear(i); } } return this.putIn(merger, probabilisticEnchantments, enchantmentOptions); From bf305342acfd121520cc993ec4118a2bc555d4b2 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 28 Jun 2015 01:27:41 -0400 Subject: [PATCH 132/459] For some reason forgot to include Banners in the exclusion, they have a very interesting dup behavior because of copying. --- config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.yml b/config.yml index 556acde0..1860ac46 100644 --- a/config.yml +++ b/config.yml @@ -288,6 +288,8 @@ compactor: material: EMPTY_MAP Filled Map: material: MAP + Banner: + material: BANNER copy_defaults: false general: central_block: WORKBENCH From 138e281aee22303ee984fdbcc9ece519d126fb57 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 28 Jun 2015 23:11:03 -0400 Subject: [PATCH 133/459] Final balance change for now. Reduced slime costs, added back in diamond cost to compensate. Altered labeling to Oak Fence. Tested new install cost locally, worked fine. Otherwise no changes, this is ready for go-live as evidenced by all testers reporting no failures. --- config.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/config.yml b/config.yml index 1860ac46..3d74eb93 100644 --- a/config.yml +++ b/config.yml @@ -238,29 +238,35 @@ compactor: amount: 16 Piston: material: PISTON_BASE - amount: 128 + amount: 192 'Iron Ingots': material: IRON_INGOT amount: 64 + 'Diamonds': + material: DIAMOND + amount: 48 'Slime Balls': material: SLIME_BALL - amount: 48 - repair_multiple: 6 + amount: 24 + repair_multiple: 3 repair: Crate: material: CHEST - amount: 1 + amount: 2 display_name: Crate lore: A crate for compacting items Redstone: material: REDSTONE - amount: 2 + amount: 4 Piston: material: PISTON_BASE + amount: 6 + 'Diamonds': + material: DIAMOND amount: 2 'Iron Ingots': material: IRON_INGOT - amount: 1 + amount: 2 'Slime Balls': material: SLIME_BALL amount: 1 @@ -6498,14 +6504,14 @@ production_recipes: amount: 4 lore: Donkey double chest Craft_Fences: - name: Craft Fences + name: Craft Oak Fences production_time: 16 inputs: Chest: material: CHEST amount: 12 outputs: - Fence: + Oak Fence: material: FENCE amount: 256 Craft_Signs: @@ -8164,7 +8170,7 @@ production_recipes: 'Iron Ingot': material: IRON_INGOT amount: 4 - Fence: + Oak Fence: material: FENCE amount: 256 outputs: From 348fc74f4e2a578f7c3fd5dda1e30fb4b99c46f5 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Thu, 2 Jul 2015 12:51:43 -0400 Subject: [PATCH 134/459] Quick fix for crates being stupidly slow --- config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 3d74eb93..a3b49bae 100644 --- a/config.yml +++ b/config.yml @@ -8162,17 +8162,14 @@ production_recipes: amount: 16 Craft_Crate: name: Craft Compactor Crate - production_time: 16 + production_time: 4 inputs: Chest: material: CHEST - amount: 27 + amount: 39 'Iron Ingot': material: IRON_INGOT amount: 4 - Oak Fence: - material: FENCE - amount: 256 outputs: Crate: material: CHEST From 74d98e4e6ace8d000a73aef96da41894d19123b7 Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Fri, 3 Jul 2015 15:38:22 +0000 Subject: [PATCH 135/459] Balanced for drop rates of saplings --- config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.yml b/config.yml index a3b49bae..5d2c122b 100644 --- a/config.yml +++ b/config.yml @@ -3398,11 +3398,11 @@ production_recipes: durability: 0 Jungle Sapling: material: SAPLING - amount: 8 + amount: 6 durability: 3 Acacia Sapling: material: SAPLING - amount: 8 + amount: 12 durability: 4 outputs: Emerald Block: @@ -4653,11 +4653,11 @@ production_recipes: durability: 1 Spruce Sapling: material: SAPLING - amount: 8 + amount: 10 durability: 1 Dark Oak Sapling: material: SAPLING - amount: 8 + amount: 4 durability: 5 outputs: Emerald Block: @@ -10787,12 +10787,12 @@ production_recipes: Compacted Jungle Sapling: material: SAPLING durability: 3 - amount: 4 + amount: 3 lore: Compacted Item Compacted Acacia Sapling: material: SAPLING durability: 4 - amount: 4 + amount: 6 lore: Compacted Item outputs: Emerald Blocks: @@ -10847,12 +10847,12 @@ production_recipes: Compacted Spruce Sapling: material: SAPLING durability: 1 - amount: 4 + amount: 5 lore: Compacted Item Compacted Dark Oak Sapling: material: SAPLING durability: 5 - amount: 4 + amount: 2 lore: Compacted Item outputs: Emerald Blocks: From 9b505ede6d57ac6d9c1d3235a392f066988db43e Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Tue, 7 Jul 2015 22:45:03 -0400 Subject: [PATCH 136/459] update to 1.8.7 --- .travis.yml | 5 - plugin.yml | 4 +- pom.xml | 115 +++++++++--------- .../FactoryMod/Factorys/RepairFactory.java | 4 +- .../listeners/FactoryModListener.java | 4 +- 5 files changed, 64 insertions(+), 68 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c8e11b17..00000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: java -install: true -matrix: - include: - - jdk: openjdk6 diff --git a/plugin.yml b/plugin.yml index 69e22e93..d3faa80d 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ -name: FactoryMod +name: ${project.name} main: com.github.igotyou.FactoryMod.FactoryModPlugin author: igotyou -version: 1.4.0 +version: ${project.version} depend: [NameLayer, Citadel] diff --git a/pom.xml b/pom.xml index fe1a6dc3..2a4ba186 100644 --- a/pom.xml +++ b/pom.xml @@ -2,62 +2,63 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 - com.github.igotyou - FactoryMod - jar - 1.4.0-${build.number} - FactoryMod - https://github.com/Civcraft/FactoryMod - - - 1.7 - 1.7 - - - - ${basedir}/src - - - - ${basedir} - - *.yml - license.txt - - - - + 4.0.0 + com.github.igotyou + FactoryMod + jar + 1.4.2 + FactoryMod + https://github.com/Civcraft/FactoryMod - - - org.spigotmc - spigot - 1.8.3 - provided - - - vg.civcraft.mc.namelayer - NameLayer - 2.1.1 - provided - - - vg.civcraft.mc.citadel - Citadel - 3.0.12-40 - provided - - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ - - - Jenkins-repo - http://civcraft.co:8080/plugin/repository/everything/ - - + + 1.7 + 1.7 + + + + ${basedir}/src + + + + ${basedir} + + *.yml + license.txt + + true + + + + + + + org.spigotmc + Spigot1.8.7 + 1.8.7 + provided + + + vg.civcraft.mc.namelayer + NameLayer + 2.1.1 + provided + + + vg.civcraft.mc.citadel + Citadel + 3.0.12-40 + provided + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + Jenkins-repo + http://civcraft.co:8080/plugin/repository/everything/ + + diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index 76390e8c..aeccd8e8 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -4,10 +4,10 @@ import java.util.List; import java.util.logging.Logger; -import net.minecraft.server.v1_8_R2.ItemStack; +import net.minecraft.server.v1_8_R3.ItemStack; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index df724646..aebad124 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,12 +2,12 @@ import java.util.List; -import net.minecraft.server.v1_8_R2.ItemStack; +import net.minecraft.server.v1_8_R3.ItemStack; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; From 4ea7d0212060319ced13a138f1100418e3f4860f Mon Sep 17 00:00:00 2001 From: caveofwonders Date: Wed, 15 Jul 2015 18:32:19 -0500 Subject: [PATCH 137/459] update config.yml to include mutton and rabbit Added mutton and rabbit recipes to the grill, both are the same recipe as cooked chicken. --- config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/config.yml b/config.yml index 5d2c122b..80c88322 100644 --- a/config.yml +++ b/config.yml @@ -1706,6 +1706,8 @@ production_factories: - Grilled_Pork - Cooked_Beef - Cook_Salmon + - Cook_Mutton + - Cook_Rabbit - Bastion_Rations repair_multiple: 2 repair_inputs: @@ -4116,6 +4118,28 @@ production_recipes: Cooked Chicken: material: COOKED_CHICKEN amount: 128 + Cook_Mutton: + name: Grill Raw Mutton + production_time: 6 + inputs: + Raw Mutton: + material: MUTTON + amount: 64 + outputs: + Cooked Mutton: + material: COOKED_MUTTON + amount: 128 + Cook_Rabbit: + name: Grill Raw Rabbit + production_time: 6 + inputs: + Raw Rabbit: + material: RABBIT + amount: 64 + outputs: + Cooked Rabbit: + material: COOKED_RABBIT + amount: 128 Dye_Brown_Wool_Pink: name: Dye Brown Wool Pink inputs: From 237b46d9c457e9ad0ac19283a4416ef8b321fb2d Mon Sep 17 00:00:00 2001 From: hlprimm Date: Thu, 23 Jul 2015 00:56:33 -0500 Subject: [PATCH 138/459] clay changes --- config.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 80c88322..e0dac730 100644 --- a/config.yml +++ b/config.yml @@ -1,4 +1,4 @@ -#Example: production_general +#Example: Production_general # update_cycle: 20 the period of ticks between which factories are updated # maintenance_cycle: 15 the period of ticks between which the maintenance of the factories are updated # maintenance_rate: 1 %Modifies the rate at which factories degrade, higher numbers degrade the factories faster @@ -1383,6 +1383,7 @@ production_factories: - Bake_clay_blocks - Bake_bricks - Bake_pots + - Bake_brick_blocks repair_multiple: 26 repair_inputs: Clay: @@ -5039,7 +5040,7 @@ production_recipes: material: HARD_CLAY amount: 1024 Bake_bricks: - name: Bake Bricks + name: Bake Individual Bricks production_time: 32 inputs: Clay: @@ -5060,6 +5061,17 @@ production_recipes: Flower Pots: material: FLOWER_POT_ITEM amount: 64 + Bake_brick_blocks: + name: Bake brick blocks + production_time: 32 + inputs: + Clay: + material: CLAY + amount: 128 + outputs: + Brick blocks: + material: BRICK_BLOCK + amount: 256 Smelt_Sandstone: name: Smelt Sandstone production_time: 32 @@ -7824,9 +7836,9 @@ production_recipes: Bastion_Flooring: name: Flooring inputs: - Clay Ball: - material: CLAY_BALL - amount: 32 + Clay Block: + material: CLAY + amount: 8 Nether Brick: material: NETHER_BRICK amount: 64 From 01e3b96b27e95ad9034c5e0fcff89470cd074928 Mon Sep 17 00:00:00 2001 From: hlprimm Date: Thu, 23 Jul 2015 11:38:48 -0500 Subject: [PATCH 139/459] Fixed brick value --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index e0dac730..857cf137 100644 --- a/config.yml +++ b/config.yml @@ -5070,7 +5070,7 @@ production_recipes: amount: 128 outputs: Brick blocks: - material: BRICK_BLOCK + material: BRICK amount: 256 Smelt_Sandstone: name: Smelt Sandstone From a657f5bc725b2269a060543f15f97994eeba7653 Mon Sep 17 00:00:00 2001 From: ribagi Date: Tue, 28 Jul 2015 21:35:33 -0700 Subject: [PATCH 140/459] Remove recipe Craft_Sea_Lanterns Removed Craft_Sea_Lanterns from Stone_Brick_Smelter because of a possible exploit. --- config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config.yml b/config.yml index 857cf137..fd6a912c 100644 --- a/config.yml +++ b/config.yml @@ -2462,7 +2462,6 @@ production_factories: - Smelt_Prismarine_Bricks - Smelt_Dark_Prismarine - Smelt_Cracked_Stone_Brick - - Craft_Sea_Lanterns - Smelt_Mossy_Stone_Brick - Smelt_Chiseled_Stone_Brick - Bastion_Flooring From ce47be2a12916d197fe771e6a29faf5d009ce480 Mon Sep 17 00:00:00 2001 From: Jake Jungbluth Date: Thu, 30 Jul 2015 11:59:13 -0500 Subject: [PATCH 141/459] Squashed commit of the following: commit 7a3fb98b0246e663f2f521d7ce9f67fae1b9c5dd Merge: 429d6c0 87b9dfa Author: jjj5311 Date: Thu Jul 30 11:44:49 2015 -0500 Merge pull request #1 from jjj5311/patch-1 Patch 1 commit 87b9dfa701174a7ebc4cd5475f1c006a317eb618 Author: jjj5311 Date: Mon Jul 27 10:10:34 2015 -0500 remove anvil config stuff commit 37129fa6d4cde7e69afb1cd7e731b16629959e7e Author: jjj5311 Date: Mon Jul 27 09:54:18 2015 -0500 Update FactoryModPlugin.java commit 2a9ff7e247e110d9315278594b2578bb9283f0ee Author: jjj5311 Date: Mon Jul 27 09:15:00 2015 -0500 Delete old anvil fix Fix Issues #126 --- config.yml | 2 -- .../igotyou/FactoryMod/FactoryModPlugin.java | 6 ------ .../listeners/FactoryModListener.java | 19 ------------------- 3 files changed, 27 deletions(-) diff --git a/config.yml b/config.yml index fd6a912c..a117cced 100644 --- a/config.yml +++ b/config.yml @@ -304,8 +304,6 @@ general: citadel_enabled: true factory_interaction_material: STICK disable_experience: true - should_default_anvil_cost: false - set_default_anvil_cost: 37 production_general: update_cycle: 20 repair_period: 28 diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 1b16a269..baf2629f 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -112,9 +112,6 @@ public class FactoryModPlugin extends JavaPlugin * Whether factory running state is output to a lever (Default true) */ public static boolean LEVER_OUTPUT_ENABLED; - - public static boolean SHOULD_SET_ANVIL_COST; - public static int GET_SET_ANVIL_COST; /* Nether Properties */ @@ -271,9 +268,6 @@ public void initConfig() LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled",true); //Do we allow factories to be started with redstone? REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled",true); - //Set anvil repair cost - SHOULD_SET_ANVIL_COST = config.getBoolean("general.should_default_anvil_cost", false); - GET_SET_ANVIL_COST = config.getInt("general.set_default_anvil_cost", 37); // Disable the following recipes List toDisable = new ArrayList(); diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index aebad124..2380a633 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -497,23 +497,4 @@ public void entityTeleportEvent(EntityPortalEvent event){ event.setCancelled(true); } } - - @EventHandler(priority = EventPriority.NORMAL) - public void anvilRepairEvent(InventoryClickEvent event){ - if (!FactoryModPlugin.SHOULD_SET_ANVIL_COST) - return; - if (event instanceof InventoryCreativeEvent) - return; - Inventory inv = event.getClickedInventory(); - if (!(inv instanceof AnvilInventory)) - return; - - org.bukkit.inventory.ItemStack stack = inv.getItem(2); - if (stack == null) - return; - - ItemStack s = CraftItemStack.asNMSCopy(stack); - s.setRepairCost(FactoryModPlugin.GET_SET_ANVIL_COST); - inv.setItem(3, (CraftItemStack.asBukkitCopy(s))); - } } From ac9792584cdcd3cfe07ef19b3d8e0971355136e8 Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Fri, 7 Aug 2015 18:51:31 +0000 Subject: [PATCH 142/459] Adjusted XP recipes for RB changes Adjusted XP recipes for RB pull request #51 https://github.com/Civcraft/RealisticBiomes/pull/51 --- config.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config.yml b/config.yml index a117cced..18edcb02 100644 --- a/config.yml +++ b/config.yml @@ -3372,7 +3372,7 @@ production_recipes: amount: 512 Melon Block: material: MELON_BLOCK - amount: 64 + amount: 4 Brown Mushroom: material: BROWN_MUSHROOM amount: 128 @@ -3388,7 +3388,7 @@ production_recipes: amount: 128 Sugar Cane: material: SUGAR_CANE - amount: 512 + amount: 16 Yellow Flower: material: YELLOW_FLOWER amount: 32 @@ -3735,14 +3735,14 @@ production_recipes: amount: 512 Cactus: material: CACTUS - amount: 256 + amount: 16 Cocoa: material: INK_SACK amount: 64 durability: 3 Melon Block: material: MELON_BLOCK - amount: 64 + amount: 4 outputs: XP Bottles: material: EXP_BOTTLE @@ -4645,13 +4645,13 @@ production_recipes: amount: 256 Cactus: material: CACTUS - amount: 512 + amount: 32 Wheat: material: WHEAT amount: 384 Pumpkin: material: PUMPKIN - amount: 256 + amount: 16 Grass: material: LONG_GRASS amount: 128 @@ -4699,13 +4699,13 @@ production_recipes: amount: 512 Sugar Cane: material: SUGAR_CANE - amount: 512 + amount: 32 Grass Blocks: material: GRASS amount: 32 Pumpkin: material: PUMPKIN - amount: 256 + amount: 16 Nether Wart: material: NETHER_STALK amount: 128 @@ -4717,7 +4717,7 @@ production_recipes: amount: 128 Melon Block: material: MELON_BLOCK - amount: 64 + amount: 4 Yellow Flower: material: YELLOW_FLOWER amount: 32 @@ -5485,10 +5485,10 @@ production_recipes: amount: 256 Sugar Cane: material: SUGAR_CANE - amount: 256 + amount: 16 Pumpkin: material: PUMPKIN - amount: 128 + amount: 8 outputs: XP Bottles: material: EXP_BOTTLE @@ -5504,14 +5504,14 @@ production_recipes: amount: 256 Cactus: material: CACTUS - amount: 256 + amount: 16 Cocoa: material: INK_SACK amount: 64 durability: 3 Pumpkin: material: PUMPKIN - amount: 128 + amount: 8 outputs: XP Bottles: material: EXP_BOTTLE @@ -5530,10 +5530,10 @@ production_recipes: amount: 256 Sugar Cane: material: SUGAR_CANE - amount: 256 + amount: 16 Melon Block: material: MELON_BLOCK - amount: 64 + amount: 4 outputs: XP Bottles: material: EXP_BOTTLE @@ -10786,7 +10786,7 @@ production_recipes: lore: Compacted Item Compacted Sugar Cane: material: SUGAR_CANE - amount: 256 + amount: 16 lore: Compacted Item Compacted Bread: material: BREAD @@ -10807,7 +10807,7 @@ production_recipes: lore: Compacted Item Compacted Melons: material: MELON_BLOCK - amount: 32 + amount: 2 lore: Compacted Item Compacted Yellow Flowers: material: YELLOW_FLOWER @@ -10840,7 +10840,7 @@ production_recipes: lore: Compacted Item Compacted Cacti: material: CACTUS - amount: 256 + amount: 16 lore: Compacted Item Compacted Wheat: material: WHEAT @@ -10848,7 +10848,7 @@ production_recipes: lore: Compacted Item Compacted Pumpkins: material: PUMPKIN - amount: 128 + amount: 8 lore: Compacted Item Compacted Grass: material: LONG_GRASS @@ -10908,11 +10908,11 @@ production_recipes: lore: Compacted Item Compacted Sugar Cane: material: SUGAR_CANE - amount: 256 + amount: 12 lore: Compacted Item Compacted Pumpkins: material: PUMPKIN - amount: 128 + amount: 8 lore: Compacted Item Compacted Nether Warts: material: NETHER_STALK @@ -10924,7 +10924,7 @@ production_recipes: lore: Compacted Item Compacted Melons: material: MELON_BLOCK - amount: 32 + amount: 2 lore: Compacted Item Compacted Red Mushrooms: material: RED_MUSHROOM From 508074b84772dcdb4f85e8786d3c7640010408c9 Mon Sep 17 00:00:00 2001 From: hlprimm Date: Sat, 8 Aug 2015 13:27:09 -0500 Subject: [PATCH 143/459] added ds3 to random diamond --- config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index a117cced..1c32c4ff 100644 --- a/config.yml +++ b/config.yml @@ -10008,7 +10008,7 @@ production_recipes: Feather Falling 4: type: PROTECTION_FALL level: 4 - probability: 0.25 + probability: 0.20 Protection 4: type: PROTECTION_ENVIRONMENTAL level: 4 @@ -10029,6 +10029,11 @@ production_recipes: type: PROTECTION_EXPLOSIONS level: 4 probability: 0.10 + Depth Strider 3: + type: DEPTH_STRIDER + level: 3 + probability: 0.05 + Create_Diamond_Chestplate: name: Create Diamond Chestplate production_time: 40 From 6945fb3c1c82ed869a39d6a117fcea00b03a62a6 Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Sun, 9 Aug 2015 14:55:18 +0000 Subject: [PATCH 144/459] Update config.yml --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 18edcb02..0e380068 100644 --- a/config.yml +++ b/config.yml @@ -3388,7 +3388,7 @@ production_recipes: amount: 128 Sugar Cane: material: SUGAR_CANE - amount: 16 + amount: 32 Yellow Flower: material: YELLOW_FLOWER amount: 32 From 4dc99afa5649743f34252bd99bf565169e52dc5d Mon Sep 17 00:00:00 2001 From: hlprimm Date: Mon, 17 Aug 2015 12:48:17 -0500 Subject: [PATCH 145/459] disabled nether decompactors --- config.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 1754a86f..00078359 100644 --- a/config.yml +++ b/config.yml @@ -881,9 +881,10 @@ production_factories: material: COAL durability: 1 inputs: - Diamonds: - material: DIAMOND - amount: 130 + Bedrock: + material: BEDROCK + amount: 64 + lore: 'Admin Crimes Only' recipes: - Nether_Decraft_Crate_of_Acacia_Sapling - Nether_Decraft_Crate_of_Baked_Potatoes @@ -914,9 +915,10 @@ production_factories: - Nether_Decraft_Crate_of_Yellow_Flower repair_multiple: 6 repair_inputs: - Diamonds: + Bedrock: material: DIAMOND - amount: 2 + amount: 64 + lore: 'Admin Crimes Only' Diamond_Cauldron: name: Diamond Cauldron fuel: From e1a98bdc47270c28a44be9d943df18369698222f Mon Sep 17 00:00:00 2001 From: hlprimm Date: Mon, 17 Aug 2015 12:51:03 -0500 Subject: [PATCH 146/459] fixed two things i missed disabling nether decompactors --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 00078359..2d92c359 100644 --- a/config.yml +++ b/config.yml @@ -913,10 +913,10 @@ production_factories: - Nether_Decraft_Crate_of_Vine - Nether_Decraft_Crate_of_Wheat - Nether_Decraft_Crate_of_Yellow_Flower - repair_multiple: 6 + repair_multiple: 54 repair_inputs: Bedrock: - material: DIAMOND + material: BEDROCK amount: 64 lore: 'Admin Crimes Only' Diamond_Cauldron: From 942df1525d22f2aa8a535557ba68d37a8604dd6f Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Fri, 28 Aug 2015 00:43:55 +0300 Subject: [PATCH 147/459] Update config.yml Update the iron door recipe --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 2d92c359..f9135575 100644 --- a/config.yml +++ b/config.yml @@ -6685,7 +6685,7 @@ production_recipes: inputs: Iron Ingot: material: IRON_INGOT - amount: 54 + amount: 18 outputs: Iron Door: material: IRON_DOOR From ce961fe62c2c57d8852e7e34fc2718d23501e0da Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 30 Aug 2015 04:01:31 +0200 Subject: [PATCH 148/459] Add recipe for new stone variants --- config.yml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/config.yml b/config.yml index f9135575..305e98eb 100644 --- a/config.yml +++ b/config.yml @@ -2443,6 +2443,45 @@ production_factories: amount: 2 Diamond: material: DIAMOND + Igneous_Stone_Smelter: + name: Igneous Stone smelter + fuel: + Charcoal: + material: COAL + durability: 1 + inputs: + Stone: + material: STONE + amount: 1024 + durability: 0 + Gravel: + material: GRAVEL + amount: 512 + Flint: + material: FLINT + amount: 256 + Quartz: + material: QUARTZ + amount: 256 + recipes: + - Smelt_Granite + - Smelt_Diorite + - Smelt_Andesite + repair_multiple: 10 + repair_inputs: + Stone: + material: STONE + amount: 10 + durability: 0 + Gravel: + material: GRAVEL + amount: 5 + Flint: + material: FLINT + amount: 2 + Quartz: + material: QUARTZ + amount: 2 Stone_Brick_Smelter: name: Fancy Stone Brick Smelter fuel: @@ -7678,6 +7717,51 @@ production_recipes: material: MONSTER_EGG durability: 56 amount: 4 + Smelt_Diorite: + name: Smelt Diorite + production_time: 32 + inputs: + Cobblestone: + material: COBBLESTONE + amount: 256 + Quartz: + material: QUARTZ + amount: 32 + outputs: + Diorite: + material: STONE + amount: 256 + durability: 3 + Smelt_Granite: + name: Smelt Granite + production_time: 32 + inputs: + Cobblestone: + material: COBBLESTONE + amount: 256 + Dirt: + material: DIRT + amount: 128 + outputs: + Granite: + material: STONE + amount: 256 + durability: 1 + Smelt_Andesite: + name: Smelt Andesite + production_time: 32 + inputs: + Cobblestone: + material: COBBLESTONE + amount: 256 + Gravel: + material: GRAVEL + amount: 128 + outputs: + Andesite: + material: STONE + amount: 256 + durability: 5 Compact_Ice: name: Compact Ice production_time: 32 From 5aac2fa9b4c8413f3299e82cc2f30c126049fff8 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 2 Sep 2015 18:40:58 +0200 Subject: [PATCH 149/459] Add recipe for red sandstone --- config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config.yml b/config.yml index 305e98eb..78a074fb 100644 --- a/config.yml +++ b/config.yml @@ -1332,6 +1332,7 @@ production_factories: - Smelt_Glass_Panes - Smelt_Bottles - Smelt_Red_Sand + - Smelt_Red_Sandstone - Smelt_Glass_From_Sandstone repair_multiple: 26 repair_inputs: @@ -5155,6 +5156,19 @@ production_recipes: material: SAND amount: 64 durability: 1 + Smelt_Red_Sandstone: + name: Smelt Red Sandstone + production_time: 32 + inputs: + Red Sand: + material: SAND + amount: 512 + durability: 1 + outputs: + Red Sandstone: + material: RED_SANDSTONE + amount: 384 + durability: 0 Smelt_Glass_From_Sandstone: name: Smelt Glass From Sandstone production_time: 32 From 17a20de99b178e979d80adb3388edb6750de97bb Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 3 Sep 2015 03:37:56 +0200 Subject: [PATCH 150/459] Fix redstone listener for new factories --- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 +- .../listeners/RedstoneListener.java | 32 ++++++++----------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index baf2629f..db263889 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -195,7 +195,7 @@ public void registerEvents() try { getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); - getServer().getPluginManager().registerEvents(new RedstoneListener(manager, (ProductionFactoryManager) manager.getManager(ProductionFactory.class)), this); + getServer().getPluginManager().registerEvents(new RedstoneListener(manager), this); getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); } catch(Exception e) diff --git a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java index aeda87ea..e06f0f4d 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java @@ -14,23 +14,21 @@ import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.managers.FactoryManagerService; -import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; public class RedstoneListener implements Listener { private FactoryManagerService factoryMan; private ReinforcementManager rm = Citadel.getReinforcementManager(); //this is a lazy fix... - private ProductionFactoryManager productionMan; /** * Constructor */ - public RedstoneListener(FactoryManagerService factoryManager, ProductionFactoryManager productionManager) + public RedstoneListener(FactoryManagerService manager) { - this.factoryMan = factoryManager; - this.productionMan = productionManager; + this.factoryMan = manager; } @EventHandler(ignoreCancelled = true) @@ -98,22 +96,18 @@ public void redstoneChange(BlockRedstoneEvent e) if(block.getType() == Material.FURNACE || block.getType() == Material.BURNING_FURNACE) { if (factoryMan.factoryExistsAt(block.getLocation())) - { - //Is the factory a production factory? - if (productionMan.factoryExistsAt(block.getLocation())) - { - ProductionFactory factory = (ProductionFactory) productionMan.getFactory(block.getLocation()); + { + ABaseFactory factory = (ABaseFactory) factoryMan.getFactory(block.getLocation()); - Block lever = factory.findActivationLever(); - if (lever == null) { - // No lever - don't respond to redstone - return; - } + Block lever = factory.findActivationLever(); + if (lever == null) { + // No lever - don't respond to redstone + return; + } - if (!factory.getActive()) { - // Try to start the factory - factory.togglePower(); - } + if (!factory.getActive()) { + // Try to start the factory + factory.togglePower(); } } } From 8544d06a59f85760ea3e5783cf42b0e1fe7d7bdd Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Fri, 4 Sep 2015 13:04:29 +0000 Subject: [PATCH 151/459] Balanced new stone types They were far too cheap before, the exclusion of a quartz cost for most of them is astounding and the cost of the factory was absurdly low. --- config.yml | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/config.yml b/config.yml index 78a074fb..8196f406 100644 --- a/config.yml +++ b/config.yml @@ -2453,17 +2453,11 @@ production_factories: inputs: Stone: material: STONE - amount: 1024 + amount: 2048 durability: 0 - Gravel: - material: GRAVEL - amount: 512 - Flint: - material: FLINT - amount: 256 Quartz: material: QUARTZ - amount: 256 + amount: 1024 recipes: - Smelt_Granite - Smelt_Diorite @@ -2472,17 +2466,11 @@ production_factories: repair_inputs: Stone: material: STONE - amount: 10 + amount: 20 durability: 0 - Gravel: - material: GRAVEL - amount: 5 - Flint: - material: FLINT - amount: 2 Quartz: material: QUARTZ - amount: 2 + amount: 10 Stone_Brick_Smelter: name: Fancy Stone Brick Smelter fuel: @@ -7737,14 +7725,14 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE - amount: 256 + amount: 576 Quartz: material: QUARTZ - amount: 32 + amount: 192 outputs: Diorite: material: STONE - amount: 256 + amount: 576 durability: 3 Smelt_Granite: name: Smelt Granite @@ -7752,14 +7740,14 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE + amount: 512 + Quartz: + material: QUARTZ amount: 256 - Dirt: - material: DIRT - amount: 128 outputs: Granite: material: STONE - amount: 256 + amount: 512 durability: 1 Smelt_Andesite: name: Smelt Andesite @@ -7767,14 +7755,14 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE - amount: 256 - Gravel: - material: GRAVEL - amount: 128 + amount: 1024 + Quartz: + material: QUARTZ + amount: 64 outputs: Andesite: material: STONE - amount: 256 + amount: 512 durability: 5 Compact_Ice: name: Compact Ice From 5e32f06f9dc9c3eed2baf175cdfe5b756a788b09 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 6 Sep 2015 22:00:11 +0200 Subject: [PATCH 152/459] Prevent placement of and crafting with compacted items --- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 + .../listeners/CompactItemListener.java | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index db263889..64625787 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -23,6 +23,7 @@ import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.listeners.NoteStackListener; import com.github.igotyou.FactoryMod.listeners.RedstoneListener; @@ -197,6 +198,7 @@ public void registerEvents() getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); getServer().getPluginManager().registerEvents(new RedstoneListener(manager), this); getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); + getServer().getPluginManager().registerEvents(new CompactItemListener(compactorProperties.getCompactLore()),this); } catch(Exception e) { diff --git a/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java b/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java new file mode 100644 index 00000000..2c6031e2 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java @@ -0,0 +1,61 @@ +package com.github.igotyou.FactoryMod.listeners; + +import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.inventory.CraftItemEvent; +import org.bukkit.inventory.CraftingInventory; +import org.bukkit.inventory.ItemStack; + +public class CompactItemListener implements Listener{ + private String compactLore; + + public CompactItemListener(String compactLore) { + this.compactLore = compactLore; + } + + @EventHandler + public void blockPlaceEvent(BlockPlaceEvent e) { + if (!e.getItemInHand().hasItemMeta()) { + return; + } + if (!e.getItemInHand().getItemMeta().hasLore()) { + return; + } + if (e.getItemInHand().getItemMeta().getLore().get(0).equals(compactLore)) { + e.setCancelled(true); + Player p = e.getPlayer(); + if (p != null) { + p.sendMessage("You can not place compacted blocks"); + } + } + + } + + @EventHandler + public void craftingEvent(CraftItemEvent e) { + CraftingInventory ci = e.getInventory(); + for(ItemStack is:ci.getMatrix()) { + if (is == null) { + continue; + } + if (!is.hasItemMeta()) { + continue; + } + if (!is.getItemMeta().hasLore()) { + continue; + } + if (is.getItemMeta().getLore().get(0).equals(compactLore)) { + e.setCancelled(true); + HumanEntity h = e.getWhoClicked(); + if (h instanceof Player && h != null) { + ((Player)h).sendMessage("You can not craft with compacted items"); + } + break; + } + } + } + +} From 3c92d7a9a6bfc81ffe72e7ed725e04128ad74eaf Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 7 Sep 2015 00:53:52 +0200 Subject: [PATCH 153/459] Fixing bug of factory furnaces turning off --- src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index 5a1fb138..242b7a91 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -147,6 +147,7 @@ public void powerOn() furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); furnace.setRawData(data); furnace.update(); + furnace.setBurnTime(Short.MAX_VALUE); furnace.getInventory().setContents(oldContents); //reset the production timer currentProductionTimer = 0; From 1aa38a8720949a661d7137704135fddd154eafe3 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 8 Sep 2015 22:32:49 +0200 Subject: [PATCH 154/459] Readd smooth double slabs --- config.yml | 26 +++++++++++++++++++ .../listeners/FactoryModListener.java | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/config.yml b/config.yml index 8196f406..5e43be6b 100644 --- a/config.yml +++ b/config.yml @@ -419,6 +419,32 @@ crafting: Exp Bottle: material: EXP_BOTTLE amount: 9 + Stone Slab to Double Slab: + inputs: + s: + Stone Slab: + material: STONE_SLAB2 + shape: + - s + - s + output: + Double Stone Slab: + material: STONE_SLAB2 + lore: Smooth double slab + Sandstone Slab to Double Slab: + inputs: + s: + Sandstone Slab: + material: STONE_SLAB2 + durability: 1 + shape: + - s + - s + output: + Double Sandstone Slab: + material: STONE_SLAB2 + durability: 1 + lore: Smooth double slab production_factories: Bakery: name: Bakery diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 2380a633..e60d16cf 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -15,6 +15,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; +import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.event.inventory.InventoryClickEvent; @@ -25,6 +26,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.inventory.AnvilInventory; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; @@ -497,4 +499,27 @@ public void entityTeleportEvent(EntityPortalEvent event){ event.setCancelled(true); } } + + /** + * Turns slabs with the lore "Smooth double slab" into smooth double slab blocks + * @param e + */ + @EventHandler + public void onDoubleSlabUse(BlockPlaceEvent e) { + Material material = e.getBlock().getType(); + if (material != Material.STONE_SLAB2) { + return; + } + org.bukkit.inventory.ItemStack is = e.getItemInHand(); + if (!is.hasItemMeta() || !is.getItemMeta().hasLore()) { + return; + } + ItemMeta blockMeta = is.getItemMeta(); + if (blockMeta.getLore().get(0).equals("Smooth double slab")) { + Block block = e.getBlock(); + byte type = (byte)(is.getDurability() + 8); + block.setTypeIdAndData(Material.DOUBLE_STONE_SLAB2.getId(),type,true); + } + } + } From c42d4a51fb5ebf09372acf140d27df1d8613605c Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Thu, 10 Sep 2015 21:30:44 +0000 Subject: [PATCH 155/459] Major Ore smelter overhaul --- config.yml | 286 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 224 insertions(+), 62 deletions(-) diff --git a/config.yml b/config.yml index 8196f406..4b0d13d8 100644 --- a/config.yml +++ b/config.yml @@ -751,7 +751,7 @@ production_factories: inputs: Charcoal: material: COAL - amount: 600 + amount: 768 durability: 1 recipes: - Smelt_Oak_Wood @@ -761,11 +761,13 @@ production_factories: - Burn_Acacia_Wood - Burn_Dark_Oak_Wood - Smelt_Coal - repair_multiple: 60 + - Smelt_Charcoal + repair_multiple: 10 repair_inputs: Charcoal: material: COAL durability: 1 + amount: 8 Diamond_Axe_Smithy: name: Diamond Axe Smithy fuel: @@ -2372,8 +2374,67 @@ production_factories: Leather: material: LEATHER amount: 1 + Industrial_Ore_Refinery: + name: Industrial Ore Refinery + fuel: + Coal Blocks: + material: COAL_BLOCK + inputs: + Lapis Lazuli Blocks: + material: LAPIS_BLOCK + amount: 128 + Netherquartz: + material: QUARTZ + amount: 576 + Diamond Blocks: + material: DIAMOND_BLOCK + amount: 64 + Coal Blocks: + material: COAL_BLOCK + amount: 576 + Iron Blocks: + material: IRON_BLOCK + amount: 256 + Gold Blocks: + material: GOLD_BLOCK + amount: 128 + Redstone Blocks: + material: REDSTONE_BLOCK + amount: 256 + recipes: + - Refine_Diamond_Ore + - Refine_Lapis_Lazuli_Ore + - Refine_Netherquartz_Ore + - Refine_Coal_Ore + - Refine_Redstone_Ore + - Refine_Iron_Ore + - Refine_Gold_Ore + - Bastion_Base + - Bastion_Walls + repair_multiple: 10 + repair_inputs: + Lapis Lazuli Blocks: + material: LAPIS_BLOCK + Netherquartz: + material: QUARTZ + amount: 5 + Diamond Blocks: + material: DIAMOND_BLOCK + amount: 3 + Coal Blocks: + material: COAL_BLOCK + amount: 5 + Iron Blocks: + material: IRON_BLOCK + amount: 3 + Gold Blocks: + material: GOLD_BLOCK + amount: 3 + Redstone Blocks: + material: REDSTONE_BLOCK + amount: 3 Fancy_Ore_Smelter: - name: Fancy Ore Smelter + name: Gem Extractor fuel: Charcoal: material: COAL @@ -2381,30 +2442,30 @@ production_factories: inputs: Lapis Lazuli: material: INK_SACK - amount: 1536 + amount: 1024 durability: 4 - Redstone: - material: REDSTONE - amount: 1152 Netherquartz: material: QUARTZ - amount: 576 + amount: 384 + Diamond: + material: DIAMOND + amount: 160 recipes: - Smelt_Lapis_Lazuli_Ore - - Smelt_Redstone_Ore - Smelt_Netherquartz_Ore - Bastion_Walls - repair_multiple: 26 + - Smelt_Diamond_Ore + repair_multiple: 10 repair_inputs: Lapis Lazuli: material: INK_SACK - amount: 6 + amount: 10 durability: 4 - Redstone: - material: REDSTONE - amount: 5 Netherquartz: material: QUARTZ + amount: 4 + Diamond: + material: DIAMOND amount: 2 Smelter: name: Ore Smelter @@ -2415,35 +2476,36 @@ production_factories: inputs: Coal: material: COAL - amount: 512 + amount: 1024 Iron Ingot: material: IRON_INGOT - amount: 384 + amount: 256 Gold Ingot: material: GOLD_INGOT - amount: 192 - Diamond: - material: DIAMOND - amount: 96 + amount: 128 + Redstone: + material: REDSTONE + amount: 1024 recipes: - Smelt_Coal_Ore + - Smelt_Redstone_Ore - Smelt_Iron_Ore - Smelt_Gold_Ore - - Smelt_Diamond_Ore - Bastion_Base repair_multiple: 10 repair_inputs: Coal: material: COAL - amount: 6 + amount: 10 Iron Ingot: material: IRON_INGOT - amount: 4 + amount: 3 Gold Ingot: material: GOLD_INGOT - amount: 2 - Diamond: - material: DIAMOND + amount: 1 + Redstone: + material: REDSTONE + amount: 10 Igneous_Stone_Smelter: name: Igneous Stone smelter fuel: @@ -2451,13 +2513,9 @@ production_factories: material: COAL durability: 1 inputs: - Stone: - material: STONE - amount: 2048 - durability: 0 - Quartz: - material: QUARTZ - amount: 1024 + Bedrock: + material: BEDROCK + amount: 1 recipes: - Smelt_Granite - Smelt_Diorite @@ -2468,11 +2526,8 @@ production_factories: material: STONE amount: 20 durability: 0 - Quartz: - material: QUARTZ - amount: 10 Stone_Brick_Smelter: - name: Fancy Stone Brick Smelter + name: Stone Brick Smelter fuel: Charcoal: material: COAL @@ -2480,11 +2535,17 @@ production_factories: inputs: Stone Brick: material: SMOOTH_BRICK - amount: 512 + amount: 2560 Lapis Lazuli: material: INK_SACK amount: 256 durability: 4 + Netherquartz: + material: QUARTZ + amount: 256 + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 256 recipes: - Smelt_Prismarine - Smelt_Prismarine_Bricks @@ -2492,15 +2553,26 @@ production_factories: - Smelt_Cracked_Stone_Brick - Smelt_Mossy_Stone_Brick - Smelt_Chiseled_Stone_Brick + - Smelt_Granite + - Smelt_Diorite + - Smelt_Andesite - Bastion_Flooring - repair_multiple: 26 + - Smelt_Stone + repair_multiple: 10 repair_inputs: Stone Brick: material: SMOOTH_BRICK - amount: 2 + amount: 25 Lapis Lazuli: material: INK_SACK + amount: 3 durability: 4 + Netherquartz: + material: QUARTZ + amount: 3 + Prismarine Shard: + material: PRISMARINE_SHARD + amount: 3 Stone_Smelter: name: Stone Smelter fuel: @@ -2513,10 +2585,11 @@ production_factories: amount: 2048 recipes: - Smelt_Stone - repair_multiple: 205 + repair_multiple: 10 repair_inputs: Stone: material: STONE + armount: 20 Bio_Lab: name: Bio Lab fuel: @@ -3382,15 +3455,15 @@ production_recipes: durability: 7 Smelt_Diamond_Ore: name: Smelt Diamond Ore - production_time: 1 + production_time: 4 inputs: Diamond Ore: material: DIAMOND_ORE - amount: 16 + amount: 32 outputs: Diamond: material: DIAMOND - amount: 48 + amount: 96 Diamond_XP_Bottle_0: name: Brew XP Bottles - 1 inputs: @@ -5171,7 +5244,7 @@ production_recipes: production_time: 6 Smelt_Lapis_Lazuli_Ore: name: Smelt Lapis Lazuli Ore - production_time: 6 + production_time: 16 inputs: Lapis Ore: material: LAPIS_ORE @@ -5179,7 +5252,7 @@ production_recipes: outputs: Lapis Lazuli: material: INK_SACK - amount: 512 + amount: 640 durability: 4 Smelt_Redstone_Ore: name: Smelt Redstone Ore @@ -5187,22 +5260,22 @@ production_recipes: inputs: Redstone Ore: material: REDSTONE_ORE - amount: 128 + amount: 64 outputs: Redstone: material: REDSTONE - amount: 1024 + amount: 640 Smelt_Netherquartz_Ore: name: Smelt Netherquartz ore production_time: 6 inputs: Netherquartz ore: material: QUARTZ_ORE - amount: 64 + amount: 128 outputs: Quartz: material: QUARTZ - amount: 192 + amount: 640 Dye_Brown_Wool_Gray: name: Dye Brown Wool Gray inputs: @@ -5427,7 +5500,7 @@ production_recipes: amount: 64 Smelt_Gold_Ore: name: Smelt Gold Ore - production_time: 3 + production_time: 8 inputs: Gold Ore: material: GOLD_ORE @@ -5435,7 +5508,7 @@ production_recipes: outputs: Gold Ingot: material: GOLD_INGOT - amount: 224 + amount: 384 Dye_Gray_Wool_Brown: name: Dye Gray Wool Brown inputs: @@ -5932,6 +6005,18 @@ production_recipes: material: COAL amount: 512 durability: 1 + Smelt_Charcoal: + name: Burn Charcoal + production_time: 24 + inputs: + Charcoal: + material: COAL + amount: 1024 + durability: 1 + outputs: + Coal: + material: COAL + amount: 128 Gold_Axe: name: Forge Gold Axe. production_time: 15 @@ -6086,7 +6171,7 @@ production_recipes: outputs: Iron Ingot: material: IRON_INGOT - amount: 224 + amount: 256 Produce_Powered_Rail: name: Produce Powered Rails inputs: @@ -7725,10 +7810,10 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE - amount: 576 + amount: 1728 Quartz: material: QUARTZ - amount: 192 + amount: 32 outputs: Diorite: material: STONE @@ -7740,10 +7825,10 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE - amount: 512 + amount: 1728 Quartz: material: QUARTZ - amount: 256 + amount: 64 outputs: Granite: material: STONE @@ -7755,10 +7840,10 @@ production_recipes: inputs: Cobblestone: material: COBBLESTONE - amount: 1024 + amount: 1728 Quartz: material: QUARTZ - amount: 64 + amount: 32 outputs: Andesite: material: STONE @@ -8612,7 +8697,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 75 + amount: 70 outputs: Diamond Pick: material: DIAMOND_PICKAXE @@ -8630,7 +8715,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 75 + amount: 70 outputs: Diamond Spade: material: DIAMOND_SPADE @@ -8648,7 +8733,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 75 + amount: 70 outputs: Diamond Pick: material: DIAMOND_AXE @@ -11040,3 +11125,80 @@ production_recipes: Emerald Blocks: material: EMERALD_BLOCK amount: 84 + Refine_Diamond_Ore: + name: Refine Diamond Ore + production_time: 16 + inputs: + Diamond Ore: + material: DIAMOND_ORE + amount: 256 + outputs: + Diamond Block: + material: DIAMOND_BLOCK + amount: 100 + Refine_Coal_Ore: + name: Refine Coal Ore + production_time: 8 + inputs: + Coal Ore: + material: COAL_ORE + amount: 768 + outputs: + Coal Block: + material: COAL_BLOCK + amount: 336 + Refine_Iron_Ore: + name: Refine Iron Ore + production_time: 16 + inputs: + Iron Ore: + material: IRON_ORE + amount: 768 + outputs: + Iron Block: + material: IRON_BLOCK + amount: 234 + Refine_Gold_Ore: + name: Refine Gold Ore + production_time: 8 + inputs: + Gold Ore: + material: GOLD_ORE + amount: 128 + outputs: + Gold Block: + material: GOLD_BLOCK + amount: 228 + Refine_Lapis_Lazuli_Ore: + name: Refine Lapis Lazuli Ore + production_time: 8 + inputs: + Lapis Ore: + material: LAPIS_ORE + amount: 128 + outputs: + Lapis Lazuli: + material: LAPIS_BLOCK + amount: 420 + Refine_Redstone_Ore: + name: Refine Redstone Ore + production_time: 8 + inputs: + Redstone Ore: + material: REDSTONE_ORE + amount: 256 + outputs: + Redstone Block: + material: REDSTONE_BLOCK + amount: 400 + Refine_Netherquartz_Ore: + name: Refine Netherquartz ore + production_time: 8 + inputs: + Netherquartz ore: + material: QUARTZ_ORE + amount: 256 + outputs: + Quartz: + material: QUARTZ + amount: 1536 From a63f42e293b0c6ed5ba14830eb58101ef4cf853a Mon Sep 17 00:00:00 2001 From: Max Baumstark Date: Thu, 10 Sep 2015 23:49:40 +0200 Subject: [PATCH 156/459] Add bedrock lore to lock the igneous stone smelter --- config.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 4b0d13d8..7ddc03fc 100644 --- a/config.yml +++ b/config.yml @@ -2515,6 +2515,7 @@ production_factories: inputs: Bedrock: material: BEDROCK + lore: Admincrimes only amount: 1 recipes: - Smelt_Granite @@ -2522,10 +2523,10 @@ production_factories: - Smelt_Andesite repair_multiple: 10 repair_inputs: - Stone: - material: STONE - amount: 20 - durability: 0 + Bedrock: + material: BEDROCK + lore: Admincrimes only + amount: 1 Stone_Brick_Smelter: name: Stone Brick Smelter fuel: From 16542abfd5a2d1f15351c6e9be9d1580f28bea04 Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Mon, 14 Sep 2015 18:17:37 +0000 Subject: [PATCH 157/459] Changed costs to be more focused on startup. --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 7ddc03fc..223ce8d5 100644 --- a/config.yml +++ b/config.yml @@ -2388,7 +2388,7 @@ production_factories: amount: 576 Diamond Blocks: material: DIAMOND_BLOCK - amount: 64 + amount: 96 Coal Blocks: material: COAL_BLOCK amount: 576 @@ -2420,7 +2420,7 @@ production_factories: amount: 5 Diamond Blocks: material: DIAMOND_BLOCK - amount: 3 + amount: 1 Coal Blocks: material: COAL_BLOCK amount: 5 From 867e4825cb7b780acea292ec987d4bc26cc5ba86 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 18 Sep 2015 17:44:46 +0200 Subject: [PATCH 158/459] Fix for smooth double slabs and adding 6sided logs --- config.yml | 94 ++++++++++++++++--- .../igotyou/FactoryMod/FactoryModPlugin.java | 4 +- .../listeners/FactoryModListener.java | 39 +++++--- 3 files changed, 106 insertions(+), 31 deletions(-) diff --git a/config.yml b/config.yml index 5e43be6b..964ae1c0 100644 --- a/config.yml +++ b/config.yml @@ -421,30 +421,94 @@ crafting: amount: 9 Stone Slab to Double Slab: inputs: - s: - Stone Slab: - material: STONE_SLAB2 - shape: - - s - - s + Stone Slab: + material: STEP + amount: 9 output: Double Stone Slab: - material: STONE_SLAB2 + material: STEP + amount: 4 lore: Smooth double slab Sandstone Slab to Double Slab: inputs: - s: - Sandstone Slab: - material: STONE_SLAB2 - durability: 1 - shape: - - s - - s + Sandstone Slab: + material: STEP + durability: 1 + amount: 9 output: Double Sandstone Slab: - material: STONE_SLAB2 + material: STEP durability: 1 lore: Smooth double slab + amount: 4 + Sixsided oaklog: + inputs: + Oak log: + material: log + amount: 9 + output: + 6sided log: + material: log + amount: 6 + lore: Sixsided log + Sixsided sprucelog: + inputs: + Spruce log: + material: log + amount: 9 + durability: 1 + output: + 6sided log: + material: log + amount: 6 + lore: Sixsided log + durability: 1 + Sixsided birchlog: + inputs: + Birch log: + material: log + amount: 9 + durability: 2 + output: + 6sided log: + material: log + amount: 6 + lore: Sixsided log + durability: 2 + Sixsided junglelog: + inputs: + jungle log: + material: log + amount: 9 + durability: 3 + output: + 6sided log: + material: log + amount: 6 + lore: Sixsided log + durability: 3 + Sixsided acacialog: + inputs: + acacia log: + material: log_2 + amount: 9 + output: + 6sided log: + material: log_2 + amount: 6 + lore: Sixsided log + Sixsided dark oaklog: + inputs: + dark oak log: + material: log_2 + amount: 9 + durability: 1 + output: + 6sided log: + material: log_2 + amount: 6 + lore: Sixsided log + durability: 1 production_factories: Bakery: name: Bakery diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 64625787..88f145d2 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -314,8 +314,8 @@ public void initConfig() for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) { - shapelessRecipe.addIngredient(input.getAmount(), input.getType()); - //shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); + //shapelessRecipe.addIngredient(input.getAmount(), input.getType()); + shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); } recipe = shapelessRecipe; diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index e60d16cf..9c6b7207 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -501,25 +501,36 @@ public void entityTeleportEvent(EntityPortalEvent event){ } /** - * Turns slabs with the lore "Smooth double slab" into smooth double slab blocks + * Turns slabs with the lore "Smooth double slab" into smooth double slab blocks and logs + * with the lore "6-sided log" into logs with the log texture on all 6 sides * @param e */ @EventHandler - public void onDoubleSlabUse(BlockPlaceEvent e) { - Material material = e.getBlock().getType(); - if (material != Material.STONE_SLAB2) { - return; - } - org.bukkit.inventory.ItemStack is = e.getItemInHand(); + public void onSpecialBlockUse(BlockPlaceEvent e) { + org.bukkit.inventory.ItemStack is = e.getItemInHand(); if (!is.hasItemMeta() || !is.getItemMeta().hasLore()) { return; } + Material material = e.getBlock().getType(); ItemMeta blockMeta = is.getItemMeta(); - if (blockMeta.getLore().get(0).equals("Smooth double slab")) { - Block block = e.getBlock(); - byte type = (byte)(is.getDurability() + 8); - block.setTypeIdAndData(Material.DOUBLE_STONE_SLAB2.getId(),type,true); - } - } - + switch (material) { + case STEP: + if (blockMeta.getLore().get(0).equals("Smooth double slab")) { + byte type = (byte)(is.getDurability() + 8); + e.getBlock().setTypeIdAndData(Material.DOUBLE_STEP.getId(),type,true); + } + break; + case LOG: + case LOG_2: + if (blockMeta.getLore().get(0).equals("Sixsided log")) { + byte type = (byte)((is.getDurability()%4)+12); + e.getBlock().setTypeIdAndData(material.getId(),type,true); + } + + break; + default: + return; + } + +} } From d6ad3700e29c1cfb2d3dd0e88b408d18e429b625 Mon Sep 17 00:00:00 2001 From: erocs Date: Mon, 21 Sep 2015 20:01:40 -0700 Subject: [PATCH 159/459] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2a4ba186..f729d94f 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ Jenkins-repo - http://civcraft.co:8080/plugin/repository/everything/ + http://build.civcraft.co:8080/plugin/repository/everything/ From 059276c25d7e7841647443fc31072f8f7f844f46 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 23 Sep 2015 04:06:56 +0200 Subject: [PATCH 160/459] Config fix for log crafting recipes --- config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config.yml b/config.yml index 2375b6e5..1e457543 100644 --- a/config.yml +++ b/config.yml @@ -444,68 +444,68 @@ crafting: Sixsided oaklog: inputs: Oak log: - material: log + material: LOG amount: 9 output: 6sided log: - material: log + material: LOG amount: 6 lore: Sixsided log Sixsided sprucelog: inputs: Spruce log: - material: log + material: LOG amount: 9 durability: 1 output: 6sided log: - material: log + material: LOG amount: 6 lore: Sixsided log durability: 1 Sixsided birchlog: inputs: Birch log: - material: log + material: LOG amount: 9 durability: 2 output: 6sided log: - material: log + material: LOG amount: 6 lore: Sixsided log durability: 2 Sixsided junglelog: inputs: jungle log: - material: log + material: LOG amount: 9 durability: 3 output: 6sided log: - material: log + material: LOG amount: 6 lore: Sixsided log durability: 3 Sixsided acacialog: inputs: acacia log: - material: log_2 + material: LOG_2 amount: 9 output: 6sided log: - material: log_2 + material: LOG_2 amount: 6 lore: Sixsided log Sixsided dark oaklog: inputs: dark oak log: - material: log_2 + material: LOG_2 amount: 9 durability: 1 output: 6sided log: - material: log_2 + material: LOG_2 amount: 6 lore: Sixsided log durability: 1 From 12cb0f64ef8cf89168c19bf33d42d777d1ea1261 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 4 Dec 2015 17:33:11 -0500 Subject: [PATCH 161/459] Redux on bulk crates. x16 recipes for 2 thirds reduction in time, plus no chest making time. --- config.yml | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 1e457543..df518d4b 100644 --- a/config.yml +++ b/config.yml @@ -2453,6 +2453,12 @@ production_factories: - Craft_Bookshelfs - Bastion_Framing - Craft_Crate + - Craft_Crate_Oak_Bulk + - Craft_Crate_Birch_Bulk + - Craft_Crate_Jungle_Bulk + - Craft_Crate_Acacia_Bulk + - Craft_Crate_Dark_Oak_Bulk + - Craft_Crate_Spruce_Bulk repair_multiple: 10 repair_inputs: Paper: @@ -8458,7 +8464,7 @@ production_recipes: material: SEA_LANTERN amount: 16 Craft_Crate: - name: Craft Compactor Crate + name: Craft Compactor Crates production_time: 4 inputs: Chest: @@ -8473,6 +8479,106 @@ production_recipes: amount: 54 display_name: Crate lore: A crate for compacting items + Craft_Crate_Oak_Bulk: + name: Craft Compactor Crates from Oak Logs + production_time: 43 + inputs: + Chest: + material: LOG + amount: 1248 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items + Craft_Crate_Birch_Bulk: + name: Craft Compactor Crates from Birch Logs + production_time: 43 + inputs: + Chest: + material: LOG + amount: 1248 + durability: 2 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items + Craft_Crate_Spruce_Bulk: + name: Craft Compactor Crates from Spruce Logs + production_time: 43 + inputs: + Chest: + material: LOG + amount: 1248 + durability: 1 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items + Craft_Crate_Dark_Oak_Bulk: + name: Craft Compactor Crates from Dark Oak Logs + production_time: 43 + inputs: + Chest: + material: LOG_2 + amount: 1248 + durability: 1 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items + Craft_Crate_Jungle_Bulk: + name: Craft Compactor Crates from Jungle Logs + production_time: 43 + inputs: + Chest: + material: LOG + amount: 1248 + durability: 3 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items + Craft_Crate_Acacia_Bulk: + name: Craft Compactor Crates from Acacia Logs + production_time: 43 + inputs: + Chest: + material: LOG_2 + amount: 1248 + 'Iron Ingot': + material: IRON_INGOT + amount: 64 + outputs: + Crate: + material: CHEST + amount: 864 + display_name: Crate + lore: A crate for compacting items Enchant_Sharpness: name: Enchant With Sharpness 5. production_time: 10 From aed5733a75c86963a33655964038cb5983fc56b7 Mon Sep 17 00:00:00 2001 From: Max Baumstark Date: Sat, 5 Dec 2015 04:20:06 +0100 Subject: [PATCH 162/459] Balance changes Making enchanting 10 % cheaper, removing iron cost from crates, adding a recipe to make logs from crates and shortening sapling convertion times. --- config.yml | 56 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/config.yml b/config.yml index 1e457543..96ac1fd2 100644 --- a/config.yml +++ b/config.yml @@ -7651,7 +7651,7 @@ production_recipes: durability: 15 Mutate_Spruce_Saplings: name: Mutate Spruce Saplings - production_time: 64 + production_time: 16 inputs: Oak Sapling: material: SAPLING @@ -7663,7 +7663,7 @@ production_recipes: durability: 1 Mutate_Birch_Saplings: name: Mutate Birch Saplings - production_time: 64 + production_time: 16 inputs: Oak Sapling: material: SAPLING @@ -7675,7 +7675,7 @@ production_recipes: durability: 2 Mutate_Jungle_Saplings: name: Mutate Jungle Saplings - production_time: 64 + production_time: 16 inputs: Oak Sapling: material: SAPLING @@ -7687,7 +7687,7 @@ production_recipes: durability: 3 Mutate_Acacia_Saplings: name: Mutate Acacia Saplings - production_time: 64 + production_time: 16 inputs: Oak Sapling: material: SAPLING @@ -7699,7 +7699,7 @@ production_recipes: durability: 4 Mutate_Dark_Oak_Saplings: name: Mutate Dark Oak Saplings - production_time: 64 + production_time: 16 inputs: Oak Sapling: material: SAPLING @@ -8482,7 +8482,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 50 + amount: 45 outputs: Diamond Sword: material: DIAMOND_SWORD @@ -8500,7 +8500,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 30 + amount: 27 outputs: Diamond Sword: material: DIAMOND_SWORD @@ -8518,7 +8518,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 35 + amount: 31 outputs: Diamond Sword: material: DIAMOND_SWORD @@ -8536,7 +8536,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 44 + amount: 40 outputs: Diamond Chestplate: material: DIAMOND_CHESTPLATE @@ -8554,7 +8554,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 42 + amount: 38 outputs: Diamond Legs: material: DIAMOND_LEGGINGS @@ -8572,7 +8572,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 36 + amount: 32 outputs: Diamond Boots: material: DIAMOND_BOOTS @@ -8590,7 +8590,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 32 + amount: 29 outputs: Diamond Helemt: material: DIAMOND_HELMET @@ -8608,7 +8608,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 44 + amount: 40 outputs: Diamond Chestplate: material: DIAMOND_CHESTPLATE @@ -8626,7 +8626,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 42 + amount: 38 outputs: Diamond Legs: material: DIAMOND_LEGGINGS @@ -8644,7 +8644,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 36 + amount: 33 outputs: Diamond Boots: material: DIAMOND_BOOTS @@ -8662,7 +8662,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 32 + amount: 29 outputs: Diamond Helemt: material: DIAMOND_HELMET @@ -8680,7 +8680,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 36 + amount: 32 outputs: Diamond Pick: material: DIAMOND_PICKAXE @@ -8698,7 +8698,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 36 + amount: 32 outputs: Diamond Spade: material: DIAMOND_SPADE @@ -8716,7 +8716,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 36 + amount: 32 outputs: Diamond Pick: material: DIAMOND_AXE @@ -8734,7 +8734,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 39 + amount: 35 outputs: Diamond Pick: material: DIAMOND_PICKAXE @@ -8752,7 +8752,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 39 + amount: 35 outputs: Diamond Spade: material: DIAMOND_SPADE @@ -8770,7 +8770,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 39 + amount: 35 outputs: Diamond Pick: material: DIAMOND_AXE @@ -8788,7 +8788,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 70 + amount: 63 outputs: Diamond Pick: material: DIAMOND_PICKAXE @@ -8806,7 +8806,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 70 + amount: 63 outputs: Diamond Spade: material: DIAMOND_SPADE @@ -8824,7 +8824,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 70 + amount: 63 outputs: Diamond Pick: material: DIAMOND_AXE @@ -8842,7 +8842,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 40 + amount: 36 outputs: Diamond Pick: material: DIAMOND_PICKAXE @@ -8860,7 +8860,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 40 + amount: 36 outputs: Diamond Spade: material: DIAMOND_SPADE @@ -8878,7 +8878,7 @@ production_recipes: amount: 5 Emerald Block: material: EMERALD_BLOCK - amount: 40 + amount: 36 outputs: Diamond Pick: material: DIAMOND_AXE From 8862d888a0a7d9bc1b67edbf08eb1bcee5afe5c0 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 7 Dec 2015 14:34:58 +0100 Subject: [PATCH 163/459] First ItemMap implementation --- .../igotyou/FactoryMod/utility/ItemMap.java | 295 ++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 src/com/github/igotyou/FactoryMod/utility/ItemMap.java diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java new file mode 100644 index 00000000..ac0de0bf --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -0,0 +1,295 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +public class ItemMap { + private HashMap items; + private int totalItems; + + /** + * Empty constructor to create empty item map + */ + public ItemMap() { + items = new HashMap(); + totalItems = 0; + } + + /** + * Constructor to create an item map based on the content of an inventory. + * The ItemMap will be in sync with the inventory, it will only update if + * it's explicitly told to do so + * + * @param inv + * Inventory to base the item map on + */ + public ItemMap(Inventory inv) { + update(inv); + } + + /** + * Clones the given itemstack, sets its amount to one and checks whether a + * stack equaling the created one exists in the item map. If yes the amount + * of the given stack (before the amount was set to 1) will be added to the + * current amount in the item map, if not a new entry in the map with the + * correct amount will be created + * + * @param input + * ItemStack to insert + */ + public void addItemStack(ItemStack input) { + ItemStack is = createMapConformCopy(input); + Integer i; + if ((i = items.get(is)) != null) { + items.put(is, i + input.getAmount()); + } else { + items.put(is, input.getAmount()); + } + totalItems += input.getAmount(); + } + + public void update(Inventory inv) { + items = new HashMap(); + totalItems = 0; + for (int i = 0; i < inv.getSize(); i++) { + ItemStack is = inv.getItem(i); + if (is != null) { + addItemStack(is); + } + } + } + + /** + * Merges an existing item map into this instance + * + * @param im + * Map to merge + */ + public void addItemMap(ItemMap im) { + addEntrySet(im.getEntrySet()); + } + + public void addEntrySet(Set> entries) { + for (Entry entry : entries) { + addItemAmount(entry.getKey(), entry.getValue()); + } + } + + /** + * Utility method, which has the amount of items to add as parameter. This + * method doesnt clone the ItemStack, so dont use this on ItemStacks which + * exist in the world + * + * @param input + * ItemStack to sort into the map + * @param amount + * Amount associated with the given ItemStack + */ + public void addItemAmount(ItemStack input, int amount) { + input.setAmount(amount); + addItemStack(input); + } + + /** + * Gets a submap of this instance which contains all stacks with the same + * material as the given one and their respective amounts + * + * @param m + * Material to search for + * @return New ItemMap with all ItemStack and their amount whose material + * matches the given one + */ + public ItemMap getStacksByMaterial(Material m) { + ItemMap result = new ItemMap(); + for (ItemStack is : items.keySet()) { + if (is.getType() == m) { + result.addItemAmount(is.clone(), items.get(is)); + } + } + return result; + } + + public ItemMap getStacksByMaterial(ItemStack is) { + return getStacksByMaterial(is.getType()); + } + + /** + * Gets a submap of this instance which contains all stacks with the same + * material and durability as the given one and their respective amounts + * + * @param m + * Material to search for + * @param durability + * Durability to search for + * @return New ItemMap with all ItemStack and their amount whose material + * and durability matches the given one + */ + public ItemMap getStacksByMaterialDurability(Material m, int durability) { + ItemMap result = new ItemMap(); + for (ItemStack is : items.keySet()) { + if (is.getType() == m && is.getDurability() == durability) { + result.addItemAmount(is.clone(), items.get(is)); + } + } + return result; + } + + public ItemMap getStacksByMaterialDurability(ItemStack is) { + return getStacksByMaterialDurability(is.getType(), is.getDurability()); + } + + /** + * Gets a submap of this instance which contains all stacks with the same + * material, durability and enchants as the given one and their respective + * amounts + * + * @param m + * Material to search for + * @param durability + * Durability to search for + * @param enchants + * Enchants to search for + * @return New ItemMap with all ItemStack and their amount whose material, + * durability and enchants matches the given one + */ + public ItemMap getStacksByMaterialDurabilityEnchants(Material m, + int durability, Map enchants) { + ItemMap result = new ItemMap(); + for (ItemStack is : items.keySet()) { + if (is.getType() == m && is.getDurability() == durability + && is.getItemMeta() != null + && is.getItemMeta().getEnchants().equals(enchants)) { + result.addItemAmount(is.clone(), items.get(is)); + } + } + return result; + } + + public ItemMap getStacksByMaterialDurabilityEnchants(ItemStack is) { + if (is.getItemMeta() != null) { + return getStacksByMaterialDurabilityEnchants(is.getType(), + (int) is.getDurability(), is.getItemMeta().getEnchants()); + } else { + return getStacksByMaterialDurabilityEnchants(is.getType(), + (int) is.getDurability(), + new HashMap()); + } + } + + /** + * Gets a submap of this instance which contains all stacks with the same + * lore as the given and their respective amount + * + * @param lore + * Lore to search for + * @return New ItemMap with all ItemStacks and their amount whose lore + * matches the given one + */ + public ItemMap getStacksByLore(List lore) { + ItemMap result = new ItemMap(); + for (ItemStack is : items.keySet()) { + if (is.getItemMeta() != null + && is.getItemMeta().getLore().equals(lore)) { + result.addItemAmount(is.clone(), items.get(is)); + } + } + return result; + } + + /** + * Gets how many items of the given stack are in this map. Be aware that if + * a stack doesnt equal with the given one, for example because of + * mismatched NBT tags, it wont be included in the result + * + * @param is + * Exact ItemStack to search for + * @return amount of items like the given stack in this map + */ + public Integer getAmount(ItemStack is) { + return items.get(createMapConformCopy(is)); + } + + /** + * @return How many items are stored in this map total + */ + public int getTotalItemAmount() { + return totalItems; + } + + /** + * @return How many unique items are stored in this map + */ + public int getTotalUniqueItemAmount() { + return items.keySet().size(); + } + + public Set> getEntrySet() { + return ((HashMap) items.clone()).entrySet(); + } + + /** + * Compares this ItemMap to a given one and returns a map containing the + * exact differences. For example if this instance has 5 stone and the given + * ItemMap has 10 stone, then the result will contain 5 stone. If instance + * and argument were switched around, the result would contain -5 stone, + * which expresses that the given ItemMap has 5 stone less than this + * instance. If an amount is identical it wont be added to the diff map + * + * @param im + * ItemMap to compare to + * @return ItemMap containing the exact differences between this instance + * and a given map + */ + public ItemMap getDifference(ItemMap im) { + ItemMap result = new ItemMap(); + Set> firstSet = getEntrySet(); + Set> secondSet = im.getEntrySet(); + for (Entry entry : firstSet) { + Integer pulled = im.getAmount(entry.getKey()); + if (pulled != null) { + if ((pulled - entry.getValue()) != 0) { + result.addItemAmount(entry.getKey(), + pulled - entry.getValue()); + } + clearEntrySetFromStack(secondSet, entry.getKey()); + } else { + result.addItemAmount(entry.getKey(), entry.getValue() * -1); + } + clearEntrySetFromStack(firstSet, entry.getKey()); + + } + result.addEntrySet(secondSet); + return result; + } + + /** + * Utility to not mess with stacks directly taken from inventories + * + * @param is + * Template ItemStack + * @return Cloned ItemStack with its amount set to 1 + */ + private ItemStack createMapConformCopy(ItemStack is) { + ItemStack copy = is.clone(); + copy.setAmount(1); + return copy; + } + + private Set> clearEntrySetFromStack( + Set> set, ItemStack is) { + for (Entry entry : set) { + if (entry.getKey().equals(is)) { + set.remove(entry); + } + } + return set; + } +} From f281db45c9b9a188b00bbb21e463dfd1fd5b5fb0 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 7 Dec 2015 23:34:37 +0100 Subject: [PATCH 164/459] First commit after big refactoring, still a mess --- .../igotyou/FactoryMod/Contraption.java | 46 ++ .../igotyou/FactoryMod/FactoryModManager.java | 83 +++ .../igotyou/FactoryMod/FactoryModPlugin.java | 158 ++---- .../igotyou/FactoryMod/FactoryObject.java | 203 -------- .../FactoryMod/Factorys/ABaseFactory.java | 473 +++++------------- .../FactoryMod/Factorys/Compactor.java | 30 +- .../igotyou/FactoryMod/Factorys/IFactory.java | 65 --- .../FactoryMod/Factorys/NetherFactory.java | 18 +- .../FactoryMod/Factorys/PrintingPress.java | 68 +-- .../Factorys/ProductionFactory.java | 10 +- .../FactoryMod/Factorys/RepairFactory.java | 20 +- .../FurnCraftChestFactory.java | 228 +++++++++ .../IInteractionManager.java | 13 + .../igotyou/FactoryMod/managers/AManager.java | 146 ------ .../FactoryMod/managers/CompactorManager.java | 7 +- .../managers/FactoryManagerService.java | 5 +- .../igotyou/FactoryMod/managers/IManager.java | 82 --- .../managers/NetherFactoryManager.java | 230 --------- .../managers/PrintingPressManager.java | 7 +- .../managers/ProductionFactoryManager.java | 9 +- .../managers/RepairFactoryManager.java | 7 +- .../FurnCraftChestStructure.java | 93 ++++ .../MultiBlockStructure.java | 42 ++ .../powerManager/IPowerManager.java | 14 + .../properties/CompactorProperties.java | 50 +- .../properties/NetherFactoryProperties.java | 114 ----- .../properties/PrintingPressProperties.java | 70 +-- .../properties/ProductionProperties.java | 14 +- .../properties/RepairFactoryProperties.java | 42 +- .../FactoryMod/recipes/ProductionRecipe.java | 26 +- .../repairManager/IRepairManager.java | 12 + .../FactoryMod/utility/AdvancedItemStack.java | 52 ++ .../igotyou/FactoryMod/utility/ItemList.java | 413 --------------- .../FactoryMod/utility/NamedItemStack.java | 51 -- 34 files changed, 919 insertions(+), 1982 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/Contraption.java create mode 100644 src/com/github/igotyou/FactoryMod/FactoryModManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/FactoryObject.java delete mode 100644 src/com/github/igotyou/FactoryMod/Factorys/IFactory.java create mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java create mode 100644 src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/AManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/IManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java create mode 100644 src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java create mode 100644 src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java create mode 100644 src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java create mode 100644 src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java create mode 100644 src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/ItemList.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java diff --git a/src/com/github/igotyou/FactoryMod/Contraption.java b/src/com/github/igotyou/FactoryMod/Contraption.java new file mode 100644 index 00000000..fe3718de --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/Contraption.java @@ -0,0 +1,46 @@ +package com.github.igotyou.FactoryMod; + +import org.bukkit.Location; +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; + +public abstract class Contraption { + protected IInteractionManager im; + protected IRepairManager rm; + protected Location physicalLocation; + protected boolean active; + + public Contraption(Location loc, IInteractionManager im, + IRepairManager rm) { + this.physicalLocation = loc; + this.im = im; + this.rm = rm; + } + + public IRepairManager getRepairManager() { + return rm; + } + + public IInteractionManager getInteractionManager() { + return im; + } + + public boolean isActive() { + return active; + } + + public Location getLocation() { + return physicalLocation; + } + + public abstract boolean isWhole(); + + public abstract void activate(); + + public abstract void deactivate(); + + public abstract void attemptToActivate(Player p); + +} diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java new file mode 100644 index 00000000..d5c68606 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -0,0 +1,83 @@ +package com.github.igotyou.FactoryMod; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; + +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.properties.AFactoryProperties; + +public abstract class FactoryModManager { + + protected FactoryModPlugin plugin; + private HashMap contraptions = new HashMap(); + private HashMap> locations = new HashMap>(); + private HashSet possibleCenterBlocks; + private List possibleStructures; + + public FactoryModManager(FactoryModPlugin plugin) { + this.plugin = plugin; + // Normal furnace, craftingtable, chest factories + possibleStructures.add(new FurnCraftChestStructure()); + possibleCenterBlocks.add(Material.WORKBENCH); + } + + public void addContraption(Contraption c, AFactoryProperties prop) { + contraptions.put(c, prop); + } + + public void removeContraption(Contraption c) { + contraptions.remove(c); + } + + public Contraption getFactoryAt(Location loc) { + return getFactoryAt(loc.getBlock()); + } + + public Contraption getFactoryAt(Block b) { + HashMap forThisType = locations.get(b.getType()); + if (forThisType == null) { + return null; + } else { + return forThisType.get(b.getLocation()); + } + } + + public void addContraptionBlock(Block b, Contraption c) { + HashMap requiredMaterial = locations.get(b + .getType()); + if (requiredMaterial == null) { + requiredMaterial = new HashMap(); + } + requiredMaterial.put(b.getLocation(), c); + } + + public boolean factoryExistsAt(Location loc) { + return getFactoryAt(loc) == null; + } + + public void attemptCreation(Block b, Player p) { + if (possibleCenterBlocks.contains(b.getType()) + && !factoryExistsAt(b.getLocation())) { + for (MultiBlockStructure mbs : possibleStructures) { + if (mbs.isComplete(b)) { + Block invBlock = mbs.getInventoryBlock(b); + if (invBlock != null) { + Inventory inv = ((InventoryHolder) (invBlock.getState())) + .getInventory(); + //ItemMap here + } + } + } + + } + } +} diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 88f145d2..2d625c4d 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -21,7 +21,8 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import com.github.igotyou.FactoryMod.FactoryObject.FactoryType; +import vg.civcraft.mc.civmodcore.ACivMod; + import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; @@ -39,17 +40,14 @@ import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -public class FactoryModPlugin extends JavaPlugin +public class FactoryModPlugin extends ACivMod { /* Special Values */ - public static final String VERSION = "v1.4.0"; //Current version of plugin - public static final String PLUGIN_NAME = "FactoryMod"; //Name of plugin - public static final String PLUGIN_PREFIX = PLUGIN_NAME + " " + VERSION + ": "; public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name public static final String REPAIR_FACTORY_SAVE_FILE = "repairSaves"; @@ -61,7 +59,7 @@ public class FactoryModPlugin extends JavaPlugin public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) public static final int MINUTES_PER_YEAR = 60 * 60 * 24 * 365; //number of minutes per year (31.5M) private static final String CONFIG_FILE = "config.yml"; // the config file name - private static final NamedItemStack DEFAULT_FUEL = new NamedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item + private static final AdvancedItemStack DEFAULT_FUEL = new AdvancedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item /* General Properties */ @@ -81,89 +79,24 @@ public class FactoryModPlugin extends JavaPlugin * Number of days for a factory to fully degrade from 100% to 0% health (Default 28) */ public static long REPAIR_PERIOD; - /** - * Factory center block material (Default WORKBENCH) - */ - public static Material CENTRAL_BLOCK_MATERIAL; + /** * The item used to interact with factoies (Default STICK) */ public static Material FACTORY_INTERACTION_MATERIAL; - /** - * Whether the build materials are returned upon destruction of a factory (Default false) - */ - public static boolean RETURN_BUILD_MATERIALS; + /** * Whether Citadel is enabled (Default true) */ public static boolean CITADEL_ENABLED; - /** - * Whether factories are permanently removed upon the destruction of their blocks (Default false) - */ - public static boolean DESTRUCTIBLE_FACTORIES; + /** * Whether XP orb drops are disabled (Default false) */ public static boolean DISABLE_EXPERIENCE; - /** - * Whether factories are triggered by redstone signals (Default true) - */ - public static boolean REDSTONE_START_ENABLED; - /** - * Whether factory running state is output to a lever (Default true) - */ - public static boolean LEVER_OUTPUT_ENABLED; - /* Nether Properties */ - /** - * The name of the overworld dimension (Default world) - */ - public static String WORLD_NAME; - /** - * The name of the nether dimension (Default world_nether) - */ - public static String NETHER_NAME; - /** - * Overworld to nether distance ratio (Default 8) - */ - public static int NETHER_SCALE; - /** - * Disable vanilla nether portal operation (Default true) - */ - public static boolean DISABLE_PORTALS; - /** - * The material of the nether factory teleport platform (Default OBSIDIAN) - */ - public static Material NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL; - /** - * Allow reinforcement above nether factory teleport platforms (Default false) - */ - public static boolean ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM; - /** - * Allow placing of blocks above nether factory teleport platform (Default false) - */ - public static boolean ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM; - /** - * Whether teleport platforms are unbreakable (Default false) - */ - public static boolean TELEPORT_PLATFORM_INVUNERABLE; - /** - * Whether the teleport platform is generated when a player is about to teleport (Default false) - */ - public static boolean REGENERATE_TELEPORT_BLOCK_ON_TELEPORT; - /** - * Whether the blocks above a portal are destroyed, ignoring Citadel, when a player is about to teleport (Default false) - */ - public static boolean REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT; - /** - * The material of the nether factory marker block (Default COAL_BLOCK) - */ - public static Material NETHER_FACTORY_MARKER_MATERIAL; - /** - * Maximum distance between nether factory and marker (Default 64) - */ - public static int NETHER_MARKER_MAX_DISTANCE; + public static Map productionProperties; public static Map productionRecipes; @@ -176,6 +109,7 @@ public class FactoryModPlugin extends JavaPlugin public void onEnable() { + super.onEnable(); plugin = this; //load the config.yml initConfig(); @@ -191,6 +125,10 @@ public void onDisable() manager.onDisable(); } + public String getPluginName() { + return "FactoryMod"; + } + public void registerEvents() { try @@ -221,42 +159,10 @@ public void initConfig() this.saveDefaultConfig(); reloadConfig(); config = getConfig(); - //what should the nether scaling be for the nether factorys? - NETHER_SCALE = config.getInt("nether_general.nether_scale",8); - //Should we Disable regular portals? - DISABLE_PORTALS = config.getBoolean("nether_general.disable_portals", true); - //Allow reinforcement above nether factory teleport platforms. - ALLOW_REINFORCEMENT_CREATION_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_reinforcement_creation_above_teleport_platform", false); - //Allow people to place blocks above nether factory teleport platforms. - ALLOW_BLOCK_PLACEMENT_ABOVE_TELEPORT_PLATFORM = config.getBoolean("nether_general.allow_block_placement_above_teleport_platform", false); - //Make teleport platforms unbreakable - TELEPORT_PLATFORM_INVUNERABLE = config.getBoolean("nether_general.teleport_platform_invunerable",false); - //Right before a player get's teleported, should the teleport platform be regenerated? - REGENERATE_TELEPORT_BLOCK_ON_TELEPORT = config.getBoolean("nether_general.regenerate_teleport_block_on_teleport", false); - //Right before a player get's teleported, should the blocks above the portal be destroyed(ignotes citadel)? - REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT = config.getBoolean("nether_general.remove_blocks_above_teleport_platform_on_teleport", false); - //what's the name of the overworld? - WORLD_NAME = config.getString("nether_general.world_name", "world"); - //what's the name of the overworld? - NETHER_NAME = config.getString("nether_general.nether_name", "world_nether"); - //how often should the managers save? - SAVE_CYCLE = config.getInt("general.save_cycle",15)*60*20; - //what's the material of the center block of factorys? - CENTRAL_BLOCK_MATERIAL = Material.getMaterial(config.getString("general.central_block")); - //what's the material of the nether portal teleportation platforms? - NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL = Material.getMaterial(config.getString("nether_general.teleport_platform_material_nether_factory")); - //what's the material of the marker blocks for nether factorys? - NETHER_FACTORY_MARKER_MATERIAL = Material.getMaterial(config.getString("nether_general.marker_material_nether_factory")); - //how far from the factory can the marker be? - NETHER_MARKER_MAX_DISTANCE = config.getInt("nether_general.marker_max_distance"); - //Return the build materials upon destruction of factory. - RETURN_BUILD_MATERIALS = config.getBoolean("general.return_build_materials",false); //is citadel enabled? CITADEL_ENABLED = config.getBoolean("general.citadel_enabled",true); //what's the tool that we use to interact with the factorys? FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material","STICK")); - //If factories are removed upon destruction of their blocks - DESTRUCTIBLE_FACTORIES=config.getBoolean("general.destructible_factories",false); //Check if XP drops should be disabled DISABLE_EXPERIENCE=config.getBoolean("general.disable_experience",false); //How frequently factories are updated @@ -265,16 +171,12 @@ public void initConfig() DISREPAIR_PERIOD= config.getLong("general.disrepair_period",14)*24*60*60*1000; //The length of time it takes a factory to go to 0% health REPAIR_PERIOD = config.getLong("production_general.repair_period",28)*24*60*60*1000; - //Disable recipes which result in the following items - //Do we output the running state with a lever? - LEVER_OUTPUT_ENABLED = config.getBoolean("general.lever_output_enabled",true); - //Do we allow factories to be started with redstone? - REDSTONE_START_ENABLED = config.getBoolean("general.redstone_start_enabled",true); + // Disable the following recipes List toDisable = new ArrayList(); - ItemList disabledRecipes = getItems(config.getConfigurationSection("crafting.disable")); - for (NamedItemStack recipe : disabledRecipes) { + ItemList disabledRecipes = getItems(config.getConfigurationSection("crafting.disable")); + for (AdvancedItemStack recipe : disabledRecipes) { sendConsoleMessage("Attempting to disable recipes for " + recipe.getCommonName()); List tempList = getServer().getRecipesFor(recipe); @@ -306,7 +208,7 @@ public void initConfig() Recipe recipe; List shape = configSection.getStringList("shape"); - NamedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); + AdvancedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); if(shape.isEmpty()) { @@ -364,11 +266,11 @@ public void initConfig() //TODO: fix config according to default 1 int productionTime = configSection.getInt("production_time", 2); //Inputs of the recipe, empty of there are no inputs - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); + ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); //Inputs of the recipe, empty of there are no inputs - ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); + ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); //Outputs of the recipe, empty of there are no inputs - ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); + ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); //EnchantmentOptions of the recipe, all false if nothing set. ConfigurationSection configEnchant = configSection.getConfigurationSection("enchantment_options"); EnchantmentOptions enchantmentOptions = null; @@ -382,7 +284,7 @@ public void initConfig() List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); //Whether this recipe can only be used once boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantmentOptions, enchantments, useOnce, new ItemList()); + ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantmentOptions, enchantments, useOnce, new ItemList()); productionRecipes.put(title, recipe); //Store the titles of the recipes that this should point to List currentOutputRecipes = Lists.newArrayList(); @@ -409,16 +311,16 @@ public void initConfig() String factoryName = configSection.getString("name", "Default Name"); //Uses overpowered getItems method for consistency, should always return a list of size=1 //If no fuel is found, default to charcoal - ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); + ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); if(fuel.isEmpty()) { - fuel = new ItemList(); + fuel = new ItemList(); fuel.add(DEFAULT_FUEL); } //TODO: default fuel time should be 1 int fuelTime = configSection.getInt("fuel_time", 2); - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); - ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); + ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); + ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); List factoryRecipes = Lists.newArrayList(); for (String recipe : configSection.getStringList("recipes")) @@ -488,9 +390,9 @@ private List getPotionEffects(ConfigurationSection configurationSe return potionEffects; } - public ItemList getItems(ConfigurationSection configItems) + public ItemList getItems(ConfigurationSection configItems) { - ItemList items = new ItemList(); + ItemList items = new ItemList(); if(configItems != null) { for(String commonName : configItems.getKeys(false)) @@ -522,10 +424,10 @@ public ItemList getItems(ConfigurationSection configItems) return items; } - private NamedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, + private AdvancedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, List compulsoryEnchants, List storedEnchants, List potionEffects) { - NamedItemStack namedItemStack= new NamedItemStack(material, stackSize, durability,commonName); + AdvancedItemStack namedItemStack= new AdvancedItemStack(material, stackSize, durability,commonName); if(name != null || loreString != null || compulsoryEnchants.size() > 0 || storedEnchants.size() > 0 || potionEffects.size() > 0 || repairCost > 0) { ItemMeta meta = namedItemStack.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java deleted file mode 100644 index 623b66de..00000000 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.github.igotyou.FactoryMod; - - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Chest; -import org.bukkit.block.Furnace; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; - -//original file: -/** - * MachineObject.java - * Purpose: Basic object base for machines to extend - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited version: -/** - * FactoryObject.java - * Purpose basic object base for factories to extend - * @author igotyou - * - */ -public class FactoryObject -{ - //the different factory types, NOTE: these are not the sub-factory types, these are the main types. - public enum FactoryType - { - PRODUCTION, - PRINTING_PRESS, - REPAIR_FACTORY, - COMPACTOR, - NETHER_FACTORY - } - - - protected Location factoryLocation; // Current location of factory center - protected Location factoryInventoryLocation; //Current location of factory inventory(normmaly a chest) - protected Location factoryPowerSourceLocation;//Current location of factory power source(normmaly a furnace) - protected boolean active; // Whether factory is currently active - protected Inventory factoryInventory; // The inventory of the factory - protected Inventory factoryPowerInventory;//The inventory of the power source. - protected FactoryType factoryType; // The type this factory is - protected String subFactoryType;//the SUBfactory type(the ones loaded from the config file) - protected IFactoryProperties factoryProperties; // The properties of this factory type and tier - protected boolean upgraded; // Whether the tier has recently upgraded - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - FactoryType factoryType, String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = false; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.upgraded = false; - if (this.isWhole(true)) - { - initializeInventory(); - } - updateProperties(); - } - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, FactoryType factoryType, String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = active; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.upgraded = false; - if (this.isWhole(true)) - { - initializeInventory(); - } - updateProperties(); - } - - /** - * Constructor - */ - public FactoryObject(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, int tierLevel, FactoryType factoryType, Inventory factoryInventory, - String subFactoryType) - { - this.factoryLocation = factoryLocation; - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; - this.active = active; - this.factoryType = factoryType; - this.subFactoryType = subFactoryType; - this.factoryInventory = factoryInventory; - updateProperties(); - } - - /** - * Initializes the inventory for this factory - */ - //Due to non-destructable factories this will not have been called on reconstructed factories - //however I am unable to find a use for this method in the current code, so it doesn't - //seem to be an issue right now, maybe the calls in the constructor should be gotten rid of - //all methods that get the inventory reinitialize the contents. - public void initializeInventory() - { - switch(factoryType) - { - case PRODUCTION: - Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); - factoryInventory = chestBlock.getInventory(); - Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); - factoryPowerInventory = furnaceBlock.getInventory(); - break; - default: - break; - } - } - - /** - * Updates the current properties for the factory. - */ - public void updateProperties() - { - factoryProperties = FactoryModPlugin.getProperties(factoryType, subFactoryType); - } - - /** - * Returns the user-friendly name for this factory type - */ - public String factoryName() - { - switch (factoryType) - { - case PRODUCTION: - return "Production"; - default: - return null; - } - } - - /** - * returns the factory Inventory(normally a chest), updates the inventory variable aswell. - */ - public Inventory getInventory() - { - Chest chestBlock = (Chest)factoryInventoryLocation.getBlock().getState(); - factoryInventory = chestBlock.getInventory(); - return factoryInventory; - } - - /** - * Returns the power Source inventory, updates it aswell. - */ - public Inventory getPowerSourceInventory() - { - if (!(factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation.getBlock().getType() == Material.BURNING_FURNACE)) - { - return null; - } - Furnace furnaceBlock = (Furnace)factoryPowerSourceLocation.getBlock().getState(); - factoryPowerInventory = furnaceBlock.getInventory(); - return factoryPowerInventory; - } - - /** - * Returns the sub-factory type of the factory. - */ - public String getSubFactoryType() - { - return subFactoryType; - } - - - /** - * returns if the factory is on or not. - */ - public boolean getActive() - { - return active; - } - - /** - * returns true if all factory blocks are occupied with the correct blocks - */ - public boolean isWhole(boolean initCall) - { - // Check the types of the known locations for power, inventory, and interaction for the expected materials - //TODO: check reinforcement groups? - return (factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation.getBlock().getType() == Material.BURNING_FURNACE) - && (factoryInventoryLocation.getBlock().getType() == Material.CHEST) && (factoryLocation.getBlock().getType() == FactoryModPlugin.CENTRAL_BLOCK_MATERIAL); - } -} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java index 242b7a91..f65ebdc6 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java @@ -18,42 +18,36 @@ import org.bukkit.material.MaterialData; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.FactoryObject; +import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; -public abstract class ABaseFactory extends FactoryObject implements IFactory { - public static final BlockFace[] REDSTONE_FACES = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN}; - - protected int currentProductionTimer = 0;//The "production timer", which trachs for how long the factory has been producing the selected recipe - protected int currentEnergyTimer = 0;//Time since last energy consumption(if there's no lag, it's in seconds) - protected double currentRepair; - protected long timeDisrepair;//The time at which the factory went into disrepair - - private Logger log = Logger.getLogger(ABaseFactory.class.getName()); +public abstract class ABaseFactory extends FurnCraftChestFactory { + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, FactoryType factoryType, String subFactoryType) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, - factoryType, subFactoryType); + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, + active, factoryType, subFactoryType); this.currentRepair = 0.0; - this.timeDisrepair=3155692597470L; + this.timeDisrepair = 3155692597470L; } public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, boolean active, int tierLevel, FactoryType factoryType, Inventory factoryInventory, String subFactoryType) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, - tierLevel, factoryType, factoryInventory, subFactoryType); + super(factoryLocation, factoryInventoryLocation, factoryPowerSource, + active, tierLevel, factoryType, factoryInventory, + subFactoryType); this.currentRepair = 0.0; - this.timeDisrepair=3155692597470L; + this.timeDisrepair = 3155692597470L; } public ABaseFactory(Location factoryLocation, @@ -61,10 +55,10 @@ public ABaseFactory(Location factoryLocation, FactoryType factoryType, String subFactoryType) { super(factoryLocation, factoryInventoryLocation, factoryPowerSource, factoryType, subFactoryType); - this.currentRepair=0.0; - this.timeDisrepair=3155692597470L;//Year 2070, default starting value + this.currentRepair = 0.0; + this.timeDisrepair = 3155692597470L;// Year 2070, default starting value } - + public ABaseFactory(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, FactoryType factoryType, boolean active, String subFactoryType, @@ -75,8 +69,8 @@ public ABaseFactory(Location factoryLocation, this.active = active; this.currentEnergyTimer = currentEnergyTimer; this.currentProductionTimer = currentProductionTimer; - this.currentRepair=currentMaintenance; - this.timeDisrepair=timeDisrepair; + this.currentRepair = currentMaintenance; + this.timeDisrepair = timeDisrepair; } private void setActivationLever(boolean state) { @@ -87,237 +81,126 @@ private void setActivationLever(boolean state) { } } - /** - * Turns the factory off. - */ - public void powerOff() - { - if(active) - { - if (FactoryModPlugin.LEVER_OUTPUT_ENABLED) { - setActivationLever(false); - } - - //lots of code to make the furnace turn off, without loosing contents. - Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); - byte data = furnace.getData().getData(); - ItemStack[] oldContents = furnace.getInventory().getContents(); - furnace.getInventory().clear(); - factoryPowerSourceLocation.getBlock().setType(Material.FURNACE); - furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); - furnace.setRawData(data); - furnace.update(); - furnace.getInventory().setContents(oldContents); - - //put active to false - active = false; - //reset the production timer - currentProductionTimer = 0; - } - } - public boolean checkHasSpace() { - ItemList output = getOutputs(); - return output.testPutIn(getInventory()); - } + + public boolean checkHasMaterials() { return getAllInputs().allIn(getInventory()); } + / /** - * Turns the factory on + * Returns either a success or error message. Called by the blockListener + * when a player left clicks the powerSourceLocation with the + * InteractionMaterial */ - public void powerOn() - { - //put active to true - active = true; - - // Set attached lever - if (FactoryModPlugin.LEVER_OUTPUT_ENABLED) { - setActivationLever(true); - } - - //lots of code to make the furnace light up, without loosing contents. - Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); - byte data = furnace.getData().getData(); - ItemStack[] oldContents = furnace.getInventory().getContents(); - furnace.getInventory().clear(); - factoryPowerSourceLocation.getBlock().setType(Material.BURNING_FURNACE); - furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); - furnace.setRawData(data); - furnace.update(); - furnace.setBurnTime(Short.MAX_VALUE); - furnace.getInventory().setContents(oldContents); - //reset the production timer - currentProductionTimer = 0; - } - - /** - * Returns either a success or error message. - * Called by the blockListener when a player left clicks the powerSourceLocation with the InteractionMaterial - */ - public List togglePower() - { - List response=new ArrayList(); - //if the factory is turned off - if (!active) - { - //if the factory isn't broken or the current recipe can repair it - if(!isBroken()||isRepairing()) - { - //is there fuel enough for at least once energy cycle? - if (isFuelAvailable()) - { - //are there enough materials for the current recipe in the chest? - if (checkHasMaterials()) - { - //turn the factory on + public List togglePower() { + List response = new ArrayList(); + // if the factory is turned off + if (!active) { + // if the factory isn't broken or the current recipe can repair it + if (!isBroken() || isRepairing()) { + // is there fuel enough for at least once energy cycle? + if (isFuelAvailable()) { + // are there enough materials for the current recipe in the + // chest? + if (checkHasMaterials()) { + // turn the factory on powerOn(); - //return a success message - response.add(new InteractionResponse(InteractionResult.SUCCESS, "Factory activated!")); + // return a success message + response.add(new InteractionResponse( + InteractionResult.SUCCESS, "Factory activated!")); return response; } - //there are not enough materials for the recipe! - else - { - //return a failure message, containing which materials are needed for the recipe - //[Requires the following: Amount Name, Amount Name.] - //[Requires one of the following: Amount Name, Amount Name.] - - ItemList needAll=new ItemList(); - ItemList allInputs = getAllInputs(); + // there are not enough materials for the recipe! + else { + // return a failure message, containing which materials + // are needed for the recipe + // [Requires the following: Amount Name, Amount Name.] + // [Requires one of the following: Amount Name, Amount + // Name.] + + ItemList needAll = new ItemList(); + ItemList allInputs = getAllInputs(); needAll.addAll(allInputs.getDifference(getInventory())); - if(!needAll.isEmpty()) - { - response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); + if (!needAll.isEmpty()) { + response.add(new InteractionResponse( + InteractionResult.FAILURE, + "You need all of the following: " + + needAll.toString() + ".")); } else if (allInputs == null || allInputs.isEmpty()) { log.warning("getAllInputs() returned null or empty; recipe is returning no expectation of input!"); } return response; } } - //if there isn't enough fuel for at least one energy cycle - else - { - //return a error message - int multiplesRequired=(int)Math.ceil(getProductionTime()/(double)getEnergyTime()); - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is missing fuel! ("+getFuel().getMultiple(multiplesRequired).toString()+")")); + // if there isn't enough fuel for at least one energy cycle + else { + // return a error message + int multiplesRequired = (int) Math.ceil(getProductionTime() + / (double) getEnergyTime()); + response.add(new InteractionResponse( + InteractionResult.FAILURE, + "Factory is missing fuel! (" + + getFuel().getMultiple(multiplesRequired) + .toString() + ")")); return response; } - } - else - { - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is in disrepair!")); + } else { + response.add(new InteractionResponse(InteractionResult.FAILURE, + "Factory is in disrepair!")); return response; - } + } } - //if the factory is on already - else - { - //turn the factory off + // if the factory is on already + else { + // turn the factory off powerOff(); - //return success message - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory has been deactivated!")); + // return success message + response.add(new InteractionResponse(InteractionResult.FAILURE, + "Factory has been deactivated!")); return response; } } + public abstract ItemList getFuel(); + + public abstract ItemList getInputs(); + + public abstract ItemList getOutputs(); + + public abstract ItemList getRepairs(); - public abstract ItemList getFuel(); - public abstract double getEnergyTime(); - public abstract double getProductionTime(); - public abstract ItemList getInputs(); - public abstract ItemList getOutputs(); - public abstract ItemList getRepairs(); - public void consumeInputs() { - //Remove inputs from chest + // Remove inputs from chest getInputs().removeFrom(getInventory()); } - + /** - * Implementations should override this to define any controls on enchantment. + * Implementations should override this to define any controls on + * enchantment. * * @return an instance of EnchantmentOptions */ public EnchantmentOptions getEnchantmentOptions() { return EnchantmentOptions.DEFAULT; } - + public void produceOutputs() { - //Adds outputs to chest with appropriate enchantments - getOutputs().putIn(getInventory(),getEnchantments(), getEnchantmentOptions()); + // Adds outputs to chest with appropriate enchantments + getOutputs().putIn(getInventory(), getEnchantments(), + getEnchantmentOptions()); } - public ItemList getAllInputs() { - ItemList allInputs = new ItemList(); + public ItemList getAllInputs() { + ItemList allInputs = new ItemList(); allInputs.addAll(getInputs()); allInputs.addAll(getRepairs()); return allInputs; } - /** - * called by the manager each update cycle - */ - public void update() - { - //if factory is turned on - if (active) - { - //if the materials required to produce the current recipe are in the factory inventory - if (checkHasMaterials()) - { - //if the factory has been working for less than the required time for the recipe - if (currentProductionTimer < getProductionTime()) - { - //if the factory power source inventory has enough fuel for at least 1 energyCycle - if (isFuelAvailable()) - { - //if the time since fuel was last consumed is equal to how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime()-1) - { - //remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); - //0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); - } - //if we don't need to consume fuel, just increment the energy timer - else - { - currentEnergyTimer++; - } - //increment the production timer - currentProductionTimer ++; - postUpdate(); - } - //if there is no fuel Available turn off the factory - else - { - powerOff(); - } - } - - //if the production timer has reached the recipes production time remove input from chest, and add output material - else if (currentProductionTimer >= getProductionTime()) - { - consumeInputs(); - produceOutputs(); - //Repairs the factory - repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); - recipeFinished(); - - currentProductionTimer = 0; - powerOff(); - } - } - else - { - powerOff(); - } - } - } + protected void postUpdate() { // Hook for subtypes @@ -333,66 +216,24 @@ public List getEnchantments() { protected abstract void recipeFinished(); - /** - * returns the date at which the factory went into disrepair - */ - public long getTimeDisrepair() - { - return timeDisrepair; - } + + - public Block findActivationLever() { - Block block = getPowerSourceLocation().getBlock(); - return findAttachedLever(block); - } - - public Block findAttachedLever(Block block) { - // Check sides for attached lever - required for automation - Block lever = null; - for (BlockFace face : REDSTONE_FACES) { - lever = block.getRelative(face); - if (lever.getType() == Material.LEVER) { - BlockFace attached = getAttachedFace(lever); - if (attached != null && attached == face) { - return lever; - } - } - } - - return null; - } - - private static BlockFace getAttachedFace(Block lever) { - BlockState state = lever.getState(); - MaterialData md = state.getData(); - if (md instanceof Attachable) { - BlockFace face = ((Attachable) md).getAttachedFace(); - return face.getOppositeFace(); - } else { - return null; - } - } - - private void shotGunUpdate(Block block) { - for (BlockFace direction : REDSTONE_FACES) { - Block neighbour = block.getRelative(direction); - - } - } - - + /** - * Sets the toggled state of a single lever
    - * No Lever type check is performed - * - * @param lever block - * @param down state to set to - */ + * Sets the toggled state of a single lever
    + * No Lever type check is performed + * + * @param lever + * block + * @param down + * state to set to + */ private static void setLever(org.bukkit.block.Block lever, boolean down) { if (lever.getType() != Material.LEVER) { return; } - + byte data = lever.getData(); int newData; if (down) { @@ -404,7 +245,8 @@ private static void setLever(org.bukkit.block.Block lever, boolean down) { // CraftBukkit start - Redstone event for lever int old = !down ? 1 : 0; int current = down ? 1 : 0; - BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(lever, old, current); + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(lever, + old, current); Bukkit.getServer().getPluginManager().callEvent(eventRedstone); if ((eventRedstone.getNewCurrent() > 0) != down) { return; @@ -412,41 +254,38 @@ private static void setLever(org.bukkit.block.Block lever, boolean down) { // CraftBukkit end lever.setData((byte) newData, true); lever.getState().update(); - Block attached = lever.getRelative(((Attachable) lever.getState().getData()).getAttachedFace()); + Block attached = lever.getRelative(((Attachable) lever.getState() + .getData()).getAttachedFace()); } } - /** * returns the Location of the central block of the factory */ - public Location getCenterLocation() - { + public Location getCenterLocation() { return factoryLocation; } /** * returns the Location of the factory Inventory */ - public Location getInventoryLocation() - { + public Location getInventoryLocation() { return factoryInventoryLocation; } /** * returns the Location of the factory power source */ - public Location getPowerSourceLocation() - { + public Location getPowerSourceLocation() { return factoryPowerSourceLocation; } - + /** * Checks if there is enough fuel Available for atleast once energy cycle + * * @return true if there is enough fuel, false otherwise */ - public boolean isFuelAvailable() - { + public boolean isFuelAvailable() { Inventory inv = getPowerSourceInventory(); if (inv == null) { return false; @@ -455,94 +294,6 @@ public boolean isFuelAvailable() } } - /** - * Called by the block listener when the player(or a entity) destroys the factory - * Drops the build materials if the config says it should - */ - public void destroy(Location destroyLocation) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory destroyed: ") - .append(subFactoryType) - .append(" at ") - .append(StringUtils.formatCoords(getCenterLocation())) - .toString()); - - powerOff(); - currentRepair = getMaxRepair(); - timeDisrepair = System.currentTimeMillis(); - } - /* - * Repairs the factory - */ - protected void repair(int amountRepaired) - { - currentRepair-=amountRepaired; - if(currentRepair<0) - { - currentRepair=0; - } - if(currentRepair=totalRepair) - { - currentRepair=totalRepair; - long currentTime=System.currentTimeMillis(); - if (currentTime=getMaxRepair()&&getMaxRepair()!=0; - } - /** - * Returns the production timer - */ - public int getProductionTimer() - { - return currentProductionTimer; - } - - /** - * Returns the energy timer - */ - public int getEnergyTimer() - { - return currentEnergyTimer; - } - public boolean isRepairing() { - return false; - } - - public List getChestResponse() { - return new ArrayList(); - } - - public List getCentralBlockResponse() { - return new ArrayList(); - } } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java index f9e9ad0c..691dd6d2 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java @@ -13,7 +13,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class Compactor extends ABaseFactory { @@ -42,7 +42,7 @@ public boolean isRepairing() { return mode.equals(CompactorMode.REPAIR); } - public ItemList getFuel() { + public ItemList getFuel() { return cp.getFuel(); } @@ -58,13 +58,13 @@ public double getProductionTime() { } } - public ItemList getInputs() { - ItemList inputs = new ItemList(); + public ItemList getInputs() { + ItemList inputs = new ItemList(); Inventory inv = getInventory(); if(mode.equals(CompactorMode.DECOMPACT)) { for(ItemStack is : inv.getContents()) { if(canDecompact(is)) { - NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(1); inputs.add(clone); @@ -74,7 +74,7 @@ public ItemList getInputs() { } else if (mode.equals(CompactorMode.COMPACT)) { for(ItemStack is : inv.getContents()) { if(canCompact(is)) { - NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); inputs.add(clone); inputs.addAll(cp.getRecipeMaterials()); @@ -137,13 +137,13 @@ private boolean canDecompact(ItemStack is) { return false; } - public ItemList getOutputs() { - ItemList outputs = new ItemList(); + public ItemList getOutputs() { + ItemList outputs = new ItemList(); Inventory inv = getInventory(); if (mode.equals( CompactorMode.DECOMPACT )) { for(ItemStack is : inv.getContents()) { if(canDecompact(is)) { - NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(clone.getMaxStackSize()); ItemMeta cloneMeta = clone.getItemMeta(); cloneMeta.setLore(null); @@ -156,7 +156,7 @@ public ItemList getOutputs() { } else if (mode.equals( CompactorMode.COMPACT )) { for (ItemStack is : inv.getContents()) { if(canCompact(is)) { - NamedItemStack clone = new NamedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); + AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); clone.setAmount(1); ItemMeta cloneMeta = clone.getItemMeta(); List lore = new ArrayList(); @@ -172,11 +172,11 @@ public ItemList getOutputs() { return outputs; } - public ItemList getRepairs() { + public ItemList getRepairs() { if (mode.equals( CompactorMode.REPAIR)) { return cp.getRepairMaterials(); } else { - return new ItemList(); + return new ItemList(); } } @@ -235,7 +235,7 @@ public boolean checkHasMaterials() { } protected void recipeFinished() { - ItemList output = getOutputs(); + ItemList output = getOutputs(); getInputs().removeFrom(getInventory()); output.putIn(getInventory()); } @@ -265,10 +265,10 @@ public List getChestResponse(){ String response = ""; // the response specific to the mode. if (mode.equals(CompactorMode.COMPACT) ) { - ItemList inputs = getInputs(); + ItemList inputs = getInputs(); response = (inputs.isEmpty() ? "Nothing to compact." : "Next up to compact: " + inputs.toString() ); } else if (mode.equals(CompactorMode.DECOMPACT)){ - ItemList inputs = getInputs(); + ItemList inputs = getInputs(); if (inputs.isEmpty()) { response = "Nothing to decompact."; } else { diff --git a/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java deleted file mode 100644 index 651b2316..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/IFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -//original file: -/** - * Machine.java - * Purpose: An interface for machines to implement with basic functionality - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited version: -/** -* Factory.java -* Purpose: An interface for factorys to implement with basic functionality -* @author igotyou -*/ -public interface IFactory -{ - /** - * Updates the machine - */ - public void update(); - - public void destroy(Location destroyLocation); - - /** - * Powers on the machine - */ - public void powerOn(); - - /** - * Powers off the machine - */ - public void powerOff(); - - /** - * Toggles the current power state and returns interaction response - */ - public List togglePower(); - public List getChestResponse(); - public List getCentralBlockResponse(); - - /** - * Returns the location of the machine - */ - public Location getCenterLocation(); - - public Location getInventoryLocation(); - - public Location getPowerSourceLocation(); - - public void updateRepair(double percent); - - public long getTimeDisrepair(); - - public IFactoryProperties getProperties(); - - public boolean isWhole(boolean initCall); -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java index ca9f58ce..374b9c1d 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java @@ -20,7 +20,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class NetherFactory extends ABaseFactory { @@ -380,7 +380,7 @@ public List getCentralBlockResponse() } @Override - public ItemList getFuel() { + public ItemList getFuel() { return netherFactoryProperties.getFuel(); } @@ -423,25 +423,25 @@ protected void recipeFinished() { } @Override - public ItemList getInputs() { + public ItemList getInputs() { if(mode == NetherOperationMode.REPAIR) { - return new ItemList(); + return new ItemList(); } else { - return new ItemList(); + return new ItemList(); } } @Override - public ItemList getOutputs() { - return new ItemList(); + public ItemList getOutputs() { + return new ItemList(); } @Override - public ItemList getRepairs() { - ItemList repairMaterials = new ItemList(); + public ItemList getRepairs() { + ItemList repairMaterials = new ItemList(); switch(mode) { case REPAIR: repairMaterials.addAll(netherFactoryProperties.getRepairMaterials()); diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java index 0114245b..48aa4000 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java @@ -18,7 +18,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.github.igotyou.FactoryMod.utility.StringUtils; public class PrintingPress extends ABaseFactory { @@ -86,7 +86,7 @@ public int getLockedResultCode() { } @Override - public ItemList getFuel() { + public ItemList getFuel() { return printingPressProperties.getFuel(); } @@ -111,7 +111,7 @@ public double getEnergyTime() { public double getProductionTime() { switch(mode) { case SET_PLATES: - NamedItemStack plates = getPlateResult(); + AdvancedItemStack plates = getPlateResult(); int pageCount = 1; if (plates != null) { pageCount = Math.max(1, ((BookMeta) plates.getItemMeta()).getPageCount()); @@ -129,11 +129,11 @@ public double getProductionTime() { } @Override - public ItemList getInputs() { - ItemList inputs = new ItemList(); + public ItemList getInputs() { + ItemList inputs = new ItemList(); switch(mode) { case SET_PLATES: - NamedItemStack plates = getPlateResult(); + AdvancedItemStack plates = getPlateResult(); if (plates != null) { int pageCount = ((BookMeta) plates.getItemMeta()).getPageCount(); if (pageCount > 0) { @@ -151,11 +151,11 @@ public ItemList getInputs() { } @Override - public ItemList getOutputs() { - ItemList outputs = new ItemList(); + public ItemList getOutputs() { + ItemList outputs = new ItemList(); switch(mode) { case SET_PLATES: - NamedItemStack plates = getPlateResult(); + AdvancedItemStack plates = getPlateResult(); if (plates != null) { outputs.add(plates); } else { @@ -169,8 +169,8 @@ public ItemList getOutputs() { } @Override - public ItemList getRepairs() { - ItemList inputs = new ItemList(); + public ItemList getRepairs() { + ItemList inputs = new ItemList(); switch(mode) { case REPAIR: inputs.addAll(printingPressProperties.getRepairMaterials()); @@ -244,15 +244,15 @@ public void printBooksUpdate() { int finished = processQueue[processQueueOffset]; if (finished > 0) { - NamedItemStack result = printResult.toBook(); - ItemList set = new ItemList(); + AdvancedItemStack result = printResult.toBook(); + ItemList set = new ItemList(); set.add(result); set = set.getMultiple(finished); set.putIn(getInventory()); } // Load materials - ItemList pages = printingPressProperties.getPageMaterials(); + ItemList pages = printingPressProperties.getPageMaterials(); boolean hasPages = pages.allIn(getInventory()); boolean inputStall = false; @@ -263,7 +263,7 @@ public void printBooksUpdate() { // Check bindings int expectedBindings = pageCount == 0 ? containedPaper + printingPressProperties.getPagesPerLot() : (int) Math.floor((double) (containedPaper + printingPressProperties.getPagesPerLot()) / (double) pageCount); boolean hasBindings = true; - ItemList allBindings = new ItemList(); + ItemList allBindings = new ItemList(); if (expectedBindings > containedBindings) { int neededBindings = expectedBindings - containedBindings; allBindings = printingPressProperties.getBindingMaterials().getMultiple(neededBindings); @@ -323,15 +323,15 @@ public void printPamphletsUpdate() { // Output finished results int finished = processQueue[processQueueOffset]; if (finished > 0) { - NamedItemStack result = getPrintResult().toPamphlet(); - ItemList set = new ItemList(); + AdvancedItemStack result = getPrintResult().toPamphlet(); + ItemList set = new ItemList(); set.add(result); set = set.getMultiple(finished); set.putIn(getInventory()); } // Load materials - ItemList pages = printingPressProperties.getPamphletMaterials(); + ItemList pages = printingPressProperties.getPamphletMaterials(); boolean hasPages = pages.allIn(getInventory()); if (hasPages) { pages.removeFrom(getInventory()); @@ -352,22 +352,22 @@ public void printSecurityUpdate() { // Output finished results int finished = processQueue[processQueueOffset]; if (finished > 0) { - NamedItemStack result = getPrintResult().toSecurityNote(); - ItemList set = new ItemList(); + AdvancedItemStack result = getPrintResult().toSecurityNote(); + ItemList set = new ItemList(); set.add(result); set = set.getMultiple(finished); set.putIn(getInventory()); } // Load materials - ItemList pages = printingPressProperties.getPamphletMaterials(); + ItemList pages = printingPressProperties.getPamphletMaterials(); boolean hasPages = pages.allIn(getInventory()); boolean inputStall = false; if (hasPages) { // Check security materials int expectedExtras = (int) Math.ceil((double) containedPaper + printingPressProperties.getPamphletsPerLot()); boolean hasExtras = true; - ItemList allSecurityMaterials = new ItemList(); + ItemList allSecurityMaterials = new ItemList(); if (expectedExtras > containedSecurityMaterials) { int neededExtras = expectedExtras - containedSecurityMaterials; int neededExtraLots = (int) Math.ceil((double) neededExtras / (double) printingPressProperties.getSecurityNotesPerLot()); @@ -476,7 +476,7 @@ public List getChestResponse() responses.add(new InteractionResponse(InteractionResult.SUCCESS, mode.getDescription())); // Never call the same function more than once, especially when this complex. - ItemList getInputs = getInputs(); + ItemList getInputs = getInputs(); //[Inputs: amount Name, amount Name.] if(getInputs != null && !getInputs.isEmpty()) { responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs.toString()+".")); @@ -485,7 +485,7 @@ public List getChestResponse() } //[Outputs: amount Name, amount Name.] - ItemList getOutputs = getOutputs(); + ItemList getOutputs = getOutputs(); if(getOutputs != null && !getOutputs.isEmpty()) { responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs.toString()+".")); } else { @@ -493,7 +493,7 @@ public List getChestResponse() } //[Will repair XX% of the factory] - ItemList getRepairs = getRepairs(); + ItemList getRepairs = getRepairs(); if(getRepairs != null && !getRepairs.isEmpty() && maintenanceActive) { int amountAvailable = getRepairs.amountAvailable(getInventory()); int amountRepaired = amountAvailable > currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; @@ -599,10 +599,10 @@ private int getBookInventoryPages() { * uniquely reflects the book given as input. This plate can then be used to produce * copies of the book, security notes, pamphlets, and the like. * - * @return {@link NamedItemStack} of a Signed Book with lore containing the contents of + * @return {@link AdvancedItemStack} of a Signed Book with lore containing the contents of * the given input book, and other important metadata. */ - private NamedItemStack getPlateResult() { + private AdvancedItemStack getPlateResult() { for (ItemStack stack : getInventory().getContents()) { if (stack == null) { continue; @@ -631,7 +631,7 @@ private NamedItemStack getPlateResult() { log.finer("getPlateResult(): Book found has no pages; adding blank."); } - NamedItemStack plates = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); + AdvancedItemStack plates = new AdvancedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); BookMeta plateMeta = (BookMeta) plates.getItemMeta(); plateMeta.setTitle(title); plateMeta.setAuthor(author); @@ -739,8 +739,8 @@ public int pageCount() { return pages.size(); } - public NamedItemStack toBook() { - NamedItemStack book = new NamedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "book"); + public AdvancedItemStack toBook() { + AdvancedItemStack book = new AdvancedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "book"); BookMeta meta = (BookMeta) book.getItemMeta(); meta.setTitle(title); meta.setAuthor(author); @@ -749,8 +749,8 @@ public NamedItemStack toBook() { return book; } - public NamedItemStack toPamphlet() { - NamedItemStack book = new NamedItemStack(Material.PAPER, 1, (short) 0, "pamphlet"); + public AdvancedItemStack toPamphlet() { + AdvancedItemStack book = new AdvancedItemStack(Material.PAPER, 1, (short) 0, "pamphlet"); ItemMeta meta = book.getItemMeta(); meta.setDisplayName(title); List lore = new ArrayList(); @@ -762,8 +762,8 @@ public NamedItemStack toPamphlet() { return book; } - public NamedItemStack toSecurityNote() { - NamedItemStack book = new NamedItemStack(Material.PAPER, 1, (short) 0, "note"); + public AdvancedItemStack toSecurityNote() { + AdvancedItemStack book = new AdvancedItemStack(Material.PAPER, 1, (short) 0, "note"); ItemMeta meta = book.getItemMeta(); meta.setDisplayName(title); List lore = new ArrayList(); diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java index 1388c984..88fe9e93 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java @@ -15,7 +15,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class ProductionFactory extends ABaseFactory { @@ -115,7 +115,7 @@ public List getCentralBlockResponse() } @Override - public ItemList getFuel() { + public ItemList getFuel() { return productionFactoryProperties.getFuel(); } @@ -252,17 +252,17 @@ protected void recipeFinished() { } @Override - public ItemList getInputs() { + public ItemList getInputs() { return currentRecipe.getInputs(); } @Override - public ItemList getOutputs() { + public ItemList getOutputs() { return currentRecipe.getOutputs(); } @Override - public ItemList getRepairs() { + public ItemList getRepairs() { return currentRecipe.getRepairs(); } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java index aeccd8e8..6d2a3c41 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java @@ -14,7 +14,7 @@ import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class RepairFactory extends ABaseFactory{ @@ -49,7 +49,7 @@ public boolean isRepairing() { } @Override - public ItemList getFuel() { + public ItemList getFuel() { return rfp.getFuel(); } @@ -125,8 +125,8 @@ public List togglePower(){ //[Requires the following: Amount Name, Amount Name.] //[Requires one of the following: Amount Name, Amount Name.] - ItemList needAll=new ItemList(); - ItemList allInputs = null; + ItemList needAll=new ItemList(); + ItemList allInputs = null; if (mode.equals(RepairFactoryMode.REPAIR)){ allInputs = rfp.getRepairMaterials(); @@ -178,25 +178,25 @@ public double getProductionTime() { } @Override - public ItemList getInputs() { + public ItemList getInputs() { if (mode.equals(RepairFactoryMode.RESET_ITEMS)) { return rfp.getRecipeMaterials(); } else { - return new ItemList(); + return new ItemList(); } } @Override - public ItemList getOutputs() { - return new ItemList(); + public ItemList getOutputs() { + return new ItemList(); } @Override - public ItemList getRepairs() { + public ItemList getRepairs() { if (mode.equals( RepairFactoryMode.REPAIR)) { return rfp.getRepairMaterials(); } else { - return new ItemList(); + return new ItemList(); } } diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java new file mode 100644 index 00000000..6adf95d9 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -0,0 +1,228 @@ +package com.github.igotyou.FactoryMod.classicTriblockFactory; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Chest; +import org.bukkit.block.Furnace; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.Contraption; +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; + +//original file: +/** + * MachineObject.java + * Purpose: Basic object base for machines to extend + * + * @author MrTwiggy + * @version 0.1 1/14/13 + */ +//edited version: +/** + * FactoryObject.java Purpose basic object base for factories to extend + * + * @author igotyou + * + */ +public abstract class FurnCraftChestFactory extends Contraption { + + protected Location factoryInventoryLocation; + protected Location factoryPowerSourceLocation; + protected boolean active; + protected Inventory factoryInventory; + protected Inventory factoryPowerInventory; + protected int currentProductionTimer = 0; + + /** + * Constructor + */ + public FurnCraftChestFactory(Location factoryLocation, + Location factoryInventoryLocation, Location factoryPowerSource, + IInteractionManager im, IRepairManager rm) { + super(factoryLocation, im, rm); + this.factoryInventoryLocation = factoryInventoryLocation; + this.factoryPowerSourceLocation = factoryPowerSource; + this.active = false; + } + + /** + * Returns the factory Inventory(normally a chest), updates the inventory + * variable aswell. + */ + public Inventory getInventory() { + Chest chestBlock = (Chest) factoryInventoryLocation.getBlock() + .getState(); + factoryInventory = chestBlock.getInventory(); + return factoryInventory; + } + + /** + * Returns the power Source inventory, updates it aswell. + */ + public Inventory getPowerSourceInventory() { + if (!(factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation + .getBlock().getType() == Material.BURNING_FURNACE)) { + return null; + } + Furnace furnaceBlock = (Furnace) factoryPowerSourceLocation.getBlock() + .getState(); + factoryPowerInventory = furnaceBlock.getInventory(); + return factoryPowerInventory; + } + + /** + * Checks whether enough space for the output is available in the chest + * + * @return true if enough space is available, false if not + */ + public boolean checkSpaceForOutput() { + // TODO + return true; + } + + /** + * Turns the factory on + */ + public void activate() { + active = true; + // lots of code to make the furnace light up, without loosing contents. + Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock() + .getState(); + byte data = furnace.getData().getData(); + ItemStack[] oldContents = furnace.getInventory().getContents(); + furnace.getInventory().clear(); + factoryPowerSourceLocation.getBlock().setType(Material.BURNING_FURNACE); + furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); + furnace.setRawData(data); + furnace.update(); + furnace.setBurnTime(Short.MAX_VALUE); + furnace.getInventory().setContents(oldContents); + // reset the production timer + currentProductionTimer = 0; + } + + + /** + * Turns the factory off. + */ + public void deactivate() { + if (active) { + // lots of code to make the furnace turn off, without loosing + // contents. + Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock() + .getState(); + byte data = furnace.getData().getData(); + ItemStack[] oldContents = furnace.getInventory().getContents(); + furnace.getInventory().clear(); + factoryPowerSourceLocation.getBlock().setType(Material.FURNACE); + furnace = (Furnace) factoryPowerSourceLocation.getBlock() + .getState(); + furnace.setRawData(data); + furnace.update(); + furnace.getInventory().setContents(oldContents); + + // put active to false + active = false; + // reset the production timer + currentProductionTimer = 0; + } + } + + /** + * Returns the energy timer + */ + public int getEnergyTimer() { + return currentEnergyTimer; + } + + /** + * @return Whether the factory is currently on or not + */ + public boolean getActive() { + return active; + } + + /** + * @return How long the factory has been running in ticks + */ + public int getRunningTime() { + return currentProductionTimer; + } + + /** + * @return How long since energy was consumed the last time in ticks + */ + public int getLastEnergyConsumptionTime() { + return currentEnergyTimer; + } + + /** + * returns true if all factory blocks are occupied with the correct blocks + */ + public boolean isWhole() { + return (factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation + .getBlock().getType() == Material.BURNING_FURNACE) + && (factoryInventoryLocation.getBlock().getType() == Material.CHEST) + && (physicalLocation.getBlock().getType() == Material.WORKBENCH); + } + + /** + * called by the manager each update cycle + */ + public void update() { + // if factory is turned on + if (active) { + // if the materials required to produce the current recipe are in + // the factory inventory + if (checkHasMaterials()) { + // if the factory has been working for less than the required + // time for the recipe + if (currentProductionTimer < getProductionTime()) { + // if the factory power source inventory has enough fuel for + // at least 1 energyCycle + if (isFuelAvailable()) { + // if the time since fuel was last consumed is equal to + // how often fuel needs to be consumed + if (currentEnergyTimer == getEnergyTime() - 1) { + // remove one fuel. + getFuel().removeFrom(getPowerSourceInventory()); + // 0 seconds since last fuel consumption + currentEnergyTimer = 0; + fuelConsumed(); + } + // if we don't need to consume fuel, just increment the + // energy timer + else { + currentEnergyTimer++; + } + // increment the production timer + currentProductionTimer++; + postUpdate(); + } + // if there is no fuel Available turn off the factory + else { + powerOff(); + } + } + + // if the production timer has reached the recipes production + // time remove input from chest, and add output material + else if (currentProductionTimer >= getProductionTime()) { + consumeInputs(); + produceOutputs(); + // Repairs the factory + repair(getRepairs().removeMaxFrom(getInventory(), + (int) currentRepair)); + recipeFinished(); + + currentProductionTimer = 0; + powerOff(); + } + } else { + powerOff(); + } + } + } +} diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java new file mode 100644 index 00000000..440a0389 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -0,0 +1,13 @@ +package com.github.igotyou.FactoryMod.interactionManager; + +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +public interface IInteractionManager { + public void rightClick(Player p, Block b); + + public void leftClick(Player p, Block b); + + public void blockBreak(Player p, Block b); + +} diff --git a/src/com/github/igotyou/FactoryMod/managers/AManager.java b/src/com/github/igotyou/FactoryMod/managers/AManager.java deleted file mode 100644 index cda4b9ea..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/AManager.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.persistence.FactoryDao; -import com.github.igotyou.FactoryMod.persistence.PersistenceFactory; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.StringUtils; - -public abstract class AManager implements IManager{ - - protected FactoryModPlugin plugin; - ArrayList factories = new ArrayList(); - - protected FactoryDao mDao; - protected long repairTime; - protected boolean isLogging = true; - - public AManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - //mSaveFile = new File(plugin.getDataFolder(), "productionSaves.txt"); - updateFactorys(); - mDao = PersistenceFactory.getFactoryDao(this); - } - - public String getFactoryName(){ - return getFactoryType().getName(); - //return this.getClass().getName().replace("Manager", ""); - } - - @Override - public FactoryModPlugin getPlugin() { - return plugin; - } - - - @Override - public void updateFactorys() - { - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() - { - @Override - public void run() - { - for (T factory: factories) - { - factory.update(); - } - } - }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); - } - - public void save() - { - //Takes difference between last repair update and current one and scales repair accordingly - updateRepair(System.currentTimeMillis() - repairTime); - repairTime = System.currentTimeMillis(); - - mDao.writeFactories(factories); - } - - public void load() - { - isLogging = false; - repairTime = System.currentTimeMillis(); - for(T press : mDao.readFactories()) { - addFactory(press); - } - isLogging = true; - } - public void updateRepair(long time) - { - for (T factory : factories) - { - factory.updateRepair(time / ((double)FactoryModPlugin.REPAIR_PERIOD)); - } - long currentTime = System.currentTimeMillis(); - Iterator itr = factories.iterator(); - while(itr.hasNext()) - { - T factory = itr.next(); - if(currentTime > (factory.getTimeDisrepair() + FactoryModPlugin.DISREPAIR_PERIOD)) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder(getFactoryName()+" removed due to disrepair: ") - .append(factory.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(factory.getCenterLocation())) - .toString()); - - itr.remove(); - } - } - } - - @Override - public InteractionResponse addFactory(T factory) - { - if (isClear(factory)) - { - factories.add(factory); - if (isLogging) { FactoryModPlugin.sendConsoleMessage(getFactoryName()+" created: " + factory.getProperties().getName()); } - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - FactoryModPlugin.sendConsoleMessage(getFactoryName()+" failed to create: " + factory.getProperties().getName()); - return new InteractionResponse(InteractionResult.FAILURE, ""); - } - } - - @Override - public boolean factoryExistsAt(Location factoryLocation) - { - return getFactory(factoryLocation) != null; - } - - @Override - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - @Override - public void removeFactory(T factory) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder(getFactoryName() +" removed: ") - .append(factory.getProperties().getName()) - .append(" at ") - .append(StringUtils.formatCoords(factory.getCenterLocation())) - .toString()); - - factories.remove(factory); - - } -} diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index a661f26c..b9b278ec 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -5,15 +5,16 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.Compactor; import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -public class CompactorManager extends AManager { +public class CompactorManager extends FactoryModManager { public CompactorManager(FactoryModPlugin plugin) { super(plugin); @@ -28,7 +29,7 @@ public InteractionResponse createFactory(Location factoryLocation, Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); - ItemList inputs = compactorProperties.getConstructionMaterials(); + ItemList inputs = compactorProperties.getConstructionMaterials(); if (inputs.exactlyIn(chestInventory)) { Compactor production = new Compactor(factoryLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties()); diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java index 4d0b8c9e..82dfee46 100644 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java +++ b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java @@ -8,6 +8,7 @@ import org.bukkit.Location; import org.bukkit.event.Listener; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; import com.github.igotyou.FactoryMod.Factorys.IFactory; @@ -32,7 +33,7 @@ public class FactoryManagerService { List listeners; - List> managers; + List> managers; /** * The plugin instance @@ -62,7 +63,7 @@ public FactoryManagerService(FactoryModPlugin plugin) */ private void initializeManagers() { - managers = new ArrayList>(); + managers = new ArrayList>(); listeners = new ArrayList(); managers.add(new ProductionFactoryManager(plugin)); diff --git a/src/com/github/igotyou/FactoryMod/managers/IManager.java b/src/com/github/igotyou/FactoryMod/managers/IManager.java deleted file mode 100644 index 4670a831..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/IManager.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ -public interface IManager -{ - - public Class getFactoryType(); - - /** - * @return the plugin instance - */ - public FactoryModPlugin getPlugin(); - -/** -* Saves the machine objects list of this manager to file -*/ - public void save(); - -/** -* Loads machine objects list of this manager from file -*/ - public void load(); - -/** -* Updates all the machines from this manager's machine object list -*/ - public void updateFactorys(); - -/** -* Attempts to create a new machine for this manager -*/ - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerLocation); - -/** -* Creates a machine from an existing machine data object -*/ - public InteractionResponse addFactory(T factory); - -/** -* Returns the machine (if any exists) at the given location from this manager -*/ - public T getFactory(Location factoryLocation); - -/** -* Returns whether a machine exists at the given location -*/ - public boolean factoryExistsAt(Location factoryLocation); - -/** -* Returns whether a machine is whole at the given location -*/ - public boolean factoryWholeAt(Location factoryLocation); - -/** -* Removes the given machine from the object list -*/ - public void removeFactory(T factory); - - - public boolean isClear(T factory); - -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java deleted file mode 100644 index 21585b02..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ - -public class NetherFactoryManager extends AManager -{ - private ReinforcementManager rm = Citadel.getReinforcementManager(); - //private List netherFactorys; - - public NetherFactoryManager(FactoryModPlugin plugin) - { - super(plugin); - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) - { - NetherFactoryProperties netherFactoryProperties = plugin.getNetherFactoryProperties(); - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList constructionMaterials = netherFactoryProperties.getConstructionMaterials(); - if(constructionMaterials.oneIn(chestInventory)) - { - if (factoryLocation.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.WORLD_NAME)) - { - if (factoryLocation.getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL)) - { - if (!factoryExistsAt(factoryLocation)) - { - double scalingFactor = getScalingFactor(factoryLocation); - if (scalingFactor < 500) - { - constructionMaterials = constructionMaterials.getMultiple(scalingFactor); - boolean hasMaterials = constructionMaterials.allIn(chestInventory); - if (hasMaterials) - { - boolean markerFound = false; - Location markerLocation = factoryLocation.clone(); - int blockY = markerLocation.getBlockY(); - for (int centerY = blockY - FactoryModPlugin.NETHER_MARKER_MAX_DISTANCE; centerY <= blockY + FactoryModPlugin.NETHER_MARKER_MAX_DISTANCE && !markerFound; centerY++) - { - markerLocation.setY(centerY); - Location oneUp = markerLocation.clone(); - oneUp.setY(centerY+1); - if (markerLocation.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_MARKER_MATERIAL && oneUp.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - markerFound = true; - } - } - if (markerFound) - { - int nether_scale = FactoryModPlugin.NETHER_SCALE; - boolean locationOk = false; - int startX = Math.round(factoryLocation.getBlockX()/nether_scale); - int startY = factoryLocation.getBlockY(); - int startZ = Math.round(factoryLocation.getBlockZ()/nether_scale); - Location netherLocation = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY,startZ); - Location netherLocation1 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+1,startZ); - Location netherLocation2 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+2,startZ); - Location netherLocation3 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), startX,startY+3,startZ); - if (FactoryModPlugin.CITADEL_ENABLED && (rm.isReinforced(netherLocation) || rm.isReinforced(netherLocation1) || rm.isReinforced(netherLocation2) || rm.isReinforced(netherLocation3))) - { - for(int scanX = startX-1; scanX <= startX+1 && !locationOk; scanX++) - { - - for(int scanZ = startZ-1; scanZ <= startZ+1 && !locationOk; scanZ++) - { - for(int scanY = startY; scanY <= 250 && !locationOk; scanY++) - { - netherLocation = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY,scanZ); - netherLocation1 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+1,scanZ); - netherLocation2 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+2,scanZ); - netherLocation3 = new Location(Bukkit.getWorld(FactoryModPlugin.NETHER_NAME), scanX,scanY+3,scanZ); - if(!rm.isReinforced(netherLocation) && !rm.isReinforced(netherLocation1) && !rm.isReinforced(netherLocation2) && !rm.isReinforced(netherLocation3)) - { - locationOk = true; - - } - } - } - } - } - if (!factoryExistsAt(netherLocation)) - { - netherLocation.getBlock().setType(FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL); - netherLocation.getBlock().getState().update(true); - netherLocation1.getBlock().setType(Material.AIR); - netherLocation1.getBlock().getState().update(true); - netherLocation2.getBlock().setType(Material.AIR); - netherLocation2.getBlock().getState().update(true); - netherLocation3.getBlock().setType(Material.AIR); - netherLocation3.getBlock().getState().update(true); - if(netherLocation.getBlock().getType() != (FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) && - netherLocation1.getBlock().getType() != Material.AIR && - netherLocation2.getBlock().getType() != Material.AIR && - netherLocation3.getBlock().getType() != Material.AIR) - { - return new InteractionResponse(InteractionResult.FAILURE, "For some reason the nether side obsidian block did not generate...blame bukkit"); - } - Location oneUp = markerLocation.clone(); - oneUp.add(0,1,0); - NetherFactory netherFactory = new NetherFactory(factoryLocation, inventoryLocation, powerSourceLocation, netherLocation, oneUp, plugin.getNetherFactoryProperties()); - if (constructionMaterials.removeFrom(netherFactory.getInventory())) - { - addFactory(netherFactory); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + netherFactoryProperties.getName()); - } - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, "There is a other " + netherFactoryProperties.getName() + " too close."); - } - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, "No marker found. Place a " + FactoryModPlugin.NETHER_FACTORY_MARKER_MATERIAL + " 1-20 blocks above the center block of the nether factory with a " + FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL + " right above."); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest! You need " + constructionMaterials.toString()); - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, "Factory is too close to a other nether factory!"); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + netherFactoryProperties.getName() + " there!"); - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, "Wrong center block!"); - } - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, netherFactoryProperties.getName() + "'s can only be built in the overworld"); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "No factory was identified!"); - } - - public boolean isClear(NetherFactory factory){ - return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && - (!factoryExistsAt(factory.getCenterLocation()) - || !factoryExistsAt(factory.getInventoryLocation()) - || !factoryExistsAt(factory.getPowerSourceLocation()) - || !factoryExistsAt(factory.getNetherTeleportPlatform()) - || !factoryExistsAt(factory.getOverworldTeleportPlatform()) ); - } - - @Override - public NetherFactory getFactory(Location factoryLocation) - { - for (NetherFactory factory : factories) - { - if (factory.getCenterLocation().equals(factoryLocation) - || factory.getInventoryLocation().equals(factoryLocation) - || factory.getPowerSourceLocation().equals(factoryLocation) - || factory.getNetherTeleportPlatform().equals(factoryLocation) - || factory.getOverworldTeleportPlatform().equals(factoryLocation)) - return factory; - } - return null; - } - - public double getScalingFactor(Location location) - { - double scalingFactor = 1; - NetherFactoryProperties properties = plugin.getNetherFactoryProperties(); - for (NetherFactory factory : factories) - { - Location factoryLoc = factory.getCenterLocation(); - if(factory.getCenterLocation().equals(location)) - { - continue; - } - //the distance function uses square root, which is quite expensive, let's check if it's even realistic that it's within range first. - if ((location.getBlockX()-factoryLoc.getBlockX()) < properties.getScalingRadius() || (location.getBlockX()-factoryLoc.getBlockX()) > -(properties.getScalingRadius())) - { - if ((location.getBlockZ()-factoryLoc.getBlockZ()) < properties.getScalingRadius() || (location.getBlockZ()-factoryLoc.getBlockZ()) > -(properties.getScalingRadius())) - { - double distance = location.distance(factoryLoc); - if (distance <= properties.getScalingRadius()) - { - scalingFactor = scalingFactor * ( Math.exp(1/(distance/properties.getCostScalingRadius())) - Math.exp(1.0) + 1.0 ); - } - } - } - } - return scalingFactor; - } - - @Override - public Class getFactoryType() { - return NetherFactory.class; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index ba60eb0a..01049273 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -5,13 +5,14 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.PrintingPress; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; //original file: /** @@ -29,7 +30,7 @@ * */ -public class PrintingPressManager extends AManager +public class PrintingPressManager extends FactoryModManager { //private List presses; @@ -48,7 +49,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); - ItemList inputs = printingPressProperties.getConstructionMaterials(); + ItemList inputs = printingPressProperties.getConstructionMaterials(); boolean hasMaterials = inputs.allIn(chestInventory); if (hasMaterials) { diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java index 28cb3bd7..fd1ab670 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java @@ -8,13 +8,14 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; //original file: /** @@ -32,7 +33,7 @@ * */ -public class ProductionFactoryManager extends AManager +public class ProductionFactoryManager extends FactoryModManager { @Override public Class getFactoryType() { @@ -57,7 +58,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve String subFactoryType = null; for (Map.Entry entry : properties.entrySet()) { - ItemList inputs = entry.getValue().getInputs(); + ItemList inputs = entry.getValue().getInputs(); if(inputs.exactlyIn(chestInventory)) { subFactoryType = entry.getKey(); @@ -90,7 +91,7 @@ public InteractionResponse createFactory(Location factoryLocation, Location inve boolean hasMaterials = true; for (Map.Entry entry : properties.entrySet()) { - ItemList inputs = entry.getValue().getInputs(); + ItemList inputs = entry.getValue().getInputs(); if(!inputs.allIn(chestInventory)) { hasMaterials = false; diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 44ba07ab..003d1cf5 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -5,15 +5,16 @@ import org.bukkit.block.Chest; import org.bukkit.inventory.Inventory; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.RepairFactory; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; -public class RepairFactoryManager extends AManager{ +public class RepairFactoryManager extends FactoryModManager{ public RepairFactoryManager(FactoryModPlugin plugin) { super(plugin); @@ -34,7 +35,7 @@ public InteractionResponse createFactory(Location factoryLocation, Block inventoryBlock = inventoryLocation.getBlock(); Chest chest = (Chest) inventoryBlock.getState(); Inventory chestInventory = chest.getInventory(); - ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); + ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); if (constructionMaterials.exactlyIn(chestInventory)){ RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties); diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java new file mode 100644 index 00000000..35ffe6f9 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -0,0 +1,93 @@ +package com.github.igotyou.FactoryMod.multiBlockStructures; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; + +public class FurnCraftChestStructure extends MultiBlockStructure { + public boolean isComplete(Block center) { + if (center.getType() == Material.WORKBENCH) { + for (Block b : searchForBlockOnSides(center, Material.CHEST)) { + switch (center.getFace(b)) { + case SOUTH: + if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { + return true; + } + case NORTH: + if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { + return true; + } + case WEST: + if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { + return true; + } + case EAST: + if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { + return true; + } + } + + } + } + + return false; + } + + public Block getInventoryBlock(Block center) { + if (center.getType() == Material.WORKBENCH) { + for (Block b : searchForBlockOnSides(center, Material.CHEST)) { + switch (center.getFace(b)) { + case SOUTH: + if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { + return b; + } + case NORTH: + if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { + return b; + } + case WEST: + if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { + return b; + } + case EAST: + if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { + return b; + } + } + + } + } + + return null; + } + + + public Block getFurnace(Block center) { + if (center.getType() == Material.WORKBENCH) { + for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { + switch (center.getFace(b)) { + case SOUTH: + if (center.getRelative(BlockFace.NORTH).getType() == Material.CHEST) { + return b; + } + case NORTH: + if (center.getRelative(BlockFace.SOUTH).getType() == Material.CHEST) { + return b; + } + case WEST: + if (center.getRelative(BlockFace.EAST).getType() == Material.CHEST) { + return b; + } + case EAST: + if (center.getRelative(BlockFace.WEST).getType() == Material.CHEST) { + return b; + } + } + + } + } + + return null; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java new file mode 100644 index 00000000..1b3df0f4 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -0,0 +1,42 @@ +package com.github.igotyou.FactoryMod.multiBlockStructures; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; + +public abstract class MultiBlockStructure { + private static LinkedList allBlockSides; + private static LinkedList northEastWestSouthSides; + + public static void initiliazeBlockSides() { + northEastWestSouthSides = new LinkedList(); + northEastWestSouthSides.add(BlockFace.EAST); + northEastWestSouthSides.add(BlockFace.NORTH); + northEastWestSouthSides.add(BlockFace.SOUTH); + northEastWestSouthSides.add(BlockFace.WEST); + allBlockSides = new LinkedList(northEastWestSouthSides); + allBlockSides.add(BlockFace.DOWN); + allBlockSides.add(BlockFace.UP); + + } + + protected static List searchForBlockOnSides(Block b, Material m) { + LinkedList result = new LinkedList(); + for(BlockFace face:northEastWestSouthSides) { + Block side = b.getRelative(face); + if (side.getType() == m) { + result.add(side); + } + } + return result; + } + + public abstract boolean isComplete(Block center); + + public abstract Block getInventoryBlock(Block center); + + +} diff --git a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java new file mode 100644 index 00000000..b5d79a63 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java @@ -0,0 +1,14 @@ +package com.github.igotyou.FactoryMod.powerManager; + +public interface IPowerManager { + public void consumeFuel(); + + public boolean powerAvailable(); + + public boolean fuelAvailable(); + + public int getPowerConsumptionIntervall(); + + public int getTimeInCurrentPowerIntervall(); + +} diff --git a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java index 2b572454..e1ec0a55 100644 --- a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java @@ -9,15 +9,15 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class CompactorProperties extends AFactoryProperties{ - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private ItemList recipeMaterials; - private ItemList specificExclusions; + private ItemList constructionMaterials; + private ItemList fuel; + private ItemList repairMaterials; + private ItemList recipeMaterials; + private ItemList specificExclusions; private List generalExlusions; private int energyTime; private int repair; @@ -27,11 +27,11 @@ public class CompactorProperties extends AFactoryProperties{ private boolean continuous; - public CompactorProperties(ItemList constructionMaterials, - ItemList fuel, ItemList repairMaterials, - ItemList recipeMaterials, int energyTime, int repair, + public CompactorProperties(ItemList constructionMaterials, + ItemList fuel, ItemList repairMaterials, + ItemList recipeMaterials, int energyTime, int repair, String name, double repairTime, double productionTime, String compactLore, - boolean continuous, ItemList specificExclusion, List generalExclusion) { + boolean continuous, ItemList specificExclusion, List generalExclusion) { this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -47,23 +47,23 @@ public CompactorProperties(ItemList constructionMaterials, this.generalExlusions = generalExclusion; } - public ItemList getConstructionMaterials() { + public ItemList getConstructionMaterials() { return constructionMaterials; } - public ItemList getFuel() { + public ItemList getFuel() { return fuel; } - public ItemList getRepairMaterials() { + public ItemList getRepairMaterials() { return repairMaterials; } - public ItemList getRecipeMaterials() { + public ItemList getRecipeMaterials() { return recipeMaterials; } - public ItemList getSpecificExclusions() { + public ItemList getSpecificExclusions() { return specificExclusions; } @@ -96,17 +96,17 @@ public boolean getContinuous() { } public static CompactorProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection config) { - ItemList cFuel = plugin.getItems(config.getConfigurationSection("fuel")); + ItemList cFuel = plugin.getItems(config.getConfigurationSection("fuel")); if(cFuel.isEmpty()) { - cFuel = new ItemList(); - cFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short)1, "Charcoal")); + cFuel = new ItemList(); + cFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"), 1, (short)1, "Charcoal")); } ConfigurationSection costs = config.getConfigurationSection("costs"); - ItemList constructionCost = plugin.getItems(costs.getConfigurationSection("construction")); - ItemList repairCost = plugin.getItems(costs.getConfigurationSection("repair")); - ItemList recipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); - ItemList specificExclusion = plugin.getItems(config.getConfigurationSection("specific_exclusions")); - ItemList generalExclusion = plugin.getItems(config.getConfigurationSection("excluded_types")); + ItemList constructionCost = plugin.getItems(costs.getConfigurationSection("construction")); + ItemList repairCost = plugin.getItems(costs.getConfigurationSection("repair")); + ItemList recipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + ItemList specificExclusion = plugin.getItems(config.getConfigurationSection("specific_exclusions")); + ItemList generalExclusion = plugin.getItems(config.getConfigurationSection("excluded_types")); int energyTime = config.getInt("fuel_time"); int repair = costs.getInt("repair_multiple", 1); String name = config.getString("name", "Compactor"); @@ -114,11 +114,11 @@ public static CompactorProperties fromConfig(FactoryModPlugin plugin, Configurat int productionTime = config.getInt("production_time"); String compactLore = config.getString("compact_lore", "Compacted Item"); boolean continuous = config.getBoolean("continuous", false); - Iterator genExcludeIter = generalExclusion.iterator(); + Iterator genExcludeIter = generalExclusion.iterator(); List generalExclude = new ArrayList(); while (genExcludeIter.hasNext()) { - NamedItemStack exclude = genExcludeIter.next(); + AdvancedItemStack exclude = genExcludeIter.next(); generalExclude.add(exclude.getType()); } diff --git a/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java deleted file mode 100644 index 2d7708ed..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - - -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - - -public class NetherFactoryProperties extends AFactoryProperties -{ - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private int energyTime; - private int repair; - private double repairTime; - private int scalingMode; - private int scalingRadius; - private int costScalingRadius; - private boolean useFuelOnTeleport; - - public NetherFactoryProperties(ItemList constructionMaterials, ItemList fuel, ItemList repairMaterials, - int energyTime, String name,int repair, double repairTime, int scalingRadius, boolean useFuelOnTeleport, int costScalingRadius) - { - this.constructionMaterials = constructionMaterials; - this.fuel = fuel; - this.repairMaterials = repairMaterials; - this.energyTime = energyTime; - this.name = name; - this.repair=repair; - this.repairTime=repairTime; - this.scalingRadius = scalingRadius; - this.costScalingRadius = costScalingRadius; - this.useFuelOnTeleport = useFuelOnTeleport; - } - - public int getRepair() - { - return repair; - } - - public int getScalingRadius() - { - return scalingRadius; - } - - public int getCostScalingRadius() - { - return costScalingRadius; - } - - //0 == no scaling, 1==linear scaling, 2==exponential scaling - public int getScalingMode() - { - return scalingMode; - } - - public ItemList getConstructionMaterials() - { - return constructionMaterials; - } - - public ItemList getFuel() - { - return fuel; - } - - public ItemList getRepairMaterials() - { - return repairMaterials; - } - - public int getEnergyTime() - { - return energyTime; - } - - - public static NetherFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection configNetherFactory) - { - ItemList nfFuel=plugin.getItems(configNetherFactory.getConfigurationSection("fuel")); - if(nfFuel.isEmpty()) - { - nfFuel=new ItemList(); - nfFuel.add(new NamedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); - } - ConfigurationSection costs = configNetherFactory.getConfigurationSection("costs"); - ItemList nfConstructionCost=plugin.getItems(costs.getConfigurationSection("construction")); - ItemList nfRepairCost=plugin.getItems(costs.getConfigurationSection("repair")); - int nfEnergyTime = configNetherFactory.getInt("fuel_time", 10); - int nfRepair = costs.getInt("repair_multiple",1); - String nfName = configNetherFactory.getString("name", "Nether Factory"); - int repairTime = configNetherFactory.getInt("repair_time",12); - int nfScalingRadius = configNetherFactory.getInt("scaling_radius", 5000); - int costScalingRadius = configNetherFactory.getInt("scaling_radius", 5000); - boolean nfUseFuelOnTeleport = configNetherFactory.getBoolean("use_fuel_on_teleport", false); - return new NetherFactoryProperties(nfConstructionCost, nfFuel, nfRepairCost, nfEnergyTime, nfName, nfRepair, repairTime, nfScalingRadius,nfUseFuelOnTeleport, costScalingRadius); - - } - - public double getRepairTime() - { - return repairTime; - } - - public boolean getUseFuelOnTeleport() - { - return useFuelOnTeleport; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java index 4e738f1e..0a9804db 100644 --- a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java @@ -5,23 +5,23 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class PrintingPressProperties extends AFactoryProperties{ - private ItemList fuel; - private ItemList constructionMaterials; - private ItemList plateMaterials; - private ItemList bindingMaterials; - private ItemList pageMaterials; + private ItemList fuel; + private ItemList constructionMaterials; + private ItemList plateMaterials; + private ItemList bindingMaterials; + private ItemList pageMaterials; private int pagesPerLot; - private ItemList pamphletMaterials; + private ItemList pamphletMaterials; private int pamphletsPerLot; - private ItemList securityMaterials; + private ItemList securityMaterials; private int securityNotesPerLot; private int energyTime; private int maxRepair; - private ItemList repairMaterials; + private ItemList repairMaterials; private int pageLead; private int setPlateTime; private int repairTime; @@ -34,16 +34,16 @@ public int getPageLead() { public PrintingPressProperties( - ItemList fuel, - ItemList constructionMaterials, - ItemList repairMaterials, - ItemList plateMaterials, - ItemList bindingMaterials, - ItemList pageMaterials, + ItemList fuel, + ItemList constructionMaterials, + ItemList repairMaterials, + ItemList plateMaterials, + ItemList bindingMaterials, + ItemList pageMaterials, int pagesPerLot, - ItemList pamphletMaterials, + ItemList pamphletMaterials, int pamphletsPerLot, - ItemList securityMaterials, + ItemList securityMaterials, int securityNotesPerLot, int energyTime, String name, int repair, int paperRate, int pageLead, int setPlateTime, int repairTime, int bookPagesCap @@ -80,45 +80,45 @@ public int getRepairTime() { } - public ItemList getBindingMaterials() { + public ItemList getBindingMaterials() { return bindingMaterials; } - public ItemList getPageMaterials() { + public ItemList getPageMaterials() { return pageMaterials; } - public ItemList getSecurityMaterials() { + public ItemList getSecurityMaterials() { return securityMaterials; } - public ItemList getRepairMaterials() { + public ItemList getRepairMaterials() { return repairMaterials; } - public ItemList getPlateMaterials() { + public ItemList getPlateMaterials() { return plateMaterials; } public static PrintingPressProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection configPrintingPresses) { - ItemList ppFuel=plugin.getItems(configPrintingPresses.getConfigurationSection("fuel")); + ItemList ppFuel=plugin.getItems(configPrintingPresses.getConfigurationSection("fuel")); if(ppFuel.isEmpty()) { - ppFuel=new ItemList(); - ppFuel.add(new NamedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); + ppFuel=new ItemList(); + ppFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); } ConfigurationSection costs = configPrintingPresses.getConfigurationSection("costs"); - ItemList ppConstructionCost=plugin.getItems(costs.getConfigurationSection("construction")); - ItemList ppRepairCost=plugin.getItems(costs.getConfigurationSection("repair")); - ItemList ppPlateCost=plugin.getItems(costs.getConfigurationSection("plates")); - ItemList ppBindingCost=plugin.getItems(costs.getConfigurationSection("binding")); - ItemList ppPageCost=plugin.getItems(costs.getConfigurationSection("page_lot")); + ItemList ppConstructionCost=plugin.getItems(costs.getConfigurationSection("construction")); + ItemList ppRepairCost=plugin.getItems(costs.getConfigurationSection("repair")); + ItemList ppPlateCost=plugin.getItems(costs.getConfigurationSection("plates")); + ItemList ppBindingCost=plugin.getItems(costs.getConfigurationSection("binding")); + ItemList ppPageCost=plugin.getItems(costs.getConfigurationSection("page_lot")); int pagesPerLot = costs.getInt("pages_per_lot",16); - ItemList ppPamphletCost=plugin.getItems(costs.getConfigurationSection("pamphlet_lot")); + ItemList ppPamphletCost=plugin.getItems(costs.getConfigurationSection("pamphlet_lot")); int pamphletsPerLot = costs.getInt("pamphlets_per_lot",24); - ItemList ppSecurityCost=plugin.getItems(costs.getConfigurationSection("security_lot")); + ItemList ppSecurityCost=plugin.getItems(costs.getConfigurationSection("security_lot")); int securityNotesPerLot = costs.getInt("security_notes_per_lot",24); int ppEnergyTime = configPrintingPresses.getInt("fuel_time", 10); int ppRepair = costs.getInt("repair_multiple",1); @@ -142,7 +142,7 @@ public int getPagesPerLot() { } - public ItemList getPamphletMaterials() { + public ItemList getPamphletMaterials() { return pamphletMaterials; } @@ -157,7 +157,7 @@ public int getSecurityNotesPerLot() { } - public ItemList getFuel() + public ItemList getFuel() { return fuel; } @@ -167,7 +167,7 @@ public int getEnergyTime() return energyTime; } - public ItemList getConstructionMaterials() { + public ItemList getConstructionMaterials() { return constructionMaterials; } diff --git a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java index 49cbcd3c..a6ebc6db 100644 --- a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java @@ -4,19 +4,19 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class ProductionProperties extends AFactoryProperties { - private ItemList inputs; + private ItemList inputs; private List recipes; - private ItemList fuel; + private ItemList fuel; private int energyTime; private int repair; - public ProductionProperties(ItemList inputs, List recipes, - ItemList fuel, int energyTime, String name,int repair) + public ProductionProperties(ItemList inputs, List recipes, + ItemList fuel, int energyTime, String name,int repair) { this.inputs = inputs; this.recipes = recipes; @@ -31,7 +31,7 @@ public int getRepair() return repair; } - public ItemList getInputs() + public ItemList getInputs() { return inputs; } @@ -41,7 +41,7 @@ public List getRecipes() return recipes; } - public ItemList getFuel() + public ItemList getFuel() { return fuel; } diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java index bbb9ac7a..71745b23 100644 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java @@ -9,14 +9,14 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class RepairFactoryProperties implements IFactoryProperties{ - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private ItemList recipeMaterials; + private ItemList constructionMaterials; + private ItemList fuel; + private ItemList repairMaterials; + private ItemList recipeMaterials; private List allowedRepairable; private int energyTime; private String name; @@ -25,9 +25,9 @@ public class RepairFactoryProperties implements IFactoryProperties{ private double productionTime; private int resetLevel; - public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, - ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, - double productionTime, int resetLevel, ItemList recipeMaterials, List allowedRepairable){ + public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, + ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, + double productionTime, int resetLevel, ItemList recipeMaterials, List allowedRepairable){ this.constructionMaterials = constructionMaterials; this.fuel = fuel; this.repairMaterials = repairMaterials; @@ -45,19 +45,19 @@ public int getRepair() { return repair; } - public ItemList getConstructionMaterials(){ + public ItemList getConstructionMaterials(){ return constructionMaterials; } - public ItemList getFuel(){ + public ItemList getFuel(){ return fuel; } - public ItemList getRepairMaterials(){ + public ItemList getRepairMaterials(){ return repairMaterials; } - public ItemList getRecipeMaterials(){ + public ItemList getRecipeMaterials(){ return recipeMaterials; } @@ -89,16 +89,16 @@ public int getResetLevel() { } public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){ - ItemList rfFuel = plugin.getItems(section.getConfigurationSection("fuel")); + ItemList rfFuel = plugin.getItems(section.getConfigurationSection("fuel")); if (rfFuel.isEmpty()){ - rfFuel = new ItemList(); - rfFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal")); + rfFuel = new ItemList(); + rfFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal")); } ConfigurationSection costs = section.getConfigurationSection("costs"); - ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); - ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); - ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); - ItemList rfAllowed = plugin.getItems(section.getConfigurationSection("repairable")); + ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); + ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); + ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); + ItemList rfAllowed = plugin.getItems(section.getConfigurationSection("repairable")); int rfEnergyTime = section.getInt("fuel_time"); int rfRepair = costs.getInt("repair_multiple", 1); String rfName = section.getString("name", "Reset Factory"); @@ -107,11 +107,11 @@ public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, Config int resetLevel = section.getInt("reset_level", 1); // We only care about raw material types for repair purposes. - Iterator canRepair = rfAllowed.iterator(); + Iterator canRepair = rfAllowed.iterator(); List repairable = new ArrayList(); while (canRepair.hasNext()) { - NamedItemStack repair = canRepair.next(); + AdvancedItemStack repair = canRepair.next(); repairable.add(repair.getType()); diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index dcdd8c24..54dcbebc 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -6,24 +6,24 @@ import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; +import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; public class ProductionRecipe implements IRecipe { private String title; private String recipeName; private int productionTime; - private ItemList inputs; - private ItemList upgrades; - private ItemList outputs; - private ItemList repairs; + private ItemList inputs; + private ItemList upgrades; + private ItemList outputs; + private ItemList repairs; private List outputRecipes; private List enchantments; private EnchantmentOptions enchantmentOptions; private boolean useOnce; - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, - ItemList outputs, EnchantmentOptions enchantmentOptions, List enchantments,boolean useOnce, ItemList repairs) + public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, + ItemList outputs, EnchantmentOptions enchantmentOptions, List enchantments,boolean useOnce, ItemList repairs) { this.title=title; this.recipeName = recipeName; @@ -38,9 +38,9 @@ public ProductionRecipe(String title,String recipeName,int productionTime,ItemLi this.repairs=repairs; } - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) + public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) { - this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),null,new ArrayList(),false,repairs); + this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),null,new ArrayList(),false,repairs); } public boolean hasMaterials(Inventory inventory) @@ -52,22 +52,22 @@ public void addOutputRecipe(ProductionRecipe outputRecipe) this.outputRecipes.add(outputRecipe); } - public ItemList getInputs() + public ItemList getInputs() { return inputs; } - public ItemList getUpgrades() + public ItemList getUpgrades() { return upgrades; } - public ItemList getOutputs() + public ItemList getOutputs() { return outputs; } - public ItemList getRepairs() + public ItemList getRepairs() { return repairs; } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java new file mode 100644 index 00000000..06b17fea --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -0,0 +1,12 @@ +package com.github.igotyou.FactoryMod.repairManager; + +public interface IRepairManager { + public int getHealth(); + + public boolean atFullHealth(); + + public void repair(); + + public boolean inDisrepair(); + +} diff --git a/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java b/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java new file mode 100644 index 00000000..03ceeecd --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java @@ -0,0 +1,52 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.Map; + +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +public class AdvancedItemStack extends ItemStack { + + public AdvancedItemStack(final Material type, final int amount, + final short damage, final String commonName) { + super(type, amount, damage); + } + + public AdvancedItemStack(final ItemStack itemStack, final String commonName) { + super(itemStack); + } + + public AdvancedItemStack clone() { + try { + AdvancedItemStack namedItemStack = (AdvancedItemStack) super + .clone(); + return namedItemStack; + } catch (Error e) { + throw e; + } + } + + public String getName() { + return getItemMeta().getDisplayName(); + } + + public void setName(String name) { + ItemMeta im = getItemMeta(); + im.setDisplayName(name); + setItemMeta(im); + } + + public Map getEnchants() { + return getItemMeta().getEnchants(); + } + + public void addEnchant(Enchantment enchant, int level) { + getItemMeta().addEnchant(enchant, level, true); + } + + public void removeEnchant(Enchantment enchant) { + getItemMeta().removeEnchant(enchant); + } +} diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java deleted file mode 100644 index 15c99b80..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.github.igotyou.FactoryMod.utility; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.DoubleChest; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Entity; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.ItemStack; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; - -/** - * - * @author Brian Landry - */ -public class ItemList extends ArrayList { - - private static final long serialVersionUID = -5975973806251278120L; - - public boolean exactlyIn(Inventory inventory) - { - //TODO: This is pretty broken too; won't handle split stacks right, a number of - // other edge cases; we've been very lucky so far. Basically only lucky b/c - // the "stack size" of input items is not divided, the requirement comes in as - // a single "stack" of say 96 items, etc. so this works. - // So not exactly "broken" but not clean, either. - boolean returnValue=true; - //Checks that the ItemList ItemStacks are contained in the inventory - for(ItemStack itemStack:this) - { - returnValue=returnValue&&(amountAvailable(inventory,itemStack)==itemStack.getAmount()); - } - //Checks that inventory has not ItemStacks in addition to the ones in the itemList - for(ItemStack invItemStack:inventory.getContents()) - { - if(invItemStack!=null) - { - boolean itemPresent=false; - for(ItemStack itemStack:this) - { - if(itemStack.isSimilar(invItemStack)) - { - itemPresent=true; - } - } - returnValue=returnValue&&itemPresent; - } - } - return returnValue; - } - // TODO: Same issues exist here, I need to fix these. - public boolean oneIn(Inventory inventory) - { - if(this.isEmpty()) - { - return true; - } - else - { - for(ItemStack itemStack:this) - { - if (amountAvailable(inventory, itemStack)>=itemStack.getAmount()) - { - return true; - } - } - return false; - } - } - public boolean allIn(Inventory inventory) - { - for(ItemStack itemStack:this) - { - // TODO: Naive check. What about if you have 2 stacks of the same item, - // but only 1 in the chest? This test will return true for both stacks, - // which is the wrong answer. - if (amountAvailable(inventory, itemStack) removeOneFrom(Inventory inventory) - { - ItemList itemList=new ItemList(); - for(NamedItemStack itemStack:this) - { - if(removeItemStack(inventory,itemStack)) - { - itemList.add(itemStack.clone()); - break; - } - } - return itemList; - } - // TODO: Same risks here; these need to be addressed. - public ItemList getDifference(Inventory inventory) - { - ItemList missingItems=new ItemList(); - for(NamedItemStack itemStack:this) - { - int difference=itemStack.getAmount()-amountAvailable(inventory, itemStack); - if (difference>0) - { - NamedItemStack clonedItemStack=itemStack.clone(); - clonedItemStack.setAmount(difference); - missingItems.add(clonedItemStack); - } - } - return missingItems; - } - public int amountAvailable(Inventory inventory) - { - //TODO This is a very broken, so review: - // basically won't count correctly for repairs where a single-item repair cost is greater than a stack. - int amountAvailable=0; - for(ItemStack itemStack:this) - { - int currentAmountAvailable=amountAvailable(inventory,itemStack); - amountAvailable=amountAvailable>currentAmountAvailable ? amountAvailable : currentAmountAvailable; - } - return amountAvailable; - } - - public boolean putIn(Inventory inventory) { - return putIn(inventory, new ArrayList(), EnchantmentOptions.DEFAULT); - } - - public boolean putIn(Inventory inventory,List probabilisticEnchaments, EnchantmentOptions enchantmentOptions) { - boolean putFailed = false; - for(ItemStack itemStack:this) { - // Terrifying hardcode, but I think sometimes itemStack.maxsize == 0, yikes! - if (itemStack.getMaxStackSize() <= 0) { - Bukkit.getLogger().warning("Item Stack has maxsize of 0, something is very wrong."); - } - int maxStackSize=(itemStack.getMaxStackSize() == 0 ? 64 : itemStack.getMaxStackSize()); - int amount=itemStack.getAmount(); - while(amount>maxStackSize) { - ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments, enchantmentOptions); - for(Enchantment enchantment:enchantments.keySet()) { - if(enchantment.canEnchantItem(itemStack)) { - itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); - } - } - itemClone.setAmount(maxStackSize); - HashMap leftover = inventory.addItem(itemClone); - if (!leftover.isEmpty()) { - putFailed = true; - } - amount-=maxStackSize; - } - ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments, enchantmentOptions); - for(Enchantment enchantment:enchantments.keySet()) { - if(enchantment.canEnchantItem(itemStack)) { - itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); - } - } - itemClone.setAmount(amount); - HashMap leftover = inventory.addItem(itemClone); - if (!leftover.isEmpty()) { - putFailed = true; - } - } - return !putFailed; - } - - /** - * Attempts to pick a subset from available enchantments, using independent probabilities. - * If enchantment_options:ensure_one is set on the recipe, will pick one using - * cumulative probabilities if the independent probability selection fails to pick any. - * if *that* fails, it picks one at random from the full set. - * - * @param probabilisticEnchantments The set of applicable enchantments. - * @param enchantmentOptions The options for applying enchantments - * @return a set of enchantments to apply. - */ - public HashMap getEnchantments(List probabilisticEnchantments, EnchantmentOptions enchantmentOptions) - { - HashMap enchantments = new HashMap(); - Random rand = new Random(); - double sum = 0.0d; - for(ProbabilisticEnchantment pe : probabilisticEnchantments) { - sum += pe.getProbability(); - if(pe.getProbability()>=rand.nextDouble()) { - // Logic fun: go ahead and add if safe only is false, otherwise check if safe. - if (!enchantmentOptions.getSafeOnly() || checkSafe(enchantments.keySet(), pe.getEnchantment())) { - enchantments.put(pe.getEnchantment(),pe.getLevel()); - } - } - } - // Force at least one, try to pick fairly (based on cumulative distribution first) - if (enchantmentOptions.getEnsureOne() && enchantments.size() == 0) { - double which = rand.nextDouble() * sum; - double sofar = 0.0d; - for (ProbabilisticEnchantment pe : probabilisticEnchantments) { - if (pe.getProbability() + sofar >= which) { - enchantments.put(pe.getEnchantment(), pe.getLevel()); - break; - } else { - sofar += pe.getProbability(); - } - } - if (enchantments.size() == 0) { // someone forgot to give any probabilities? - int i = rand.nextInt(probabilisticEnchantments.size()); - enchantments.put(probabilisticEnchantments.get(i).getEnchantment(),probabilisticEnchantments.get(i).getLevel()); - } - } - return enchantments; - } - - /** - * Test function to ensure "safe" enchantment sets. Call before adding a new enchantment to a set - * of enchantments. - * - * @param current The current safe set - * @param test The new enchantment to test - * @return True if this new enchantment does not conflict with any prior enchantments, false otherwise. - */ - private boolean checkSafe(Set current, Enchantment test) { - for (Enchantment ench : current) { - if (test.conflictsWith(ench)) { - return false; - } - } - return true; - } - - - public String toString() - { - String returnString=""; - for(int i=0;i iterator = inventory.iterator(); - while(iterator.hasNext()) - { - ItemStack currentItemStack = iterator.next(); - if (itemStack.isSimilar(currentItemStack)) - { - if (materialsToRemove <= 0) - { - break; - } - if(currentItemStack.getAmount() == materialsToRemove) - { - iterator.set(new ItemStack(Material.AIR, 0)); - materialsToRemove = 0; - } - else if(currentItemStack.getAmount() > materialsToRemove) - { - ItemStack temp = currentItemStack.clone(); - temp.setAmount(currentItemStack.getAmount() - materialsToRemove); - iterator.set(temp); - materialsToRemove = 0; - } - else - { - int inStack = currentItemStack.getAmount(); - iterator.set(new ItemStack(Material.AIR, 0)); - materialsToRemove -= inStack; - } - } - } - return materialsToRemove == 0; - } - /* TODO: int version is just wrong. Use double version. */ - public ItemList getMultiple(int multiplier) - { - ItemList multipliedItemList=new ItemList(); - for (NamedItemStack itemStack:this) - { - NamedItemStack itemStackClone=itemStack.clone(); - itemStackClone.setAmount(itemStack.getAmount()*multiplier); - multipliedItemList.add(itemStackClone); - } - return multipliedItemList; - } - public ItemList getMultiple(double multiplier) - { - ItemList multipliedItemList=new ItemList(); - for (NamedItemStack itemStack:this) - { - NamedItemStack itemStackClone=itemStack.clone(); - long newAmount = (long) Math.round(itemStackClone.getAmount()*multiplier); - if (newAmount > 64) - { - for (;newAmount > 64; newAmount = newAmount-64) - { - NamedItemStack newItemStack = itemStack.clone(); - newItemStack.setAmount(64); - multipliedItemList.add(newItemStack); - } - } - itemStackClone.setAmount((int) newAmount); - multipliedItemList.add(itemStackClone); - } - return multipliedItemList; - } - - public boolean testPutIn(Inventory inventory) { - return testPutIn(inventory, new ArrayList(), EnchantmentOptions.DEFAULT); - } - - public boolean testPutIn(Inventory inventory, List probabilisticEnchantments, - EnchantmentOptions enchantmentOptions) { - if (this.isEmpty()) { // "fail" fast. - return true; - } - - // Bukkit API lacks a way to test adding stuff. That sucks. - // Instead, we'll create a temporary "merged" inventory, and - // see if we can add everything into it without overflowing - Inventory merger = FactoryModPlugin.getPlugin().getServer().createInventory(null, inventory.getSize()); - for (int i = 0; i < inventory.getSize(); i++) { - ItemStack slot = inventory.getItem(i); - - // duplicate exactly, otherwise get weird edge effects - if (slot != null) { - merger.setItem(i, slot); - } else { - merger.clear(i); - } - } - return this.putIn(merger, probabilisticEnchantments, enchantmentOptions); - } -} diff --git a/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java b/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java deleted file mode 100644 index 31785c97..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * A simple Object to connect a name to display to the player with an ItemStack. - * This is required since the actual name displayed is taken care of client side - * so different languages can be used and therefor it is unavailable to the - * plugin. Bukkit does not provide a reliable naming - * structure and does not take into account different names for different damage - * values of items. This could instead be stored in the display name field, but - * then the display name field would have to be ignored on item comparisons and - * couldn't be used to designate unique items. So this is needed :( - */ -package com.github.igotyou.FactoryMod.utility; - -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; - -/** - * - * @author Brian Landry - */ -public class NamedItemStack extends ItemStack{ - //Name to be printed to the user, not necessarily the DisplayName - private final String commonName; - public NamedItemStack (final Material type, final int amount, final short damage,final String commonName) - { - super(type,amount,damage); - this.commonName=commonName; - } - public NamedItemStack(final ItemStack itemStack, final String commonName) { - super(itemStack); - this.commonName = commonName; - } - public NamedItemStack clone() - { - try{ - NamedItemStack namedItemStack=(NamedItemStack) super.clone(); - return namedItemStack; - } - catch (Error e) { - throw e; - } - } - public String toString() - { - return String.valueOf(getAmount())+" "+commonName; - } - - public String getCommonName() - { - return commonName; - } -} From 15b7be3777aa4904dc8e429da2c49b687ee1ceb8 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 8 Dec 2015 17:30:19 +0100 Subject: [PATCH 165/459] Polishing up ItemMap and adding a ton of methods to it --- .../igotyou/FactoryMod/utility/ItemMap.java | 195 +++++++++++++++++- 1 file changed, 187 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index ac0de0bf..71405109 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -1,6 +1,8 @@ package com.github.igotyou.FactoryMod.utility; +import java.util.Collection; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -25,8 +27,8 @@ public ItemMap() { /** * Constructor to create an item map based on the content of an inventory. - * The ItemMap will be in sync with the inventory, it will only update if - * it's explicitly told to do so + * The ItemMap will not be in sync with the inventory, it will only update + * if it's explicitly told to do so * * @param inv * Inventory to base the item map on @@ -35,6 +37,16 @@ public ItemMap(Inventory inv) { update(inv); } + /** + * Constructor to create an item map based on a collection of ItemStacks + * + * @param stacks + * Stacks to add to the map + */ + public ItemMap(Collection stacks) { + addAll(stacks); + } + /** * Clones the given itemstack, sets its amount to one and checks whether a * stack equaling the created one exists in the item map. If yes the amount @@ -56,6 +68,79 @@ public void addItemStack(ItemStack input) { totalItems += input.getAmount(); } + /** + * Removes the given ItemStack from this map. Only the amount of the given + * ItemStack will be removed, not all of them. Use the safe parameter to + * specify whether stacks with negative amounts as a result in the map + * should be allowed or not. + * + * @param input + * ItemStack to remove + * @param safe + * true to forbid stacks with negative amounts, false to allow + * them + */ + public void removeItemStack(ItemStack input, boolean safe) { + ItemStack is = createMapConformCopy(input); + Integer i; + if ((i = items.get(is)) != null) { + int newSum = i - input.getAmount(); + if ((safe && newSum > 0) || !safe) { + items.put(is, i - input.getAmount()); + totalItems -= input.getAmount(); + } + } else { + if (!safe) { + items.put(is, -1 * input.getAmount()); + totalItems -= input.getAmount(); + } + } + } + + /** + * Removes all the given ItemStacks from this map. Only the amount of the + * given ItemStack will be removed, not the complete instance from the map. + * Use the safe parameter to specify whether stacks with negative amounts as + * a result in the map should be allowed or not. + * + * @param stacks + * ItemStacks to remove + * @param safe + * true to forbid stacks with negative amounts, false to allow + * them + */ + public void removeAll(Collection stacks, boolean safe) { + for (ItemStack stack : stacks) { + removeItemStack(stack, safe); + } + } + + /** + * Adds all the stacks given in the collection to this map + * + * @param stacks + * Stacks to add + */ + public void addAll(Collection stacks) { + for (ItemStack is : stacks) { + if (is != null) { + addItemStack(is); + } + } + } + + /** + * Merges the given item map into this instance + * + * @param im + * ItemMap to merge + */ + public void merge(ItemMap im) { + for (Entry entry : im.getEntrySet()) { + addItemAmount(entry.getKey(), entry.getValue()); + } + } + public void update(Inventory inv) { items = new HashMap(); totalItems = 0; @@ -84,9 +169,7 @@ public void addEntrySet(Set> entries) { } /** - * Utility method, which has the amount of items to add as parameter. This - * method doesnt clone the ItemStack, so dont use this on ItemStacks which - * exist in the world + * Utility method, which has the amount of items to add as parameter. * * @param input * ItemStack to sort into the map @@ -94,8 +177,9 @@ public void addEntrySet(Set> entries) { * Amount associated with the given ItemStack */ public void addItemAmount(ItemStack input, int amount) { - input.setAmount(amount); - addItemStack(input); + ItemStack copy = createMapConformCopy(input); + copy.setAmount(amount); + addItemStack(copy); } /** @@ -270,6 +354,101 @@ public ItemMap getDifference(ItemMap im) { return result; } + /** + * Checks whether an inventory contains exactly what's described in this + * ItemMap + * + * @param i + * Inventory to compare + * @return True if the inventory is identical with this instance, false if + * not + */ + public boolean containedExactlyIn(Inventory i) { + return getDifference(new ItemMap(i)).getTotalItemAmount() == 0; + } + + /** + * Checks whether this instance is completly contained in the given ItemMap, + * which means every stack in this instance is also in the given map and the + * amount in the given map is either the same or bigger as in this instance + * + * @param im + * ItemStack to check + * @return true if this instance is completly contained in the given stack, + * false if not + */ + public boolean isContainedBy(ItemMap im) { + for (Entry entry : getDifference(im).getEntrySet()) { + if (entry.getValue() < 0) { + return false; + } + } + return true; + } + + /** + * Checks whether this instance completly contains the given ItemMap, which + * means every stack in the given map also exists in this instance and the + * amount in the given map is either the same or smaller compared to the one + * in this instance + * + * @param im + * ItemStack to check + * @return true if this instance completly contains the given ItemStack, + * false if not + */ + public boolean contains(ItemMap im) { + return im.isContainedBy(this); + } + + /** + * Turns this item map into a list of ItemStacks, with amounts that do not + * surpass the maximum allowed stack size for each ItemStack + * + * @return List of stacksize conform ItemStacks + */ + public LinkedList getItemStackRepresentation() { + LinkedList result = new LinkedList(); + for (Entry entry : getEntrySet()) { + ItemStack is = entry.getKey(); + Integer amount = entry.getValue(); + while (amount != 0) { + ItemStack toAdd = is.clone(); + int addAmount = Math.min(amount, is.getMaxStackSize()); + toAdd.setAmount(addAmount); + result.add(toAdd); + amount -= addAmount; + } + } + return result; + } + + /** + * Clones this map + */ + public ItemMap clone() { + ItemMap clone = new ItemMap(); + for (Entry entry : getEntrySet()) { + clone.addItemAmount(entry.getKey(), entry.getValue()); + } + return clone; + } + + /** + * Checks whether this instance would completly fit into the given inventory + * + * @param i + * Inventory to check + * @return True if this ItemMap's item representation would completly fit in + * the inventory, false if not + */ + public boolean fitsIn(Inventory i) { + ItemMap invCopy = new ItemMap(i); + ItemMap instanceCopy = this.clone(); + instanceCopy.merge(invCopy); + return instanceCopy.getItemStackRepresentation().size() <= i.getSize(); + } + /** * Utility to not mess with stacks directly taken from inventories * @@ -277,7 +456,7 @@ public ItemMap getDifference(ItemMap im) { * Template ItemStack * @return Cloned ItemStack with its amount set to 1 */ - private ItemStack createMapConformCopy(ItemStack is) { + private static ItemStack createMapConformCopy(ItemStack is) { ItemStack copy = is.clone(); copy.setAmount(1); return copy; From 6c3442033c0d8207876139ad81ec12cb4bc2724c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 9 Dec 2015 01:04:00 +0100 Subject: [PATCH 166/459] Second set of changes, production factory and triblock factory interface mostly finished --- .../igotyou/FactoryMod/Contraption.java | 35 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 +- .../FactoryMod/Factorys/ABaseFactory.java | 299 --------- .../FactoryMod/Factorys/NetherFactory.java | 625 ------------------ .../Factorys/ProductionFactory.java | 298 --------- .../Compactor.java | 2 +- .../FurnCraftChestFactory.java | 189 +++--- .../PrintingPress.java | 2 +- .../ProductionFactory.java | 54 ++ .../RepairFactory.java | 2 +- .../listeners/FactoryModListener.java | 2 +- .../listeners/RedstoneListener.java | 2 +- .../FactoryMod/managers/CompactorManager.java | 2 +- .../managers/PrintingPressManager.java | 2 +- .../managers/ProductionFactoryManager.java | 2 +- .../managers/RepairFactoryManager.java | 2 +- .../FurnCraftChestStructure.java | 86 +-- .../MultiBlockStructure.java | 8 +- .../persistence/CompactorCsvReader.java | 4 +- .../persistence/CompactorCsvWriter.java | 2 +- .../persistence/NetherCsvReader.java | 4 +- .../persistence/NetherCsvWriter.java | 2 +- .../persistence/PersistenceFactory.java | 10 +- .../persistence/PrintingPressCsvReader.java | 4 +- .../persistence/PrintingPressCsvWriter.java | 2 +- .../persistence/ProductionCsvReader.java | 2 +- .../persistence/ProductionCsvWriter.java | 2 +- .../persistence/RepairCsvReader.java | 4 +- .../persistence/RepairCsvWriter.java | 2 +- .../powerManager/IPowerManager.java | 9 +- .../igotyou/FactoryMod/recipes/IRecipe.java | 2 - .../FactoryMod/recipes/ProductionRecipe.java | 111 +--- .../igotyou/FactoryMod/utility/ItemMap.java | 34 + 33 files changed, 282 insertions(+), 1526 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java delete mode 100644 src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java delete mode 100644 src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java rename src/com/github/igotyou/FactoryMod/{Factorys => classicTriblockFactory}/Compactor.java (99%) rename src/com/github/igotyou/FactoryMod/{Factorys => classicTriblockFactory}/PrintingPress.java (99%) create mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java rename src/com/github/igotyou/FactoryMod/{Factorys => classicTriblockFactory}/RepairFactory.java (99%) diff --git a/src/com/github/igotyou/FactoryMod/Contraption.java b/src/com/github/igotyou/FactoryMod/Contraption.java index fe3718de..7f853b18 100644 --- a/src/com/github/igotyou/FactoryMod/Contraption.java +++ b/src/com/github/igotyou/FactoryMod/Contraption.java @@ -1,22 +1,27 @@ package com.github.igotyou.FactoryMod; -import org.bukkit.Location; import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -public abstract class Contraption { +public abstract class Contraption implements Runnable{ protected IInteractionManager im; protected IRepairManager rm; - protected Location physicalLocation; + protected IPowerManager pm; protected boolean active; + protected MultiBlockStructure mbs; + protected int updateTime; - public Contraption(Location loc, IInteractionManager im, - IRepairManager rm) { - this.physicalLocation = loc; + public Contraption(IInteractionManager im, IRepairManager rm, + IPowerManager pm, MultiBlockStructure mbs, int updateTime) { this.im = im; this.rm = rm; + this.mbs = mbs; + this.pm = pm; + this.updateTime = updateTime; } public IRepairManager getRepairManager() { @@ -26,21 +31,27 @@ public IRepairManager getRepairManager() { public IInteractionManager getInteractionManager() { return im; } - + + public IPowerManager getPowerManager() { + return pm; + } + public boolean isActive() { return active; - } + } - public Location getLocation() { - return physicalLocation; + public MultiBlockStructure getMultiBlockStructure() { + return mbs; } - public abstract boolean isWhole(); + public int getUpdateTime() { + return updateTime; + } public abstract void activate(); public abstract void deactivate(); - + public abstract void attemptToActivate(Player p); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 2d625c4d..168a0783 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -23,7 +23,7 @@ import vg.civcraft.mc.civmodcore.ACivMod; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.listeners.NoteStackListener; diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java deleted file mode 100644 index f65ebdc6..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/ABaseFactory.java +++ /dev/null @@ -1,299 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.block.Furnace; -import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.Attachable; -import org.bukkit.material.MaterialData; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; -import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; - -public abstract class ABaseFactory extends FurnCraftChestFactory { - - - public ABaseFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, FactoryType factoryType, String subFactoryType) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, - active, factoryType, subFactoryType); - this.currentRepair = 0.0; - this.timeDisrepair = 3155692597470L; - } - - public ABaseFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, int tierLevel, FactoryType factoryType, - Inventory factoryInventory, String subFactoryType) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, - active, tierLevel, factoryType, factoryInventory, - subFactoryType); - this.currentRepair = 0.0; - this.timeDisrepair = 3155692597470L; - } - - public ABaseFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - FactoryType factoryType, String subFactoryType) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, - factoryType, subFactoryType); - this.currentRepair = 0.0; - this.timeDisrepair = 3155692597470L;// Year 2070, default starting value - } - - public ABaseFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - FactoryType factoryType, boolean active, String subFactoryType, - int currentProductionTimer, int currentEnergyTimer, - double currentMaintenance, long timeDisrepair) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, - factoryType, subFactoryType); - this.active = active; - this.currentEnergyTimer = currentEnergyTimer; - this.currentProductionTimer = currentProductionTimer; - this.currentRepair = currentMaintenance; - this.timeDisrepair = timeDisrepair; - } - - private void setActivationLever(boolean state) { - Block lever = findActivationLever(); - if (lever != null) { - setLever(lever, state); - shotGunUpdate(factoryPowerSourceLocation.getBlock()); - } - } - - - - - - public boolean checkHasMaterials() { - return getAllInputs().allIn(getInventory()); - } - - / - /** - * Returns either a success or error message. Called by the blockListener - * when a player left clicks the powerSourceLocation with the - * InteractionMaterial - */ - public List togglePower() { - List response = new ArrayList(); - // if the factory is turned off - if (!active) { - // if the factory isn't broken or the current recipe can repair it - if (!isBroken() || isRepairing()) { - // is there fuel enough for at least once energy cycle? - if (isFuelAvailable()) { - // are there enough materials for the current recipe in the - // chest? - if (checkHasMaterials()) { - // turn the factory on - powerOn(); - // return a success message - response.add(new InteractionResponse( - InteractionResult.SUCCESS, "Factory activated!")); - return response; - } - // there are not enough materials for the recipe! - else { - // return a failure message, containing which materials - // are needed for the recipe - // [Requires the following: Amount Name, Amount Name.] - // [Requires one of the following: Amount Name, Amount - // Name.] - - ItemList needAll = new ItemList(); - ItemList allInputs = getAllInputs(); - needAll.addAll(allInputs.getDifference(getInventory())); - if (!needAll.isEmpty()) { - response.add(new InteractionResponse( - InteractionResult.FAILURE, - "You need all of the following: " - + needAll.toString() + ".")); - } else if (allInputs == null || allInputs.isEmpty()) { - log.warning("getAllInputs() returned null or empty; recipe is returning no expectation of input!"); - } - return response; - } - } - // if there isn't enough fuel for at least one energy cycle - else { - // return a error message - int multiplesRequired = (int) Math.ceil(getProductionTime() - / (double) getEnergyTime()); - response.add(new InteractionResponse( - InteractionResult.FAILURE, - "Factory is missing fuel! (" - + getFuel().getMultiple(multiplesRequired) - .toString() + ")")); - return response; - } - } else { - response.add(new InteractionResponse(InteractionResult.FAILURE, - "Factory is in disrepair!")); - return response; - } - } - // if the factory is on already - else { - // turn the factory off - powerOff(); - // return success message - response.add(new InteractionResponse(InteractionResult.FAILURE, - "Factory has been deactivated!")); - return response; - } - } - - public abstract ItemList getFuel(); - - public abstract ItemList getInputs(); - - public abstract ItemList getOutputs(); - - public abstract ItemList getRepairs(); - - public void consumeInputs() { - // Remove inputs from chest - getInputs().removeFrom(getInventory()); - } - - /** - * Implementations should override this to define any controls on - * enchantment. - * - * @return an instance of EnchantmentOptions - */ - public EnchantmentOptions getEnchantmentOptions() { - return EnchantmentOptions.DEFAULT; - } - - public void produceOutputs() { - // Adds outputs to chest with appropriate enchantments - getOutputs().putIn(getInventory(), getEnchantments(), - getEnchantmentOptions()); - } - - public ItemList getAllInputs() { - ItemList allInputs = new ItemList(); - allInputs.addAll(getInputs()); - allInputs.addAll(getRepairs()); - return allInputs; - } - - - - protected void postUpdate() { - // Hook for subtypes - } - - protected void fuelConsumed() { - // Hook for subtypes - } - - public List getEnchantments() { - return new ArrayList(); - } - - protected abstract void recipeFinished(); - - - - - - /** - * Sets the toggled state of a single lever
    - * No Lever type check is performed - * - * @param lever - * block - * @param down - * state to set to - */ - private static void setLever(org.bukkit.block.Block lever, boolean down) { - if (lever.getType() != Material.LEVER) { - return; - } - - byte data = lever.getData(); - int newData; - if (down) { - newData = data | 0x8; - } else { - newData = data & 0x7; - } - if (newData != data) { - // CraftBukkit start - Redstone event for lever - int old = !down ? 1 : 0; - int current = down ? 1 : 0; - BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(lever, - old, current); - Bukkit.getServer().getPluginManager().callEvent(eventRedstone); - if ((eventRedstone.getNewCurrent() > 0) != down) { - return; - } - // CraftBukkit end - lever.setData((byte) newData, true); - lever.getState().update(); - Block attached = lever.getRelative(((Attachable) lever.getState() - .getData()).getAttachedFace()); - } - } - - /** - * returns the Location of the central block of the factory - */ - public Location getCenterLocation() { - return factoryLocation; - } - - /** - * returns the Location of the factory Inventory - */ - public Location getInventoryLocation() { - return factoryInventoryLocation; - } - - /** - * returns the Location of the factory power source - */ - public Location getPowerSourceLocation() { - return factoryPowerSourceLocation; - } - - /** - * Checks if there is enough fuel Available for atleast once energy cycle - * - * @return true if there is enough fuel, false otherwise - */ - public boolean isFuelAvailable() { - Inventory inv = getPowerSourceInventory(); - if (inv == null) { - return false; - } else { - return getFuel().allIn(inv); - } - } - - - -} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java deleted file mode 100644 index 374b9c1d..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ /dev/null @@ -1,625 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; -import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; -import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class NetherFactory extends ABaseFactory -{ - - private ReinforcementManager rm = Citadel.getReinforcementManager(); - private NetherFactoryProperties netherFactoryProperties;//the properties of the production factory - private Location netherTeleportPlatform; - private Location overworldTeleportPlatform; - private NetherOperationMode mode; - public NetherOperationMode getMode() { - return mode; - } - - /** - * Constructor called when creating portal - */ - public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, - NetherFactoryProperties netherFactoryProperties) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.NETHER_FACTORY, "Nether factory"); - this.netherTeleportPlatform = nTeleportPlatform; - this.overworldTeleportPlatform = oTeleportPlatform; - this.netherFactoryProperties = netherFactoryProperties; - this.mode = NetherOperationMode.REPAIR; - } - - /** - * Constructor - */ - public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, - boolean active, double currentMaintenance, - long timeDisrepair, NetherOperationMode mode, NetherFactoryProperties netherFactoryProperties) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.NETHER_FACTORY, active, "Nether factory", 0 , 0, currentMaintenance, timeDisrepair); - this.netherFactoryProperties = netherFactoryProperties; - this.netherTeleportPlatform = nTeleportPlatform; - this.overworldTeleportPlatform = oTeleportPlatform; - this.mode = mode; - } - - @Override - public boolean isRepairing() { - return mode == NetherOperationMode.REPAIR; - } - - @Override - public void destroy(Location destroyLocation) - { - if (destroyLocation.equals(overworldTeleportPlatform) || destroyLocation.equals(netherTeleportPlatform)) - { - powerOff(); - } - else if (destroyLocation.equals(factoryLocation) || destroyLocation.equals(factoryInventoryLocation) || destroyLocation.equals(factoryPowerSourceLocation)) - { - powerOff(); - currentRepair=getMaxRepair(); - timeDisrepair=System.currentTimeMillis(); - } - } - - /** - * Returns either a success or error message. - * Called by the blockListener when a player left clicks the center block, with the InteractionMaterial - */ - @Override - public void update() - { - if (mode == NetherOperationMode.REPAIR) - { - //if factory is turned on - if (active) - { - //if the materials required to produce the current recipe are in the factory inventory - if (checkHasMaterials()) - { - //if the factory has been working for less than the required time for the recipe - if (currentProductionTimer < getProductionTime()) - { - //if the factory power source inventory has enough fuel for at least 1 energyCycle - if (isFuelAvailable()) - { - //if the time since fuel was last consumed is equal to how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime()-1) - { - //remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); - //0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); - } - //if we don't need to consume fuel, just increment the energy timer - else - { - currentEnergyTimer++; - } - //increment the production timer - currentProductionTimer ++; - postUpdate(); - } - //if there is no fuel Available turn off the factory - else - { - powerOff(); - } - } - - //if the production timer has reached the recipes production time remove input from chest, and add output material - else if (currentProductionTimer >= getProductionTime()) - { - consumeInputs(); - produceOutputs(); - //Repairs the factory - repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); - recipeFinished(); - - currentProductionTimer = 0; - powerOff(); - } - } - else - { - powerOff(); - } - } - } - else if (mode == NetherOperationMode.TELEPORT) - { - if(!isFuelAvailable()) - { - togglePower(); - } - } - } - - public List getTeleportationBlockResponse(final Player player, Location clickedBlock) - { - List responses=new ArrayList(); - //does the player have access to the nether factory via Citadel? - if (!FactoryModPlugin.CITADEL_ENABLED || rm.getReinforcement(factoryLocation) == null || (((PlayerReinforcement) rm.getReinforcement(factoryLocation)).isAccessible(player))) - { - if (mode == NetherOperationMode.TELEPORT) - { - if (active) - { - if (!isBroken()||isRepairing()){ - if (isFuelAvailable() || !netherFactoryProperties.getUseFuelOnTeleport()) - { - Location playerLocation = player.getLocation(); - if ( playerLocation.getBlockX() == clickedBlock.getBlockX() - && (playerLocation.getBlockY()-1) == clickedBlock.getBlockY() - && playerLocation.getBlockZ() == clickedBlock.getBlockZ()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Commencing teleportation...")); - if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.WORLD_NAME)) - { - if (FactoryModPlugin.REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT) - { - removeBlocksAboveTeleportPlatform(netherTeleportPlatform); - } - Location destination = new Location(netherTeleportPlatform.getWorld(), netherTeleportPlatform.getX(), netherTeleportPlatform.getY(), netherTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); - destination.add(0.5, 1.5, 0.5); - final Entity ent = player.getVehicle(); - player.teleport(destination); - if (ent != null){ - ent.teleport(destination); - Bukkit.getScheduler().runTask(FactoryModPlugin.getPlugin(), new Runnable(){ - - @Override - public void run() { - ent.setPassenger(player); - } - }); - } - if (netherFactoryProperties.getUseFuelOnTeleport()) - { - getFuel().removeFrom(getPowerSourceInventory()); - } - } - else if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.NETHER_NAME)) - { - if (FactoryModPlugin.REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT) - { - removeBlocksAboveTeleportPlatform(overworldTeleportPlatform); - } - Location destination = new Location(overworldTeleportPlatform.getWorld(), overworldTeleportPlatform.getX(), overworldTeleportPlatform.getY(), overworldTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); - destination.add(0.5, 1.5, 0.5); - final Entity ent = player.getVehicle(); - player.teleport(destination); - if (ent != null){ - ent.teleport(destination); - Bukkit.getScheduler().runTask(FactoryModPlugin.getPlugin(), new Runnable(){ - - @Override - public void run() { - ent.setPassenger(player); - } - }); - } - if (netherFactoryProperties.getUseFuelOnTeleport()) - { - getFuel().removeFrom(getPowerSourceInventory()); - } - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, you must stand on the teleportation block!")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is missing fuel! ("+getFuel().getMultiple(1).toString()+")")); - } - }else{ - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is in disrepair.")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is turned off!")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is not in teleport mode.")); - } - return responses; - } - else - { - //is the player potentially holding a security note/ticket? - ItemStack itemInHand = player.getItemInHand(); - if (itemInHand.getType() == Material.PAPER) - { - if (isInTicketMode()) - { - int ticketCheck = checkTicket(itemInHand); - if (ticketCheck > 0) - { - if (mode == NetherOperationMode.TELEPORT) - { - if (active) - { - if (!isBroken()||isRepairing()){ - if (isFuelAvailable()) - { - Location playerLocation = player.getLocation(); - if ( playerLocation.getBlockX() == clickedBlock.getBlockX() - && (playerLocation.getBlockY()-1) == clickedBlock.getBlockY() - && playerLocation.getBlockZ() == clickedBlock.getBlockZ()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Commencing teleportation...")); - if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.WORLD_NAME)) - { - if (FactoryModPlugin.REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT) - { - removeBlocksAboveTeleportPlatform(netherTeleportPlatform); - } - Location destination = new Location(netherTeleportPlatform.getWorld(), netherTeleportPlatform.getX(), netherTeleportPlatform.getY(), netherTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); - destination.add(0.5, 1.5, 0.5); - player.teleport(destination); - if (ticketCheck == 2) - { - transferTicket(player, itemInHand); - } - if (netherFactoryProperties.getUseFuelOnTeleport()) - { - getFuel().removeFrom(getPowerSourceInventory()); - } - } - else if (clickedBlock.getWorld().getName().equalsIgnoreCase(FactoryModPlugin.NETHER_NAME)) - { - if (FactoryModPlugin.REMOVE_BLOCK_ABOVE_TELEPORT_PLATFORM_ON_TELEPORT) - { - removeBlocksAboveTeleportPlatform(overworldTeleportPlatform); - } - Location destination = new Location(overworldTeleportPlatform.getWorld(), overworldTeleportPlatform.getX(), overworldTeleportPlatform.getY(), overworldTeleportPlatform.getZ(), playerLocation.getYaw(), playerLocation.getPitch()); - destination.add(0.5, 1.5, 0.5); - player.teleport(destination); - if (ticketCheck == 2) - { - transferTicket(player, itemInHand); - } - if (netherFactoryProperties.getUseFuelOnTeleport()) - { - getFuel().removeFrom(getPowerSourceInventory()); - } - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, you must stand on the teleportation block!")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is missing fuel! ("+getFuel().getMultiple(1).toString()+")")); - } - }else{ - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is in disrepair.")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is turned off!")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is not in teleport mode.")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Your ticket does not match any in the factory.")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You don't have permission to use this factory.")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You don't have permission to use this factory.")); - } - } - return responses; - } - - @Override - public List getCentralBlockResponse() - { - List responses=new ArrayList(); - //Is the factory off - if (!active) - { - //is the recipe is initiated - if (mode == null) - { - mode = NetherOperationMode.REPAIR; - } - else - { - mode = mode.getNext(); - } - - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched mode to: " + mode.getDescription()+".")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next mode is: "+mode.getNext().getDescription()+".")); - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change modes while the nether factory is on! Turn it off first.")); - } - return responses; - } - - @Override - public ItemList getFuel() { - return netherFactoryProperties.getFuel(); - } - - /** - * Returns the factory's properties - */ - public NetherFactoryProperties getProperties() - { - return netherFactoryProperties; - } - - @Override - public List getChestResponse() - { - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - //Name: Status with XX% health. - int maxRepair = netherFactoryProperties.getRepair(); - boolean maintenanceActive = maxRepair!=0; - int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, netherFactoryProperties.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - //Current mode: mode description - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); - //Overworld side teleport platform is at X: Y: Z: - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Overworld side teleport platform is:" + overworldTeleportPlatform.getBlockX() + " Y:" + overworldTeleportPlatform.getBlockY() + " Z:" + overworldTeleportPlatform.getBlockZ())); - //Nether side teleport platform is at X: Y: Z: - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Nether side teleport platform is:" + netherTeleportPlatform.getBlockX() + " Y:" + netherTeleportPlatform.getBlockY() + " Z:" + netherTeleportPlatform.getBlockZ())); - //[Will repair XX% of the factory] - if(!getRepairs().isEmpty()&&maintenanceActive) - { - int amountAvailable=getRepairs().amountAvailable(getInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/netherFactoryProperties.getRepair()*100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); - } - return responses; - } - - protected void recipeFinished() { - } - - @Override - public ItemList getInputs() { - if(mode == NetherOperationMode.REPAIR) - { - return new ItemList(); - } - else - { - return new ItemList(); - } - } - - @Override - public ItemList getOutputs() { - return new ItemList(); - } - - @Override - public ItemList getRepairs() { - ItemList repairMaterials = new ItemList(); - switch(mode) { - case REPAIR: - repairMaterials.addAll(netherFactoryProperties.getRepairMaterials()); - repairMaterials = repairMaterials.getMultiple(((NetherFactoryManager) FactoryModPlugin.getPlugin().manager.getManager(NetherFactory.class)).getScalingFactor(factoryLocation)); - break; - default: - break; - } - return repairMaterials; - } - - @Override - public double getEnergyTime() { - return netherFactoryProperties.getEnergyTime(); - } - - @Override - public double getProductionTime() { - switch(mode) { - case REPAIR: - return netherFactoryProperties.getRepairTime(); - default: - return 1; - } - } - - @Override - public int getMaxRepair() { - return netherFactoryProperties.getRepair(); - } - - public Location getNetherTeleportPlatform() - { - return netherTeleportPlatform; - } - - - public Location getOverworldTeleportPlatform() - { - return overworldTeleportPlatform; - } - - @Override - public boolean isWhole(boolean initCall) - { - //Check if power source exists - if(super.isWhole(initCall)) - { - if (netherTeleportPlatform == null && overworldTeleportPlatform == null && initCall) - { - return true; - } - else - { - if (netherTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - if (overworldTeleportPlatform.getBlock().getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - return true; - } - } - } - } - return false; - } - - public boolean isInTicketMode() - { - for (ItemStack itemSlot : getInventory().getContents()) - { - if (itemSlot != null && itemSlot.getType() == Material.PAPER) - { - return true; - } - } - return false; - } - - public int checkTicket(ItemStack ticket) - { - int amount = 0; - for(ItemStack itemStack: getInventory().getContents()) - { - if (itemStack == null) - { - continue; - } - if (itemStack.isSimilar(ticket)) - { - amount = amount+itemStack.getAmount(); - } - } - if (amount == 1) - { - return 1; - } - else if (amount >= 2) - { - return 2; - } - else - { - return 0; - } - } - - public void removeBlocksAboveTeleportPlatform(Location teleportPlatform) - { - Location netherLocation1 = teleportPlatform.clone(); - netherLocation1.add(0, 1, 0); - Location netherLocation2 = teleportPlatform.clone(); - netherLocation2.add(0, 2, 0); - Location netherLocation3 = teleportPlatform.clone(); - netherLocation3.add(0, 3, 0); - netherLocation1.getBlock().setType(Material.AIR); - netherLocation1.getBlock().getState().update(true); - netherLocation2.getBlock().setType(Material.AIR); - netherLocation2.getBlock().getState().update(true); - netherLocation3.getBlock().setType(Material.AIR); - netherLocation3.getBlock().getState().update(true); - } - - public void regenerateTeleportBlock(Location location) - { - if (location.equals(overworldTeleportPlatform)) - { - netherTeleportPlatform.getBlock().setType(FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL); - netherTeleportPlatform.getBlock().getState().update(true); - } - else if(location.equals(netherTeleportPlatform)) - { - overworldTeleportPlatform.getBlock().setType(FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL); - overworldTeleportPlatform.getBlock().getState().update(true); - } - - } - - public void transferTicket(Player player, ItemStack ticket) - { - ItemStack clonedTicket = ticket.clone(); - clonedTicket.setAmount(1); - ticket.setAmount(ticket.getAmount()-1); - player.setItemInHand(ticket); - getInventory().addItem(clonedTicket); - } - - public enum NetherOperationMode { - REPAIR(0, "Repair"), - TELEPORT(1, "Teleport"); - - private static final int MAX_ID = 2; - private int id; - private String description; - - private NetherOperationMode(int id, String description) { - this.id = id; - this.description = description; - } - - public String getDescription() { - return description; - } - - public static NetherOperationMode byId(int id) { - for (NetherOperationMode mode : NetherOperationMode.values()) { - if (mode.getId() == id) - return mode; - } - return null; - } - - public int getId() { - return id; - } - - public NetherOperationMode getNext() { - int nextId = (getId() + 1) % MAX_ID; - return NetherOperationMode.byId(nextId); - } - } -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java deleted file mode 100644 index 88fe9e93..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ /dev/null @@ -1,298 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; -import com.github.igotyou.FactoryMod.recipes.IRecipe; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class ProductionFactory extends ABaseFactory -{ - - private ProductionRecipe currentRecipe = null;//the recipe that is currently selected - private ProductionProperties productionFactoryProperties;//the properties of the production factory - public static final FactoryType FACTORY_TYPE = FactoryType.PRODUCTION;//the factory's type - private List recipes; - private int currentRecipeNumber = 0;//the array index of the current recipe - - /** - * Constructor - */ - public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource - , String subFactoryType) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, subFactoryType); - this.productionFactoryProperties = (ProductionProperties) factoryProperties; - this.recipes=new ArrayList (productionFactoryProperties.getRecipes()); - this.setRecipeToNumber(0); - } - - /** - * Constructor - */ - public ProductionFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - String subFactoryType, boolean active, int currentProductionTimer, int currentEnergyTimer, List recipes, - int currentRecipeNumber,double currentMaintenance,long timeDisrepair) - { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, ProductionFactory.FACTORY_TYPE, active, subFactoryType, currentProductionTimer, currentEnergyTimer, currentMaintenance, timeDisrepair); - this.productionFactoryProperties = (ProductionProperties) factoryProperties; - this.recipes=recipes; - this.setRecipeToNumber(currentRecipeNumber); - } - - @Override - public boolean checkHasMaterials() { - return currentRecipe.hasMaterials(getInventory()); - } - - @Override - public boolean isRepairing() { - return currentRecipe.getRepairs().size()!=0; - } - - - /** - * Returns either a success or error message. - * Called by the blockListener when a player left clicks the center block, with the InteractionMaterial - */ - @Override - public List getCentralBlockResponse() - { - List responses=new ArrayList(); - //Is the factory off - if (!active) - { - //is the recipe is initiaed - if (currentRecipe != null) - { - //if we are at the end of the recipe array loop around - if (currentRecipeNumber == recipes.size() - 1) - { - setRecipeToNumber(0); - currentProductionTimer = 0; - } - //if we can just increment the recipe - else - { - setRecipeToNumber(currentRecipeNumber + 1); - currentProductionTimer = 0; - } - } - //if the recipe for some reason is not initialised, initialise it to recipe 0 - else - { - setRecipeToNumber(0); - currentProductionTimer = 0; - } - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to: " + currentRecipe.getRecipeName()+".")); - if(currentRecipeNumber != recipes.size() - 1) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(currentRecipeNumber+1).getRecipeName()+".")); - } - else - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next Recipe is: "+recipes.get(0).getRecipeName()+".")); - } - } - //if the factory is on, return error message - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); - } - return responses; - } - - @Override - public ItemList getFuel() { - return productionFactoryProperties.getFuel(); - } - - /** - * Sets the factories current recipe. - * @param newRecipe the desired recipe - */ - public void setRecipe(IRecipe newRecipe) - { - if (newRecipe instanceof ProductionRecipe) - { - currentRecipe = (ProductionRecipe) newRecipe; - } - } - - /** - * sets the recipe to the supplied index - * @param newRecipeNumber the desired recipeArray index - */ - public void setRecipeToNumber(int newRecipeNumber) - { - if (newRecipeNumber getRecipes() - { - return recipes; - } - - @Override - public List getChestResponse() - { - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/currentRecipe.getProductionTime())+"% done." : ""; - //Name: Status with XX% health. - int health =(getProductionFactoryProperties().getRepair()==0) ? 100 : (int) Math.round(100*(1-currentRepair/(getProductionFactoryProperties().getRepair()))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, getProductionFactoryProperties().getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - //RecipeName: X seconds(Y ticks)[ - XX% done.] - responses.add(new InteractionResponse(InteractionResult.SUCCESS, currentRecipe.getRecipeName()+": "+currentRecipe.getProductionTime() + " seconds("+ currentRecipe.getProductionTime()*FactoryModPlugin.TICKS_PER_SECOND + " ticks)"+percentDone)); - //[Inputs: amount Name, amount Name.] - if(!currentRecipe.getInputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+currentRecipe.getInputs().toString()+".")); - } - //[Upgrades: amount Name, amount Name.] - if(!currentRecipe.getUpgrades().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Upgrades: "+currentRecipe.getUpgrades().toString()+".")); - } - //[Outputs: amount Name, amount Name.] - if(!getOutputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs().toString()+".")); - } - //[Will repair XX% of the factory] - if(!currentRecipe.getRepairs().isEmpty()&&getProductionFactoryProperties().getRepair()!=0) - { - int amountAvailable=currentRecipe.getRepairs().amountAvailable(getPowerSourceInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/getProductionFactoryProperties().getRepair()*100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+currentRecipe.getRepairs().getMultiple(amountRepaired).toString()+".")); - } - if(getProductionFactoryProperties().getRepair()!=0) - if(!currentRecipe.getOutputRecipes().isEmpty()) - { - List outputRecipes=currentRecipe.getOutputRecipes(); - String response="Makes available: "; - for(int i=0;i getInputs() { - return currentRecipe.getInputs(); - } - - @Override - public ItemList getOutputs() { - return currentRecipe.getOutputs(); - } - - @Override - public ItemList getRepairs() { - return currentRecipe.getRepairs(); - } - - @Override - public List getEnchantments() { - return currentRecipe.getEnchantments(); - } - - @Override - public double getEnergyTime() { - return productionFactoryProperties.getEnergyTime(); - } - - @Override - public double getProductionTime() { - return currentRecipe.getProductionTime(); - } - - @Override - public EnchantmentOptions getEnchantmentOptions() { - return currentRecipe.getEnchantmentOptions(); - } - - @Override - public int getMaxRepair() { - return productionFactoryProperties.getRepair(); - } - - @Override - public IFactoryProperties getProperties() { - return productionFactoryProperties; - } -} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java similarity index 99% rename from src/com/github/igotyou/FactoryMod/Factorys/Compactor.java rename to src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java index 691dd6d2..af0b0ba5 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/Compactor.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.Factorys; +package com.github.igotyou.FactoryMod.classicTriblockFactory; import java.util.ArrayList; import java.util.List; diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java index 6adf95d9..9b729467 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -1,100 +1,87 @@ package com.github.igotyou.FactoryMod.classicTriblockFactory; -import org.bukkit.Location; +import java.util.List; + import org.bukkit.Material; +import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.block.Furnace; +import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.Contraption; +import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -//original file: -/** - * MachineObject.java - * Purpose: Basic object base for machines to extend - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited version: /** - * FactoryObject.java Purpose basic object base for factories to extend - * - * @author igotyou + * Represents a "classic" factory, which consists of a furnace as powersource, a + * crafting table as main interaction element between the furnace and the chest, + * which is used as inventory holder * */ public abstract class FurnCraftChestFactory extends Contraption { - - protected Location factoryInventoryLocation; - protected Location factoryPowerSourceLocation; - protected boolean active; - protected Inventory factoryInventory; - protected Inventory factoryPowerInventory; protected int currentProductionTimer = 0; + protected List recipes; + protected IRecipe currentRecipe; - /** - * Constructor - */ - public FurnCraftChestFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - IInteractionManager im, IRepairManager rm) { - super(factoryLocation, im, rm); - this.factoryInventoryLocation = factoryInventoryLocation; - this.factoryPowerSourceLocation = factoryPowerSource; + public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, + IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime) { + super(im, rm, ipm, mbs, updateTime); this.active = false; } /** - * Returns the factory Inventory(normally a chest), updates the inventory - * variable aswell. + * @return Inventory of the chest or null if there is no chest where one + * should be */ public Inventory getInventory() { - Chest chestBlock = (Chest) factoryInventoryLocation.getBlock() - .getState(); - factoryInventory = chestBlock.getInventory(); - return factoryInventory; + if (!(getFurnace().getType() == Material.CHEST)) { + return null; + } + Chest chestBlock = (Chest) (getChest().getState()); + return chestBlock.getInventory(); } /** - * Returns the power Source inventory, updates it aswell. + * @return Inventory of the furnace or null if there is no furnace where one + * should be */ - public Inventory getPowerSourceInventory() { - if (!(factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation - .getBlock().getType() == Material.BURNING_FURNACE)) { + public Inventory getFurnaceInventory() { + if (!(getFurnace().getType() == Material.FURNACE || getFurnace() + .getType() == Material.BURNING_FURNACE)) { return null; } - Furnace furnaceBlock = (Furnace) factoryPowerSourceLocation.getBlock() - .getState(); - factoryPowerInventory = furnaceBlock.getInventory(); - return factoryPowerInventory; + Furnace furnaceBlock = (Furnace) (getFurnace().getState()); + return furnaceBlock.getInventory(); } - /** - * Checks whether enough space for the output is available in the chest - * - * @return true if enough space is available, false if not - */ - public boolean checkSpaceForOutput() { - // TODO - return true; + public void attemptToActivate(Player p) { + // TODO Citadel stuff + if (mbs.isComplete()) { + if (hasInputMaterials() && pm.fuelAvailable()) { + activate(); + run(); + } + } } - + /** * Turns the factory on */ public void activate() { - active = true; // lots of code to make the furnace light up, without loosing contents. - Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock() - .getState(); + active = true; + Furnace furnace = (Furnace) (getFurnace().getState()); byte data = furnace.getData().getData(); ItemStack[] oldContents = furnace.getInventory().getContents(); furnace.getInventory().clear(); - factoryPowerSourceLocation.getBlock().setType(Material.BURNING_FURNACE); - furnace = (Furnace) factoryPowerSourceLocation.getBlock().getState(); + getFurnace().setType(Material.BURNING_FURNACE); + furnace = (Furnace) (getFurnace().getState()); furnace.setRawData(data); furnace.update(); furnace.setBurnTime(Short.MAX_VALUE); @@ -103,7 +90,6 @@ public void activate() { currentProductionTimer = 0; } - /** * Turns the factory off. */ @@ -111,14 +97,12 @@ public void deactivate() { if (active) { // lots of code to make the furnace turn off, without loosing // contents. - Furnace furnace = (Furnace) factoryPowerSourceLocation.getBlock() - .getState(); + Furnace furnace = (Furnace) (getFurnace().getState()); byte data = furnace.getData().getData(); ItemStack[] oldContents = furnace.getInventory().getContents(); furnace.getInventory().clear(); - factoryPowerSourceLocation.getBlock().setType(Material.FURNACE); - furnace = (Furnace) factoryPowerSourceLocation.getBlock() - .getState(); + getFurnace().setType(Material.FURNACE); + furnace = (Furnace) getFurnace().getState(); furnace.setRawData(data); furnace.update(); furnace.getInventory().setContents(oldContents); @@ -130,11 +114,12 @@ public void deactivate() { } } - /** - * Returns the energy timer - */ - public int getEnergyTimer() { - return currentEnergyTimer; + public Block getFurnace() { + return ((FurnCraftChestStructure) mbs).getFurnace(); + } + + public Block getChest() { + return ((FurnCraftChestStructure) mbs).getChest(); } /** @@ -151,78 +136,66 @@ public int getRunningTime() { return currentProductionTimer; } - /** - * @return How long since energy was consumed the last time in ticks - */ - public int getLastEnergyConsumptionTime() { - return currentEnergyTimer; - } - - /** - * returns true if all factory blocks are occupied with the correct blocks - */ - public boolean isWhole() { - return (factoryPowerSourceLocation.getBlock().getType() == Material.FURNACE || factoryPowerSourceLocation - .getBlock().getType() == Material.BURNING_FURNACE) - && (factoryInventoryLocation.getBlock().getType() == Material.CHEST) - && (physicalLocation.getBlock().getType() == Material.WORKBENCH); - } - /** * called by the manager each update cycle */ - public void update() { - // if factory is turned on - if (active) { + public void run() { + if (active && mbs.isComplete()) { // if the materials required to produce the current recipe are in // the factory inventory - if (checkHasMaterials()) { + if (hasInputMaterials()) { // if the factory has been working for less than the required // time for the recipe - if (currentProductionTimer < getProductionTime()) { + if (currentProductionTimer < currentRecipe.getProductionTime()) { // if the factory power source inventory has enough fuel for // at least 1 energyCycle - if (isFuelAvailable()) { + if (pm.fuelAvailable()) { // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime() - 1) { + if (pm.getPowerCounter() == pm + .getPowerConsumptionIntervall() - 1) { // remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); + pm.consumeFuel(); // 0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); + pm.setPowerCounter(0); } // if we don't need to consume fuel, just increment the // energy timer else { - currentEnergyTimer++; + pm.incrementPowerCounter(); } // increment the production timer - currentProductionTimer++; - postUpdate(); + currentProductionTimer += updateTime; + // schedule next update + FactoryModPlugin + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask( + FactoryModPlugin.getPlugin(), this, + (long) updateTime); } // if there is no fuel Available turn off the factory else { - powerOff(); + deactivate(); } } // if the production timer has reached the recipes production // time remove input from chest, and add output material - else if (currentProductionTimer >= getProductionTime()) { - consumeInputs(); - produceOutputs(); - // Repairs the factory - repair(getRepairs().removeMaxFrom(getInventory(), - (int) currentRepair)); - recipeFinished(); - + else if (currentProductionTimer >= currentRecipe + .getProductionTime()) { + applyRecipeEffect(); currentProductionTimer = 0; - powerOff(); + deactivate(); } } else { - powerOff(); + deactivate(); } } } + + public abstract boolean hasInputMaterials(); + + public abstract void applyRecipeEffect(); } diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java similarity index 99% rename from src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java rename to src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java index 48aa4000..2766a69e 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.Factorys; +package com.github.igotyou.FactoryMod.classicTriblockFactory; import java.util.ArrayList; import java.util.List; diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java new file mode 100644 index 00000000..065e167a --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java @@ -0,0 +1,54 @@ +package com.github.igotyou.FactoryMod.classicTriblockFactory; + +import java.util.HashMap; +import java.util.Map.Entry; + +import org.bukkit.block.BlockFace; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class ProductionFactory extends FurnCraftChestFactory { + + public ProductionFactory(IInteractionManager im, IRepairManager rm, + IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime) { + super(im, rm, ipm, mbs, updateTime); + } + + @Override + public boolean hasInputMaterials() { + return ((ProductionRecipe) currentRecipe).getRawInputs().isContainedBy( + new ItemMap(getInventory())); + } + + public void applyRecipeEffect() { + ProductionRecipe pr = (ProductionRecipe) currentRecipe; + int multiplier = pr.getRawInputs().getMultiplesContainedIn( + new ItemMap(getInventory())); + ItemMap toRemove = pr.getRawInputs().clone(); + toRemove.multiplyContent(multiplier); + ItemMap toAdd = pr.getRawOutputs().clone(); + toAdd.multiplyContent(multiplier); + for (ItemStack is : toRemove.getItemStackRepresentation()) { + getInventory().remove(is); + } + for (ItemStack is : toAdd.getItemStackRepresentation()) { + HashMap notAdded = getInventory().addItem(is); + // drop items that didnt fit in the chest + for (Entry entry : notAdded.entrySet()) { + getChest() + .getLocation() + .getWorld() + .dropItemNaturally( + getChest().getRelative(BlockFace.UP) + .getLocation(), entry.getValue()); + } + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java similarity index 99% rename from src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java rename to src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java index 6d2a3c41..9e9e0f85 100644 --- a/src/com/github/igotyou/FactoryMod/Factorys/RepairFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.Factorys; +package com.github.igotyou.FactoryMod.classicTriblockFactory; import java.util.ArrayList; import java.util.List; diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 9c6b7207..a00096c1 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -34,7 +34,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; import com.github.igotyou.FactoryMod.managers.FactoryManagerService; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; diff --git a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java index e06f0f4d..f529bbf7 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java @@ -15,7 +15,7 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.managers.FactoryManagerService; public class RedstoneListener implements Listener { diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java index b9b278ec..d423fb80 100644 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java @@ -7,7 +7,7 @@ import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.ItemList; diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java index 01049273..ec9c3b29 100644 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java @@ -7,7 +7,7 @@ import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java index fd1ab670..1c8a9c0e 100644 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java @@ -10,7 +10,7 @@ import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java index 003d1cf5..24b6c817 100644 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java @@ -7,7 +7,7 @@ import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java index 35ffe6f9..a25c8c31 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -5,89 +5,61 @@ import org.bukkit.block.BlockFace; public class FurnCraftChestStructure extends MultiBlockStructure { - public boolean isComplete(Block center) { - if (center.getType() == Material.WORKBENCH) { - for (Block b : searchForBlockOnSides(center, Material.CHEST)) { - switch (center.getFace(b)) { - case SOUTH: - if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { - return true; - } - case NORTH: - if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { - return true; - } - case WEST: - if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { - return true; - } - case EAST: - if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { - return true; - } - } + private Block CraftingTable; + private Block Furnace; + private Block Chest; - } - } + public FurnCraftChestStructure(Block center) { + initializeBlocks(center); + } - return false; + public boolean isComplete() { + return CraftingTable.getType() == Material.WORKBENCH + && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) + && Chest.getType() == Material.CHEST; } - - public Block getInventoryBlock(Block center) { + + public void initializeBlocks(Block center) { if (center.getType() == Material.WORKBENCH) { + CraftingTable = center; for (Block b : searchForBlockOnSides(center, Material.CHEST)) { switch (center.getFace(b)) { case SOUTH: if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { - return b; + Chest = b; + Furnace = center.getRelative(BlockFace.NORTH); } case NORTH: if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { - return b; + Chest = b; + Furnace = center.getRelative(BlockFace.SOUTH); } case WEST: if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { - return b; + Chest = b; + Furnace = center.getRelative(BlockFace.EAST); } case EAST: if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { - return b; + Chest = b; + Furnace = center.getRelative(BlockFace.WEST); } } } } + } - return null; + public Block getCraftingTable() { + return CraftingTable; } - - - public Block getFurnace(Block center) { - if (center.getType() == Material.WORKBENCH) { - for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { - switch (center.getFace(b)) { - case SOUTH: - if (center.getRelative(BlockFace.NORTH).getType() == Material.CHEST) { - return b; - } - case NORTH: - if (center.getRelative(BlockFace.SOUTH).getType() == Material.CHEST) { - return b; - } - case WEST: - if (center.getRelative(BlockFace.EAST).getType() == Material.CHEST) { - return b; - } - case EAST: - if (center.getRelative(BlockFace.WEST).getType() == Material.CHEST) { - return b; - } - } - } - } + public Block getFurnace() { + return Furnace; + } - return null; + public Block getChest() { + return Chest; } } diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java index 1b3df0f4..30d5899c 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -8,8 +8,8 @@ import org.bukkit.block.BlockFace; public abstract class MultiBlockStructure { - private static LinkedList allBlockSides; - private static LinkedList northEastWestSouthSides; + protected static LinkedList allBlockSides; + protected static LinkedList northEastWestSouthSides; public static void initiliazeBlockSides() { northEastWestSouthSides = new LinkedList(); @@ -34,9 +34,9 @@ protected static List searchForBlockOnSides(Block b, Material m) { return result; } - public abstract boolean isComplete(Block center); + public abstract boolean isComplete(); - public abstract Block getInventoryBlock(Block center); + public abstract void initializeBlocks(Block start); } diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java index fd01cfb3..4a4c6ca0 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java @@ -11,8 +11,8 @@ import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.Compactor; -import com.github.igotyou.FactoryMod.Factorys.Compactor.CompactorMode; +import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; +import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor.CompactorMode; import com.google.common.collect.Lists; public class CompactorCsvReader implements IFactoryReader{ diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java index dbaf07dd..4ef8dd1a 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java @@ -10,7 +10,7 @@ import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.Compactor; +import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; public class CompactorCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java index 4eae654d..7198e7e1 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java @@ -10,8 +10,8 @@ import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory.NetherOperationMode; +import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory.NetherOperationMode; import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; import com.google.common.collect.Lists; diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java index 5cf649d5..c4f6d660 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java @@ -10,7 +10,7 @@ import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; public class NetherCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java index ee170ea1..dbc52251 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java @@ -3,12 +3,12 @@ import java.io.File; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.Compactor; import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.Factorys.NetherFactory; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; +import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; import com.github.igotyou.FactoryMod.managers.CompactorManager; import com.github.igotyou.FactoryMod.managers.IManager; import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java index ed20d0ea..226c5f29 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java @@ -10,8 +10,8 @@ import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress.OperationMode; +import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; +import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress.OperationMode; import com.google.common.collect.Lists; public class PrintingPressCsvReader implements IFactoryReader { diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java index 1d0ece2c..630c17f1 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java @@ -10,7 +10,7 @@ import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.PrintingPress; +import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; public class PrintingPressCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java index 597aa9ab..2b6e3195 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java @@ -13,7 +13,7 @@ import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.google.common.collect.Lists; diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java index ea1549af..d852be9a 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java @@ -10,7 +10,7 @@ import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ProductionFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.google.common.io.Files; diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java index f539919e..37978aa9 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java @@ -11,8 +11,8 @@ import org.bukkit.World; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory.RepairFactoryMode; +import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory.RepairFactoryMode; import com.google.common.collect.Lists; public class RepairCsvReader implements IFactoryReader{ diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java index 33cc991d..8367a5bc 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java +++ b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java @@ -10,7 +10,7 @@ import org.bukkit.Location; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.RepairFactory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; public class RepairCsvWriter implements IFactoryWriter { diff --git a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java index b5d79a63..6e5521de 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java @@ -3,12 +3,15 @@ public interface IPowerManager { public void consumeFuel(); - public boolean powerAvailable(); - public boolean fuelAvailable(); public int getPowerConsumptionIntervall(); - public int getTimeInCurrentPowerIntervall(); + public int getPowerCounter(); + + public void incrementPowerCounter(); + + public void setPowerCounter(int value); + } diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index e7944a08..60854cff 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -2,9 +2,7 @@ public interface IRecipe { - //get the recipes name, example: Iron Pickaxe public String getRecipeName(); - //get production time in update cycles public int getProductionTime(); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 54dcbebc..0c343db9 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,116 +1,49 @@ package com.github.igotyou.FactoryMod.recipes; -import java.util.ArrayList; -import java.util.List; - import org.bukkit.inventory.Inventory; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; +import com.github.igotyou.FactoryMod.utility.ItemMap; -public class ProductionRecipe implements IRecipe -{ - private String title; +public class ProductionRecipe implements IRecipe { private String recipeName; private int productionTime; - private ItemList inputs; - private ItemList upgrades; - private ItemList outputs; - private ItemList repairs; - private List outputRecipes; - private List enchantments; - private EnchantmentOptions enchantmentOptions; - private boolean useOnce; - - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList inputs,ItemList upgrades, - ItemList outputs, EnchantmentOptions enchantmentOptions, List enchantments,boolean useOnce, ItemList repairs) - { - this.title=title; + private ItemMap inputs; + private ItemMap outputs; + + public ProductionRecipe(String recipeName, int productionTime, + ItemMap inputs, ItemMap outputs) { this.recipeName = recipeName; this.productionTime = productionTime; this.inputs = inputs; - this.upgrades=upgrades; this.outputs = outputs; - this.outputRecipes=new ArrayList(); - this.enchantmentOptions = enchantmentOptions; - this.enchantments=enchantments; - this.useOnce=useOnce; - this.repairs=repairs; - } - - public ProductionRecipe(String title,String recipeName,int productionTime,ItemList repairs) - { - this(title,recipeName,productionTime,new ItemList(),new ItemList(),new ItemList(),null,new ArrayList(),false,repairs); - } - - public boolean hasMaterials(Inventory inventory) - { - return inputs.allIn(inventory)&&upgrades.oneIn(inventory)&&repairs.allIn(inventory); - } - public void addOutputRecipe(ProductionRecipe outputRecipe) - { - this.outputRecipes.add(outputRecipe); } - public ItemList getInputs() - { + public ItemMap getRawInputs() { return inputs; } - - public ItemList getUpgrades() - { - return upgrades; - } - - public ItemList getOutputs() - { + + public ItemMap getRawOutputs() { return outputs; } - - public ItemList getRepairs() - { - return repairs; - } - public List getEnchantments() - { - return enchantments; - } - - public boolean hasEnchantments() - { - return enchantments.size()>0; - } - - public String getTitle() - { - return title; - } - public String getRecipeName() - { + public String getRecipeName() { return recipeName; } - public int getProductionTime() - { + public int getProductionTime() { return productionTime; } - - public List getOutputRecipes() - { - return outputRecipes; + + public int getCurrentMultiplier(Inventory i) { + ItemMap im = new ItemMap(i); + return inputs.getMultiplesContainedIn(im); } - - public boolean getUseOnce() - { - return useOnce; + + public ItemMap getCurrentOutput(Inventory i) { + ItemMap copy = outputs.clone(); + copy.multiplyContent(getCurrentMultiplier(i)); + return copy; } - public EnchantmentOptions getEnchantmentOptions() { - if (enchantmentOptions == null) { - return EnchantmentOptions.DEFAULT; - } else { - return enchantmentOptions; - } - } + } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 71405109..694ef244 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -386,6 +386,40 @@ public boolean isContainedBy(ItemMap im) { return true; } + /** + * Checks how often this ItemMap is contained in the given ItemMap or how + * often this ItemMap could be removed from the given one before creating + * negative stacks + * + * @param im + * ItemMap to check + * @return How often this map is contained in the given one or + * Integer.MAX_VALUE if this instance is empty + */ + public int getMultiplesContainedIn(ItemMap im) { + int res = Integer.MAX_VALUE; + for (Entry entry : getEntrySet()) { + int pulledAmount = im.getAmount(entry.getKey()) != null ? im + .getAmount(entry.getKey()) : 0; + res = Math.min(res, pulledAmount); + } + return res; + } + + /** + * Multiplies the whole content of this instance by the given multiplier + * + * @param multiplier + * Multiplier to scale the amount of the contained items with + */ + public void multiplyContent(double multiplier) { + totalItems = 0; + for (Entry entry : getEntrySet()) { + items.put(entry.getKey(), (int) (entry.getValue() * multiplier)); + totalItems += (int) (entry.getValue() * multiplier); + } + } + /** * Checks whether this instance completly contains the given ItemMap, which * means every stack in the given map also exists in this instance and the From 925c01ef15f53f0f51dff8c9b83020448135885a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 9 Dec 2015 01:53:35 +0100 Subject: [PATCH 167/459] Adding Interaction manager for classic triblock factory --- .../igotyou/FactoryMod/FactoryModPlugin.java | 2 - .../FurnCraftChestFactory.java | 16 ++++ .../FurnCraftChestInteractionManager.java | 82 +++++++++++++++++++ .../igotyou/FactoryMod/recipes/IRecipe.java | 4 + .../FactoryMod/recipes/ProductionRecipe.java | 18 +++- .../repairManager/IRepairManager.java | 4 +- 6 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 168a0783..57a23466 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -32,14 +32,12 @@ import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; import com.github.igotyou.FactoryMod.properties.IFactoryProperties; import com.github.igotyou.FactoryMod.properties.CompactorProperties; -import com.github.igotyou.FactoryMod.properties.NetherFactoryProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; import com.github.igotyou.FactoryMod.properties.ProductionProperties; import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.ItemList; import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.google.common.collect.Lists; import com.google.common.collect.Maps; diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java index 9b729467..5a32dbf3 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -16,6 +16,7 @@ import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; /** @@ -76,6 +77,7 @@ public void attemptToActivate(Player p) { public void activate() { // lots of code to make the furnace light up, without loosing contents. active = true; + pm.setPowerCounter(0); Furnace furnace = (Furnace) (getFurnace().getState()); byte data = furnace.getData().getData(); ItemStack[] oldContents = furnace.getInventory().getContents(); @@ -195,6 +197,20 @@ else if (currentProductionTimer >= currentRecipe } } + public List getRecipes() { + return recipes; + } + + public IRecipe getCurrentRecipe() { + return currentRecipe; + } + + public void setRecipe(IRecipe pr) { + if (recipes.contains(pr)) { + currentRecipe = pr; + } + } + public abstract boolean hasInputMaterials(); public abstract void applyRecipeEffect(); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java new file mode 100644 index 00000000..0175d98b --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -0,0 +1,82 @@ +package com.github.igotyou.FactoryMod.interactionManager; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.bukkit.ChatColor; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryType; + +import vg.civcraft.mc.civmodcore.inventorygui.Clickable; +import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; + +import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.recipes.IRecipe; + +public class FurnCraftChestInteractionManager implements IInteractionManager { + private FurnCraftChestFactory fccf; + private ClickableInventory ci; + private HashMap recipes = new HashMap(); + + public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { + this.fccf = fccf; + } + + public void blockBreak(Player p, Block b) { + fccf.getRepairManager().breakIt(); + if (p != null) { + p.sendMessage(ChatColor.DARK_RED + + "You broke the factory, it is in disrepair now"); + } + } + + public void leftClick(Player p, Block b) { + if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getChest()) { // chest interaction + // TODO Display information + + return; + } + if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getCraftingTable()) { // crafting table interaction + ArrayList clickables = new ArrayList(); + for (IRecipe recipe : fccf.getRecipes()) { + Clickable c = new Clickable(recipe.getItemRepresentation()) { + + @Override + public void clicked(Player p) { + if (fccf.isActive()) { + p.sendMessage(ChatColor.RED + + "You can't switch recipes while the factory is running"); + } else { + fccf.setRecipe(recipes.get(this)); + } + + } + }; + recipes.put(c, recipe); + clickables.add(c); + } + ci = new ClickableInventory(clickables, InventoryType.CHEST, + "Select a recipe"); + ci.showInventory(p); + return; + } + if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getFurnace()) { // furnace interaction + if (fccf.isActive()) { + fccf.deactivate(); + } else { + fccf.attemptToActivate(p); + } + } + } + + public void rightClick(Player p, Block b) { + // Nothing to do here, every block already has a right click + // functionality + } + +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index 60854cff..4447524c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -1,8 +1,12 @@ package com.github.igotyou.FactoryMod.recipes; +import org.bukkit.inventory.ItemStack; + public interface IRecipe { public String getRecipeName(); public int getProductionTime(); + + public ItemStack getItemRepresentation(); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 0c343db9..998c115b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,6 +1,10 @@ package com.github.igotyou.FactoryMod.recipes; +import java.util.LinkedList; + +import org.bukkit.Material; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.utility.ItemMap; @@ -9,6 +13,7 @@ public class ProductionRecipe implements IRecipe { private int productionTime; private ItemMap inputs; private ItemMap outputs; + private ItemStack itemRepresentation; public ProductionRecipe(String recipeName, int productionTime, ItemMap inputs, ItemMap outputs) { @@ -16,6 +21,13 @@ public ProductionRecipe(String recipeName, int productionTime, this.productionTime = productionTime; this.inputs = inputs; this.outputs = outputs; + LinkedList outputRepresentation = outputs.getItemStackRepresentation(); + if (outputRepresentation.size() != 0) { + itemRepresentation = outputRepresentation.get(0); + } + else { + itemRepresentation = new ItemStack(Material.STONE); + } } public ItemMap getRawInputs() { @@ -43,7 +55,9 @@ public ItemMap getCurrentOutput(Inventory i) { ItemMap copy = outputs.clone(); copy.multiplyContent(getCurrentMultiplier(i)); return copy; - } - + } + public ItemStack getItemRepresentation() { + return itemRepresentation; + } } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java index 06b17fea..5650ebce 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -1,7 +1,9 @@ package com.github.igotyou.FactoryMod.repairManager; public interface IRepairManager { - public int getHealth(); + public void breakIt(); + + public String getHealth(); public boolean atFullHealth(); From 5ec9dc7410ee6601b0524b035057036b2ee45a03 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 9 Dec 2015 03:03:38 +0100 Subject: [PATCH 168/459] Fixing listener and starting to rework manager, but it's completly broken in this commit --- .../{Contraption.java => Factory.java} | 4 +- .../igotyou/FactoryMod/FactoryModManager.java | 54 +- .../FurnCraftChestFactory.java | 4 +- .../listeners/FactoryModListener.java | 525 ++++-------------- .../managers/FactoryManagerService.java | 218 -------- .../managers/ProductionFactoryManager.java | 135 ----- .../properties/ProductionProperties.java | 54 -- 7 files changed, 127 insertions(+), 867 deletions(-) rename src/com/github/igotyou/FactoryMod/{Contraption.java => Factory.java} (91%) delete mode 100644 src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java diff --git a/src/com/github/igotyou/FactoryMod/Contraption.java b/src/com/github/igotyou/FactoryMod/Factory.java similarity index 91% rename from src/com/github/igotyou/FactoryMod/Contraption.java rename to src/com/github/igotyou/FactoryMod/Factory.java index 7f853b18..2a0e7168 100644 --- a/src/com/github/igotyou/FactoryMod/Contraption.java +++ b/src/com/github/igotyou/FactoryMod/Factory.java @@ -7,7 +7,7 @@ import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -public abstract class Contraption implements Runnable{ +public abstract class Factory implements Runnable{ protected IInteractionManager im; protected IRepairManager rm; protected IPowerManager pm; @@ -15,7 +15,7 @@ public abstract class Contraption implements Runnable{ protected MultiBlockStructure mbs; protected int updateTime; - public Contraption(IInteractionManager im, IRepairManager rm, + public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, MultiBlockStructure mbs, int updateTime) { this.im = im; this.rm = rm; diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index d5c68606..3f5d4a55 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -14,36 +14,40 @@ import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.properties.AFactoryProperties; +import com.github.igotyou.FactoryMod.utility.ItemMap; public abstract class FactoryModManager { protected FactoryModPlugin plugin; - private HashMap contraptions = new HashMap(); - private HashMap> locations = new HashMap>(); + private HashMap factoryCreationRecipes = new HashMap(); + private HashMap> locations = new HashMap>(); private HashSet possibleCenterBlocks; - private List possibleStructures; + private HashSet possibleInteractionBlock; public FactoryModManager(FactoryModPlugin plugin) { this.plugin = plugin; // Normal furnace, craftingtable, chest factories - possibleStructures.add(new FurnCraftChestStructure()); possibleCenterBlocks.add(Material.WORKBENCH); + possibleInteractionBlock.add(Material.WORKBENCH); + possibleInteractionBlock.add(Material.FURNACE); + possibleInteractionBlock.add(Material.BURNING_FURNACE); + possibleInteractionBlock.add(Material.CHEST); } - public void addContraption(Contraption c, AFactoryProperties prop) { + public void addFactory(Factory c, AFactoryProperties prop) { contraptions.put(c, prop); } - public void removeContraption(Contraption c) { + public void removeFactory(Factory c) { contraptions.remove(c); } - public Contraption getFactoryAt(Location loc) { + public Factory getFactoryAt(Location loc) { return getFactoryAt(loc.getBlock()); } - public Contraption getFactoryAt(Block b) { - HashMap forThisType = locations.get(b.getType()); + public Factory getFactoryAt(Block b) { + HashMap forThisType = locations.get(b.getType()); if (forThisType == null) { return null; } else { @@ -51,11 +55,11 @@ public Contraption getFactoryAt(Block b) { } } - public void addContraptionBlock(Block b, Contraption c) { - HashMap requiredMaterial = locations.get(b - .getType()); + public void addFactoryBlock(Block b, Factory c) { + HashMap requiredMaterial = locations + .get(b.getType()); if (requiredMaterial == null) { - requiredMaterial = new HashMap(); + requiredMaterial = new HashMap(); } requiredMaterial.put(b.getLocation(), c); } @@ -65,19 +69,21 @@ public boolean factoryExistsAt(Location loc) { } public void attemptCreation(Block b, Player p) { - if (possibleCenterBlocks.contains(b.getType()) - && !factoryExistsAt(b.getLocation())) { - for (MultiBlockStructure mbs : possibleStructures) { - if (mbs.isComplete(b)) { - Block invBlock = mbs.getInventoryBlock(b); - if (invBlock != null) { - Inventory inv = ((InventoryHolder) (invBlock.getState())) - .getInventory(); - //ItemMap here - } - } + if (!factoryExistsAt(b.getLocation())) { + // Cycle through possible structures here + FurnCraftChestStructure fccs = new FurnCraftChestStructure(b); + if (fccs.isComplete()) { + } } } + + public boolean isPossibleCenterBlock(Material m) { + return possibleCenterBlocks.contains(m); + } + + public boolean isPossibleInteractionBlock(Material m) { + return possibleInteractionBlock.contains(m); + } } diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java index 5a32dbf3..0e579513 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -10,7 +10,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.Contraption; +import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; @@ -25,7 +25,7 @@ * which is used as inventory holder * */ -public abstract class FurnCraftChestFactory extends Contraption { +public abstract class FurnCraftChestFactory extends Factory { protected int currentProductionTimer = 0; protected List recipes; protected IRecipe currentRecipe; diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index a00096c1..d0035d3a 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -3,6 +3,7 @@ import java.util.List; import net.minecraft.server.v1_8_R3.ItemStack; +import net.minecraft.server.v1_8_R3.PossibleFishingResult; import org.bukkit.Location; import org.bukkit.Material; @@ -32,505 +33,165 @@ import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; +import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; -import com.github.igotyou.FactoryMod.managers.FactoryManagerService; import com.github.igotyou.FactoryMod.utility.InteractionResponse; import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; import com.github.igotyou.FactoryMod.utility.StringUtils; -public class FactoryModListener implements Listener -{ - private FactoryManagerService factoryMan; +public class FactoryModListener implements Listener { + private FactoryModManager manager; private ReinforcementManager rm = Citadel.getReinforcementManager(); - - /** - * Constructor - */ - public FactoryModListener(FactoryManagerService factoryManager) - { - this.factoryMan = factoryManager; - } - - private boolean isPotentialFactoryBlock(Block block) { - return block.getType() == FactoryModPlugin.CENTRAL_BLOCK_MATERIAL || block.getType() == Material.IRON_BLOCK || block.getType() == Material.CHEST|| - block.getType() == Material.FURNACE || block.getType() == Material.BURNING_FURNACE; + + public FactoryModListener(FactoryModManager manager) { + this.manager = manager; } - + /** - * Called when a block is broken - * If the block that is destroyed is part of a factory, call the required methods. + * Called when a block is broken If the block that is destroyed is part of a + * factory, call the required methods. */ @EventHandler - public void blockBreakEvent(BlockBreakEvent e) - { + public void blockBreakEvent(BlockBreakEvent e) { Block block = e.getBlock(); - //Is the block part of a factory? - if(isPotentialFactoryBlock(block)) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - //if the blocks is not reinforced destroy it - if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) - { - if(e.getPlayer() == null) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") - .append(e.getBlock().getType()) - .append(" at ") - .append(StringUtils.formatCoords(block.getLocation())) - .toString()); - } - else - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block broken: ") - .append(e.getBlock().getType()) - .append(" by ") - .append(e.getPlayer().getUniqueId()) - .append(" at ") - .append(StringUtils.formatCoords(block.getLocation())) - .toString()); - } - destroyFactoryAt(block); - } - } - } - } - - private void destroyFactoryAt(Block block) { - //Is the factory a production factory? - if (factoryMan.factoryExistsAt(block.getLocation())) - { - IFactory factory = factoryMan.getFactory(block.getLocation()); - factory.destroy(block.getLocation()); - if(FactoryModPlugin.DESTRUCTIBLE_FACTORIES) - { - //TODO: factoryMan.getManager(block.getLocation()).removeFactory(factory); + if (manager.isPossibleInteractionBlock(block.getType()) + && ((FactoryModPlugin.CITADEL_ENABLED && !rm + .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + c.getInteractionManager().blockBreak(e.getPlayer(), block); } } + } - + /** - * Called when a entity explodes(creeper,tnt etc.) - * Nearly the same as blockBreakEvent + * Called when a entity explodes(creeper,tnt etc.) Nearly the same as + * blockBreakEvent */ @EventHandler - public void explosionListener(EntityExplodeEvent e) - { + public void explosionListener(EntityExplodeEvent e) { List blocks = e.blockList(); - for (Block block : blocks) - { - if(isPotentialFactoryBlock(block)) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - if ((FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block exploded: ") - .append(block.getType()) - .append(" by ") - .append(e.getEntityType()) - .append(" at ") - .append(StringUtils.formatCoords(block.getLocation())) - .toString()); - destroyFactoryAt(block); - } + for (Block block : blocks) { + if (manager.isPossibleInteractionBlock(block.getType()) + && ((FactoryModPlugin.CITADEL_ENABLED && !rm + .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + c.getInteractionManager().blockBreak(null, block); } } } } - + /** - * Called when a block burns - * Nearly the same as blockBreakEvent + * Called when a block burns Nearly the same as blockBreakEvent */ @EventHandler - public void burnListener(BlockBurnEvent e) - { + public void burnListener(BlockBurnEvent e) { Block block = e.getBlock(); - if (factoryMan.factoryExistsAt(block.getLocation())) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory block burned: ") - .append(block.getType()) - .append(" at ") - .append(StringUtils.formatCoords(block.getLocation())) - .toString()); - destroyFactoryAt(block); + if (manager.isPossibleInteractionBlock(block.getType()) + && ((FactoryModPlugin.CITADEL_ENABLED && !rm + .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + c.getInteractionManager().blockBreak(null, block); } } } - - /** - * Called when a player left or right clicks. - * Takes care of cycling recipes turning factory's on and off, etc. - */ - @EventHandler - public void playerInteractionEvent(PlayerInteractEvent e) - { - Block clicked = e.getClickedBlock(); + + + public void playerInteract(PlayerInteractEvent e) { + Block block = e.getClickedBlock(); Player player = e.getPlayer(); - - //if the player left clicked a block - if (e.getAction().equals(Action.LEFT_CLICK_BLOCK)) - { - //If the player was holding a item matching the interaction material - if (player.getItemInHand().getType() == FactoryModPlugin.FACTORY_INTERACTION_MATERIAL) - { - //If the material which was clicked is the central block material - if (clicked.getType() == FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) - { - //is there a factory at the clicked location? - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - //if the factory has all its blocks - if(factoryMan.factoryWholeAt(clicked.getLocation())) - { - //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || - (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) - { - //if there is a production Factory at the clicked location - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - IFactory factory = factoryMan.getFactory(clicked.getLocation()); - //toggle the recipe, and print the returned message. - InteractionResponse.messagePlayerResults(player, factory.getCentralBlockResponse()); - } - } - //if the player does NOT have acssess to the block that was clicked - else - { - //return a error message - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You do not have permission to use this factory!" )); - } - } - else - { - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"Factory blocks are misplaced!" )); - } - } - //if no factory exists at the clicked location - else - { - //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || - (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) - { - InteractionResponse.messagePlayerResult(player, createFactory(clicked.getLocation(), player)); - } - //if the player does NOT have acssess to the block that was clicked - else - { - //return a error message - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You do not have permission to use this factory!" )); - } - } - } - //if the clicked block is a furnace - else if (clicked.getType() == Material.FURNACE || clicked.getType() == Material.BURNING_FURNACE) - { - //if there is a factory at that location and it has all its blocks - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - if(factoryMan.factoryWholeAt(clicked.getLocation())) - { - //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || - (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) - { - InteractionResponse.messagePlayerResults(player,(factoryMan.getFactory(clicked.getLocation())).togglePower()); - } - //if the player is NOT allowed to interact with the clicked block. - else - { - //return error message - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You do not have permission to use this factory!" )); - } - } - else - { - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"Factory blocks are misplaced!" )); - } - } - } - //if the block clicked is a chest - else if (clicked.getType() == Material.CHEST) - { - //is there a factory there? and if it has all its blocks - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - if(factoryMan.factoryWholeAt(clicked.getLocation())) - { - //if the player is allowed to interact with that block? - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || - (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(player))) - { - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - InteractionResponse.messagePlayerResults(player,(factoryMan.getFactory(clicked.getLocation())).getChestResponse()); - } - } - //if the player is NOT allowed to interact with the clicked block - else - { - //return error message - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You do not have permission to use this factory!" )); - } - } - else - { - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"Factory blocks are misplaced!" )); - } - - } - } - else if (clicked.getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - if(factoryMan.getFactory(clicked.getLocation()).getClass() == NetherFactory.class) - { - NetherFactory netherFactory = (NetherFactory) factoryMan.getFactory(clicked.getLocation()); - if (FactoryModPlugin.REGENERATE_TELEPORT_BLOCK_ON_TELEPORT) - { - netherFactory.regenerateTeleportBlock(clicked.getLocation()); - } - if(factoryMan.factoryWholeAt(clicked.getLocation())) - { - //toggle the recipe, and print the returned message. - InteractionResponse.messagePlayerResults(player, netherFactory.getTeleportationBlockResponse(player, clicked.getLocation())); - e.setCancelled(true); - } - } - } + if (manager.isPossibleInteractionBlock(block.getType()) + && player.getItemInHand().getType() == FactoryModPlugin.FACTORY_INTERACTION_MATERIAL) { + Factory c = manager.getFactoryAt(block); + if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { + if (c != null) { + c.getInteractionManager().rightClick(player, block); } } - else if (player.getItemInHand().getType() == Material.PAPER) - { - if (clicked.getType() == FactoryModPlugin.NETHER_FACTORY_TELEPORT_PLATFORM_MATERIAL) - { - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - if(factoryMan.getFactory(clicked.getLocation()).getClass() == NetherFactory.class) - { - NetherFactory netherFactory = (NetherFactory) factoryMan.getFactory(clicked.getLocation()); - if (FactoryModPlugin.REGENERATE_TELEPORT_BLOCK_ON_TELEPORT) - { - netherFactory.regenerateTeleportBlock(clicked.getLocation()); - } - if(factoryMan.factoryWholeAt(clicked.getLocation())) - { - //toggle the recipe, and print the returned message. - InteractionResponse.messagePlayerResults(player, netherFactory.getTeleportationBlockResponse(player, clicked.getLocation())); - e.setCancelled(true); - } - } - } - } - } - } - /* Section commented out since there exists range of bugs that circumvent - * this protection and this protection should not be necessary - * it will only complicate and obfuscate possible workaround bugs - //if the player right clicked a block - else if(e.getAction() == Action.RIGHT_CLICK_BLOCK) - { - //if the player right clicked a chest - if (clicked.getType() == Material.CHEST) - { - //is the chest part of a factory? and does the factory have all its blocks - if (factoryMan.factoryExistsAt(clicked.getLocation())&&factoryMan.factoryWholeAt(clicked.getLocation())) - { - //if the player is allowed to interact with that block. - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) - { - if (productionMan.factoryExistsAt(clicked.getLocation())) - { - ProductionFactory production = (ProductionFactory) productionMan.getFactory(clicked.getLocation()); - //is the factory turned on? - if (production.getActive() == true) - { - //return error message - InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You can't access the chest while the factory is active! Turn it off first!" )); - e.setCancelled(true); - } - } - } - //if the player is NOT allowed to interact with the block - else - { - //No need to get 2 messages, citadel already does 1. e InteractionResponse.messagePlayerResult(player, new InteractionResponse(InteractionResult.FAILURE,"You do not have permission to use that block!" )); + if (e.getAction() == Action.LEFT_CLICK_BLOCK) { + if (c == null) { + if (manager.isPossibleCenterBlock(block.getType())) { + manager.attemptCreation(block, player); } + } else { + c.getInteractionManager().leftClick(player, block); } + } } - */ - } - private Location westLoc(Location loc) - { - Location newLoc = loc.clone(); - newLoc.add(-1, 0, 0); - return newLoc; - } - private Location eastLoc(Location loc) - { - Location newLoc = loc.clone(); - newLoc.add(1, 0, 0); - return newLoc; } - private Location northLoc(Location loc) - { - Location newLoc = loc.clone(); - newLoc.add(0, 0, -1); - return newLoc; - } - private Location southLoc(Location loc) - { - Location newLoc = loc.clone(); - newLoc.add(0, 0, 1); - return newLoc; - } - - private InteractionResponse createFactory(Location loc, Player player) - { - Location northLocation = northLoc(loc); - Location southLocation = southLoc(loc); - Location eastLocation = eastLoc(loc); - Location westLocation = westLoc(loc); - - Block northBlock = northLocation.getBlock(); - Block southBlock = southLocation.getBlock(); - Block eastBlock = eastLocation.getBlock(); - Block westBlock = westLocation.getBlock(); - - Material northType = northBlock.getType(); - Material southType = southBlock.getType(); - Material eastType = eastBlock.getType(); - Material westType = westBlock.getType(); - - //For each two orientations check if a factory exists at any of the locations - //For each of the four permutations check if the correct blocks are present - //This still allows a double chest to be shared between two factories, which may lead to undesirable behavior - InteractionResponse response=new InteractionResponse(InteractionResult.FAILURE, "Blocks are not arranged correctly for a factory."); - if(! factoryMan.factoryExistsAt(westLocation) && ! factoryMan.factoryExistsAt(eastLocation)) - { - if((westType == Material.FURNACE || westType == Material.BURNING_FURNACE) && eastType == Material.CHEST) - { - return createFactory(player, loc, eastLocation, westLocation); - } - else if ((eastType == Material.FURNACE || eastType == Material.BURNING_FURNACE) && westType == Material.CHEST) - { - return createFactory(player, loc, westLocation, eastLocation); - } - } - else - { - response=new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - if(! factoryMan.factoryExistsAt(southLocation) && !factoryMan.factoryExistsAt(northLocation)) - { - - if((northType == Material.FURNACE || northType == Material.BURNING_FURNACE) && southType == Material.CHEST) - { - return createFactory(player, loc, southLocation, northLocation); - } - else if((southType == Material.FURNACE || southType == Material.BURNING_FURNACE) && northType == Material.CHEST) - { - return createFactory(player, loc, northLocation, southLocation); - } - } - else - { - response=new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - return response; - } - - private InteractionResponse createFactory(Player player, Location center, Location inventory, Location power) { - if(rm.isReinforced(center)) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") - .append(player.getUniqueId()) - .append(" with group ") - .append(((PlayerReinforcement)rm.getReinforcement(center)).getGroup().getName()) - .append(" at ") - .append(StringUtils.formatCoords(center)) - .toString()); - } else { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("Factory creation attempted: ") - .append(player.getUniqueId()) - .append(" at ") - .append(StringUtils.formatCoords(center)) - .toString()); - } - return factoryMan.createFactory(center, inventory, power); - } - @EventHandler(priority = EventPriority.NORMAL) public void handlePortalTelportEvent(PlayerPortalEvent e) { if (e.isCancelled()) { return; } - + // Disable normal nether portal teleportation - if (e.getCause() == TeleportCause.NETHER_PORTAL && FactoryModPlugin.DISABLE_PORTALS) { + if (e.getCause() == TeleportCause.NETHER_PORTAL + && FactoryModPlugin.DISABLE_PORTALS) { e.setCancelled(true); } } - + @EventHandler(priority = EventPriority.NORMAL) public void playerTeleportEvent(PlayerTeleportEvent e) { if (e.isCancelled() || e.getCause() != TeleportCause.NETHER_PORTAL) { return; } - + // Disable normal nether portal teleportation if (FactoryModPlugin.DISABLE_PORTALS) { e.setCancelled(true); } } - + @EventHandler(priority = EventPriority.NORMAL) - public void entityTeleportEvent(EntityPortalEvent event){ + public void entityTeleportEvent(EntityPortalEvent event) { if (FactoryModPlugin.DISABLE_PORTALS) { event.setCancelled(true); } } /** - * Turns slabs with the lore "Smooth double slab" into smooth double slab blocks and logs - * with the lore "6-sided log" into logs with the log texture on all 6 sides + * Turns slabs with the lore "Smooth double slab" into smooth double slab + * blocks and logs with the lore "6-sided log" into logs with the log + * texture on all 6 sides + * * @param e */ @EventHandler public void onSpecialBlockUse(BlockPlaceEvent e) { org.bukkit.inventory.ItemStack is = e.getItemInHand(); - if (!is.hasItemMeta() || !is.getItemMeta().hasLore()) { - return; - } - Material material = e.getBlock().getType(); - ItemMeta blockMeta = is.getItemMeta(); - switch (material) { - case STEP: - if (blockMeta.getLore().get(0).equals("Smooth double slab")) { - byte type = (byte)(is.getDurability() + 8); - e.getBlock().setTypeIdAndData(Material.DOUBLE_STEP.getId(),type,true); - } - break; - case LOG: - case LOG_2: - if (blockMeta.getLore().get(0).equals("Sixsided log")) { - byte type = (byte)((is.getDurability()%4)+12); - e.getBlock().setTypeIdAndData(material.getId(),type,true); - } - - break; - default: - return; - } - -} + if (!is.hasItemMeta() || !is.getItemMeta().hasLore()) { + return; + } + Material material = e.getBlock().getType(); + ItemMeta blockMeta = is.getItemMeta(); + switch (material) { + case STEP: + if (blockMeta.getLore().get(0).equals("Smooth double slab")) { + byte type = (byte) (is.getDurability() + 8); + e.getBlock().setTypeIdAndData(Material.DOUBLE_STEP.getId(), + type, true); + } + break; + case LOG: + case LOG_2: + if (blockMeta.getLore().get(0).equals("Sixsided log")) { + byte type = (byte) ((is.getDurability() % 4) + 12); + e.getBlock().setTypeIdAndData(material.getId(), type, true); + } + + break; + default: + return; + } + + } } diff --git a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java b/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java deleted file mode 100644 index 82dfee46..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryManagerService.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.event.Listener; - -import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; - -//original file: -/** - * MachinesManager.java - * Purpose: Manages the initialization and updating of all managers. - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -//edited file: -/** - * FactorysManager.java - * Purpose: Manages the initialization and updating of all managers. - * @author igotyou - * - */ -public class FactoryManagerService -{ - List listeners; - List> managers; - - /** - * The plugin instance - */ - FactoryModPlugin plugin; - - public static FactoryManagerService factoryMan; - - /** - * Constructor - */ - public FactoryManagerService(FactoryModPlugin plugin) - { - FactoryModPlugin.sendConsoleMessage("Initiaiting FactoryMod Managers."); - - this.plugin = plugin; - FactoryManagerService.factoryMan = this; - - initializeManagers(); - loadManagers(); - periodicSaving(); - FactoryModPlugin.sendConsoleMessage("Finished initializing FactoryMod Managers."); - } - - /** - * Initializes the necassary managers for enabled factorys - */ - private void initializeManagers() - { - managers = new ArrayList>(); - listeners = new ArrayList(); - - managers.add(new ProductionFactoryManager(plugin)); - managers.add(new PrintingPressManager(plugin)); - managers.add(new RepairFactoryManager(plugin)); - managers.add(new CompactorManager(plugin)); - managers.add(new NetherFactoryManager(plugin)); - } - - /** - * When plugin disabled, this is called. - */ - public void onDisable() - { - saveManagers(); - } - - /** - * Saves all managers - */ - private void saveManagers() - { - for (IManager manager : managers) - { - manager.save(); - } - } - - /** - * Loads all managers - */ - private void loadManagers() - { - for (IManager manager : managers) - { - manager.load(); - } - } - - /** - * Returns the appropriate manager depending on the given Manager Type - * @param - */ - public IManager getManager(Class factoryClass) - { - for (IManager manager : managers) - { - if (manager.getFactoryType() == factoryClass) - { - return manager; - } - } - - return null; - } - - /** - * Save Factories to file every SAVE_CYCLE minutes. - */ - private void periodicSaving() - { - Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { - @Override - public void run() - { - FactoryModPlugin.sendConsoleMessage("Saving Factory data..."); - saveManagers(); - } - }, (FactoryModPlugin.SAVE_CYCLE), - FactoryModPlugin.SAVE_CYCLE); - } - - /** - * Returns the Factory Saves file - */ - public File getSavesFile(String fileName) - { - return new File(plugin.getDataFolder(), fileName + ".txt"); - } - - /** - * Returns whether a factory exists at given location in any manager - */ - public boolean factoryExistsAt(Location location) - { - for (IManager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return true; - } - } - return false; - } - - /** - * Returns whether a factory is whole at given location in any manager - */ - public boolean factoryWholeAt(Location location) - { - for (IManager manager : managers) - { - if (manager.factoryWholeAt(location)) - { - return true; - } - } - return false; - } - - public IFactory getFactory(Location location) { - for (IManager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return manager.getFactory(location); - } - } - return null; - } - - public IManager getManager(Location location) { - for (IManager manager : managers) - { - if (manager.factoryExistsAt(location)) - { - return manager; - } - } - return null; - } - - public InteractionResponse createFactory(Location centralLocation, - Location inventoryLocation, Location powerLocation) { - InteractionResponse response = null; - for (IManager manager : managers) - { - response = manager.createFactory(centralLocation, inventoryLocation, powerLocation); - if (response.getInteractionResult() == InteractionResult.SUCCESS) - { - return response; - } - } - - if (response == null) { - response = new InteractionResponse(InteractionResult.FAILURE, "Couldn't create a factory, invalid ingredients"); - } - - FactoryModPlugin.sendConsoleMessage("The factory could not be created: " + response.getInteractionMessage()); - return response; - } -} diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java deleted file mode 100644 index 1c8a9c0e..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionFactoryManager.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import java.util.Map; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ - -public class ProductionFactoryManager extends FactoryModManager -{ - @Override - public Class getFactoryType() { - return ProductionFactory.class; - } - //private List producers; - - public ProductionFactoryManager(FactoryModPlugin plugin) - { - super(plugin); - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) - { - if (!factoryExistsAt(factoryLocation)) - { - Map properties = FactoryModPlugin.productionProperties; - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - String subFactoryType = null; - for (Map.Entry entry : properties.entrySet()) - { - ItemList inputs = entry.getValue().getInputs(); - if(inputs.exactlyIn(chestInventory)) - { - subFactoryType = entry.getKey(); - } - } - if (subFactoryType != null) - { - ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); - if (properties.get(subFactoryType).getInputs().allIn(production.getInventory())) - { - addFactory(production); - properties.get(subFactoryType).getInputs().removeFrom(production.getInventory()); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + production.getProductionFactoryProperties().getName()); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly."); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation, int productionTimer, int energyTimer) - { - if (!factoryExistsAt(factoryLocation)) - { - Map properties = FactoryModPlugin.productionProperties; - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - String subFactoryType = null; - boolean hasMaterials = true; - for (Map.Entry entry : properties.entrySet()) - { - ItemList inputs = entry.getValue().getInputs(); - if(!inputs.allIn(chestInventory)) - { - hasMaterials = false; - } - if (hasMaterials == true) - { - subFactoryType = entry.getKey(); - } - } - if (hasMaterials && subFactoryType != null) - { - ProductionFactory production = new ProductionFactory(factoryLocation, inventoryLocation, powerSourceLocation,subFactoryType); - if (properties.get(subFactoryType).getInputs().removeFrom(production.getInventory())) - { - addFactory(production); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + subFactoryType + " production factory"); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - - public boolean isClear(ProductionFactory factory){ - return factory.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(factory.getCenterLocation())) - || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation()); - } - - @Override - public ProductionFactory getFactory(Location factoryLocation) - { - for (ProductionFactory production : factories) - { - if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) - || production.getPowerSourceLocation().equals(factoryLocation)) - return production; - } - return null; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java b/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java deleted file mode 100644 index a6ebc6db..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -import java.util.List; - -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - - -public class ProductionProperties extends AFactoryProperties -{ - private ItemList inputs; - private List recipes; - private ItemList fuel; - private int energyTime; - private int repair; - - public ProductionProperties(ItemList inputs, List recipes, - ItemList fuel, int energyTime, String name,int repair) - { - this.inputs = inputs; - this.recipes = recipes; - this.fuel = fuel; - this.energyTime = energyTime; - this.name = name; - this.repair=repair; - } - - public int getRepair() - { - return repair; - } - - public ItemList getInputs() - { - return inputs; - } - - public List getRecipes() - { - return recipes; - } - - public ItemList getFuel() - { - return fuel; - } - - public int getEnergyTime() - { - return energyTime; - } - -} From 1be542e7198b4d577243702b62066cae68b98dd6 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 00:51:55 +0100 Subject: [PATCH 169/459] Completing manager structure and implementing recipes --- .../github/igotyou/FactoryMod/Factory.java | 8 +- .../igotyou/FactoryMod/FactoryModManager.java | 58 ++++-- .../FurnCraftChestFactory.java | 31 +++- .../ProductionFactory.java | 54 ------ .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 11 ++ .../FactoryMod/managers/CompactorManager.java | 73 -------- .../managers/PrintingPressManager.java | 90 --------- .../managers/RepairFactoryManager.java | 73 -------- .../FurnCraftChestStructure.java | 11 ++ .../MultiBlockStructure.java | 2 + .../persistence/CompactorCsvReader.java | 104 ----------- .../persistence/CompactorCsvWriter.java | 81 --------- .../FactoryMod/persistence/FactoryDao.java | 25 --- .../FactoryMod/persistence/FileBackup.java | 28 --- .../FactoryMod/persistence/IFactoryCodec.java | 11 -- .../persistence/IFactoryReader.java | 11 -- .../persistence/IFactoryWriter.java | 11 -- .../persistence/NetherCsvReader.java | 109 ----------- .../persistence/NetherCsvWriter.java | 114 ------------ .../persistence/PersistenceFactory.java | 50 ----- .../persistence/PrintingPressCsvReader.java | 123 ------------- .../persistence/PrintingPressCsvWriter.java | 122 ------------- .../persistence/ProductionCsvReader.java | 172 ------------------ .../persistence/ProductionCsvWriter.java | 116 ------------ .../persistence/RepairCsvReader.java | 104 ----------- .../persistence/RepairCsvWriter.java | 81 --------- .../properties/AFactoryProperties.java | 10 - .../properties/CompactorProperties.java | 129 ------------- .../properties/IFactoryProperties.java | 22 --- .../properties/RepairFactoryProperties.java | 123 ------------- .../FactoryMod/recipes/CompactingRecipe.java | 130 +++++++++++++ .../recipes/DecompactingRecipe.java | 118 ++++++++++++ .../igotyou/FactoryMod/recipes/IRecipe.java | 7 +- .../FactoryMod/recipes/InputOutputRecipe.java | 73 ++++++++ .../FactoryMod/recipes/ProductionRecipe.java | 94 +++++----- .../FactoryMod/utility/AdvancedItemStack.java | 52 ------ .../utility/InteractionResponse.java | 86 --------- .../igotyou/FactoryMod/utility/ItemMap.java | 27 ++- 38 files changed, 499 insertions(+), 2045 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java create mode 100644 src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/CompactorManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/FileBackup.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java delete mode 100644 src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java create mode 100644 src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java create mode 100644 src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java create mode 100644 src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/InteractionResponse.java diff --git a/src/com/github/igotyou/FactoryMod/Factory.java b/src/com/github/igotyou/FactoryMod/Factory.java index 2a0e7168..279db211 100644 --- a/src/com/github/igotyou/FactoryMod/Factory.java +++ b/src/com/github/igotyou/FactoryMod/Factory.java @@ -14,14 +14,16 @@ public abstract class Factory implements Runnable{ protected boolean active; protected MultiBlockStructure mbs; protected int updateTime; + protected String name; public Factory(IInteractionManager im, IRepairManager rm, - IPowerManager pm, MultiBlockStructure mbs, int updateTime) { + IPowerManager pm, MultiBlockStructure mbs, int updateTime, String name) { this.im = im; this.rm = rm; this.mbs = mbs; this.pm = pm; this.updateTime = updateTime; + this.name = name; } public IRepairManager getRepairManager() { @@ -47,6 +49,10 @@ public MultiBlockStructure getMultiBlockStructure() { public int getUpdateTime() { return updateTime; } + + public String getName() { + return name; + } public abstract void activate(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 3f5d4a55..07e64c89 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -2,25 +2,23 @@ import java.util.HashMap; import java.util.HashSet; -import java.util.List; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.properties.AFactoryProperties; import com.github.igotyou.FactoryMod.utility.ItemMap; public abstract class FactoryModManager { protected FactoryModPlugin plugin; - private HashMap factoryCreationRecipes = new HashMap(); - private HashMap> locations = new HashMap>(); + private HashMap, HashMap> factoryCreationRecipes; + private HashMap> locations; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; @@ -34,12 +32,24 @@ public FactoryModManager(FactoryModPlugin plugin) { possibleInteractionBlock.add(Material.CHEST); } - public void addFactory(Factory c, AFactoryProperties prop) { - contraptions.put(c, prop); + public void addFactory(Factory f) { + for (Block b : f.getMultiBlockStructure().getAllBlocks()) { + HashMap forThatMaterial = locations.get(b + .getType()); + if (forThatMaterial == null) { + forThatMaterial = new HashMap(); + locations.put(b.getType(), forThatMaterial); + } + forThatMaterial.put(b.getLocation(), f); + } } - public void removeFactory(Factory c) { - contraptions.remove(c); + public void removeFactory(Factory f) { + for (Block b : f.getMultiBlockStructure().getAllBlocks()) { + HashMap forThatMaterial = locations.get(b + .getType()); + forThatMaterial.remove(b.getLocation()); + } } public Factory getFactoryAt(Location loc) { @@ -55,15 +65,6 @@ public Factory getFactoryAt(Block b) { } } - public void addFactoryBlock(Block b, Factory c) { - HashMap requiredMaterial = locations - .get(b.getType()); - if (requiredMaterial == null) { - requiredMaterial = new HashMap(); - } - requiredMaterial.put(b.getLocation(), c); - } - public boolean factoryExistsAt(Location loc) { return getFactoryAt(loc) == null; } @@ -73,12 +74,31 @@ public void attemptCreation(Block b, Player p) { // Cycle through possible structures here FurnCraftChestStructure fccs = new FurnCraftChestStructure(b); if (fccs.isComplete()) { - + HashMap eggs = factoryCreationRecipes + .get(FurnCraftChestStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs.get(new ItemMap((Inventory) (fccs + .getChest().getState()))); + if (egg != null) { + Factory f = egg.hatch(p); + addFactory(f); + } + } } } } + public void addFactoryEgg(Class blockStructureClass, + ItemMap recipe, IFactoryEgg egg) { + HashMap eggs = factoryCreationRecipes + .get(blockStructureClass); + if (eggs == null) { + eggs = new HashMap(); + } + eggs.put(recipe, egg); + } + public boolean isPossibleCenterBlock(Material m) { return possibleCenterBlocks.contains(m); } diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java index 0e579513..ba71c40c 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -16,7 +16,6 @@ import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; /** @@ -25,14 +24,14 @@ * which is used as inventory holder * */ -public abstract class FurnCraftChestFactory extends Factory { +public class FurnCraftChestFactory extends Factory { protected int currentProductionTimer = 0; protected List recipes; protected IRecipe currentRecipe; public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, - IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime) { - super(im, rm, ipm, mbs, updateTime); + IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, String name) { + super(im, rm, ipm, mbs, updateTime, name); this.active = false; } @@ -189,7 +188,20 @@ else if (currentProductionTimer >= currentRecipe .getProductionTime()) { applyRecipeEffect(); currentProductionTimer = 0; - deactivate(); + if (hasInputMaterials() && pm.fuelAvailable()) { + pm.setPowerCounter(0); + FactoryModPlugin + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask( + FactoryModPlugin.getPlugin(), this, + (long) updateTime); + //keep going + } + else { + deactivate(); + } } } else { deactivate(); @@ -211,7 +223,12 @@ public void setRecipe(IRecipe pr) { } } - public abstract boolean hasInputMaterials(); + public boolean hasInputMaterials() { + return currentRecipe.enoughMaterialAvailable(getInventory()); + } + + public void applyRecipeEffect() { + currentRecipe.applyEffect(getInventory()); + } - public abstract void applyRecipeEffect(); } diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java deleted file mode 100644 index 065e167a..00000000 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/ProductionFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.github.igotyou.FactoryMod.classicTriblockFactory; - -import java.util.HashMap; -import java.util.Map.Entry; - -import org.bukkit.block.BlockFace; -import org.bukkit.inventory.ItemStack; - -import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; -import com.github.igotyou.FactoryMod.powerManager.IPowerManager; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -import com.github.igotyou.FactoryMod.utility.ItemMap; - -public class ProductionFactory extends FurnCraftChestFactory { - - public ProductionFactory(IInteractionManager im, IRepairManager rm, - IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime) { - super(im, rm, ipm, mbs, updateTime); - } - - @Override - public boolean hasInputMaterials() { - return ((ProductionRecipe) currentRecipe).getRawInputs().isContainedBy( - new ItemMap(getInventory())); - } - - public void applyRecipeEffect() { - ProductionRecipe pr = (ProductionRecipe) currentRecipe; - int multiplier = pr.getRawInputs().getMultiplesContainedIn( - new ItemMap(getInventory())); - ItemMap toRemove = pr.getRawInputs().clone(); - toRemove.multiplyContent(multiplier); - ItemMap toAdd = pr.getRawOutputs().clone(); - toAdd.multiplyContent(multiplier); - for (ItemStack is : toRemove.getItemStackRepresentation()) { - getInventory().remove(is); - } - for (ItemStack is : toAdd.getItemStackRepresentation()) { - HashMap notAdded = getInventory().addItem(is); - // drop items that didnt fit in the chest - for (Entry entry : notAdded.entrySet()) { - getChest() - .getLocation() - .getWorld() - .dropItemNaturally( - getChest().getRelative(BlockFace.UP) - .getLocation(), entry.getValue()); - } - } - } - -} diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java new file mode 100644 index 00000000..b64de24c --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -0,0 +1,11 @@ +package com.github.igotyou.FactoryMod.eggs; + +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.Factory; + +public interface IFactoryEgg { + public Factory hatch(Player p); + + public String getName(); +} diff --git a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java b/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java deleted file mode 100644 index d423fb80..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/CompactorManager.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import org.bukkit.Location; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; -import com.github.igotyou.FactoryMod.properties.CompactorProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; - -public class CompactorManager extends FactoryModManager { - - public CompactorManager(FactoryModPlugin plugin) { - super(plugin); - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, - Location inventoryLocation, Location powerLocation) { - CompactorProperties compactorProperties = plugin.getCompactorProperties(); - - if (!factoryExistsAt(factoryLocation)) { - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList inputs = compactorProperties.getConstructionMaterials(); - - if (inputs.exactlyIn(chestInventory)) { - Compactor production = new Compactor(factoryLocation, inventoryLocation, powerLocation, false, plugin.getCompactorProperties()); - inputs.removeFrom(production.getInventory()); - - if (addFactory(production).getInteractionResult() == InteractionResult.FAILURE) { - return new InteractionResponse(InteractionResult.FAILURE, "Unable to create a " + compactorProperties.getName()); - } else { - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + compactorProperties.getName()); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest to create a " + compactorProperties.getName()); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + compactorProperties.getName() + " there!"); - } - - @Override - public boolean isClear(Compactor factory){ - return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && - (!factoryExistsAt(factory.getCenterLocation()) - || !factoryExistsAt(factory.getInventoryLocation()) - || !factoryExistsAt(factory.getPowerSourceLocation())); - } - - @Override - public Compactor getFactory(Location factoryLocation) { - for(Compactor factory : factories) { - if(factory.getCenterLocation().equals(factoryLocation) - || factory.getInventoryLocation().equals(factoryLocation) - || factory.getPowerSourceLocation().equals(factoryLocation)) { - return factory; - } - } - return null; - } - - @Override - public Class getFactoryType() { - return Compactor.class; - } -} diff --git a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java b/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java deleted file mode 100644 index ec9c3b29..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import org.bukkit.Location; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; -import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -//original file: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* -* @author MrTwiggy -* @version 0.1 1/08/13 -*/ -//edited version: -/** -* Manager.java -* Purpose: Interface for Manager objects for basic manager functionality -* @author igotyou -* -*/ - -public class PrintingPressManager extends FactoryModManager -{ - //private List presses; - - public PrintingPressManager(FactoryModPlugin plugin) - { - super(plugin); - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) - { - PrintingPressProperties printingPressProperties = plugin.getPrintingPressProperties(); - - if (!factoryExistsAt(factoryLocation)) - { - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList inputs = printingPressProperties.getConstructionMaterials(); - boolean hasMaterials = inputs.allIn(chestInventory); - if (hasMaterials) - { - PrintingPress production = new PrintingPress(factoryLocation, inventoryLocation, powerSourceLocation, false, plugin.getPrintingPressProperties()); - if (printingPressProperties.getConstructionMaterials().removeFrom(production.getInventory())) - { - addFactory(production); - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created " + printingPressProperties.getName()); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Not enough materials in chest!"); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + printingPressProperties.getName() + " there!"); - } - - public boolean isClear(PrintingPress factory){ - return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && (!factoryExistsAt(factory.getCenterLocation())) - || !factoryExistsAt(factory.getInventoryLocation()) || !factoryExistsAt(factory.getPowerSourceLocation()); - } - - @Override - public PrintingPress getFactory(Location factoryLocation) - { - for (PrintingPress production : factories) - { - if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) - || production.getPowerSourceLocation().equals(factoryLocation)) - return production; - } - return null; - } - - @Override - public Class getFactoryType() { - return PrintingPress.class; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java b/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java deleted file mode 100644 index 24b6c817..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/RepairFactoryManager.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.github.igotyou.FactoryMod.managers; - -import org.bukkit.Location; -import org.bukkit.block.Block; -import org.bukkit.block.Chest; -import org.bukkit.inventory.Inventory; - -import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; -import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class RepairFactoryManager extends FactoryModManager{ - - public RepairFactoryManager(FactoryModPlugin plugin) { - super(plugin); - // TODO Auto-generated constructor stub - } - - @Override - public Class getFactoryType() { - return RepairFactory.class; - } - - @Override - public InteractionResponse createFactory(Location factoryLocation, - Location inventoryLocation, Location powerLocation) { - RepairFactoryProperties repairFactoryProperties = plugin.getRepairFactoryProperties(); - - if(!factoryExistsAt(factoryLocation)) { - Block inventoryBlock = inventoryLocation.getBlock(); - Chest chest = (Chest) inventoryBlock.getState(); - Inventory chestInventory = chest.getInventory(); - ItemList constructionMaterials = repairFactoryProperties.getConstructionMaterials(); - - if (constructionMaterials.exactlyIn(chestInventory)){ - RepairFactory factory = new RepairFactory(factoryLocation, inventoryLocation, powerLocation, false, repairFactoryProperties); - constructionMaterials.removeFrom(factory.getInventory()); - - if (addFactory(factory).getInteractionResult() == InteractionResult.FAILURE) { - return new InteractionResponse(InteractionResult.FAILURE, "Unable to construct a " + repairFactoryProperties.getName()); - } else { - return new InteractionResponse(InteractionResult.SUCCESS, "Successfully created a " + repairFactoryProperties.getName()); - } - } - return new InteractionResponse(InteractionResult.FAILURE, "Incorrect materials in chest! Stacks must match perfectly to create a " + repairFactoryProperties.getName()); - } - return new InteractionResponse(InteractionResult.FAILURE, "There is already a " + repairFactoryProperties.getName() + " there!"); - } - - public boolean isClear(RepairFactory factory){ - return factory.getCenterLocation().getBlock().getType().equals(FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) && - (!factoryExistsAt(factory.getCenterLocation()) - || !factoryExistsAt(factory.getInventoryLocation()) - || !factoryExistsAt(factory.getPowerSourceLocation())); - } - - @Override - public RepairFactory getFactory(Location factoryLocation) { - for (RepairFactory factory: factories){ - if (factory.getCenterLocation().equals(factoryLocation) - || factory.getInventoryLocation().equals(factoryLocation) - || factory.getPowerSourceLocation().equals(factoryLocation)) - return factory; - } - return null; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java index a25c8c31..76626412 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -1,5 +1,8 @@ package com.github.igotyou.FactoryMod.multiBlockStructures; +import java.util.LinkedList; +import java.util.List; + import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -62,4 +65,12 @@ public Block getChest() { return Chest; } + public List getAllBlocks() { + LinkedList result = new LinkedList(); + result.add(Furnace); + result.add(Chest); + result.add(CraftingTable); + return result; + } + } diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java index 30d5899c..e7462c62 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -37,6 +37,8 @@ protected static List searchForBlockOnSides(Block b, Material m) { public abstract boolean isComplete(); public abstract void initializeBlocks(Block start); + + public abstract List getAllBlocks(); } diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java deleted file mode 100644 index 4a4c6ca0..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvReader.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; -import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor.CompactorMode; -import com.google.common.collect.Lists; - -public class CompactorCsvReader implements IFactoryReader{ - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - static final int VERSION = 1; - - public CompactorCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - @Override - public synchronized List read() { - - List factory = Lists.newArrayList(); - - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return factory; - } - - ObjectInputStream ois; - - try { - FileInputStream fileInputStream = new FileInputStream(mFile); - ois = new ObjectInputStream(fileInputStream); - } catch (Exception e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return factory; - } - - int lineNum = 1; - - try { - int version = ois.readInt(); - if(version != VERSION) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); - ois.close(); - return factory; - } - - int count = ois.readInt(); - for (int i = 0; i < count; i++) - { - try { - factory.add(read(ois)); - } catch (Exception ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); - break; - } - } - } catch (IOException ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - //TODO: ensure everything is closed - return factory; - } - - //TODO: split into common csv file handler and factory type parser - public Compactor read(ObjectInputStream ois) throws Exception { - String worldName = ois.readUTF(); - World world = Bukkit.getWorld(worldName); - - Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - - CompactorMode mode = CompactorMode.byId(ois.readInt()); - double currentRepair = ois.readDouble(); - long timeDisrepair = ois.readLong(); - - return new Compactor(centerLocation, inventoryLocation, powerLocation, false, mPlugin.getCompactorProperties(), - mode, currentRepair, timeDisrepair); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java deleted file mode 100644 index 4ef8dd1a..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/CompactorCsvWriter.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; - -public class CompactorCsvWriter implements IFactoryWriter { - - File mFile; - - public CompactorCsvWriter(File file) { - mFile = file; - } - - @Override - public synchronized void write(List factories) { - FileBackup.backup(mFile); - - if(!mFile.exists()) { - try { - mFile.createNewFile(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - return; - } - } - - try { - FileOutputStream fileOutputStream = new FileOutputStream(mFile); - ObjectOutputStream oos= new ObjectOutputStream(fileOutputStream); - - int version = 1; - oos.writeInt(version); - oos.writeInt(factories.size()); - for (Compactor factory: factories) - { - Location centerLocation = factory.getCenterLocation(); - Location inventoryLocation = factory.getInventoryLocation(); - Location powerLocation = factory.getPowerSourceLocation(); - - oos.writeUTF(centerLocation.getWorld().getName()); - - oos.writeInt(centerLocation.getBlockX()); - oos.writeInt(centerLocation.getBlockY()); - oos.writeInt(centerLocation.getBlockZ()); - - oos.writeInt(inventoryLocation.getBlockX()); - oos.writeInt(inventoryLocation.getBlockY()); - oos.writeInt(inventoryLocation.getBlockZ()); - - oos.writeInt(powerLocation.getBlockX()); - oos.writeInt(powerLocation.getBlockY()); - oos.writeInt(powerLocation.getBlockZ()); - - oos.writeInt(factory.getMode().getId()); - oos.writeDouble(factory.getCurrentRepair()); - oos.writeLong(factory.getTimeDisrepair()); - } - - oos.flush(); - fileOutputStream.close(); - } catch (FileNotFoundException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for writing: ").append(e.getMessage()).toString()); - return; - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - } - - } -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java deleted file mode 100644 index b39739cd..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryDao.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.Factorys.IFactory; - -public class FactoryDao { - - private IFactoryReader mReader; - private IFactoryWriter mWriter; - - FactoryDao(IFactoryReader reader, IFactoryWriter writer) { - mReader = reader; - mWriter = writer; - } - - public List readFactories() { - return mReader.read(); - } - - public void writeFactories(List factories) { - mWriter.write(factories); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java b/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java deleted file mode 100644 index 452778a6..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/FileBackup.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.IOException; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.google.common.io.Files; - -public class FileBackup { - - private static String BACKUP_EXT = ".bak"; - - public static synchronized void backup(File file) { - - File backup = new File(file.getAbsolutePath() + BACKUP_EXT); - - if(backup.exists()) { - backup.delete(); - } - - try { - Files.copy(file, backup); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage("ERROR: Could not copy file to backup!" + file.getName()); - } - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java deleted file mode 100644 index 21df2e2c..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/IFactoryCodec.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import com.github.igotyou.FactoryMod.Factorys.IFactory; - -public interface IFactoryCodec { - - public void write(T out); - - public T read(); - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java deleted file mode 100644 index ee48f88c..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/IFactoryReader.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.Factorys.IFactory; - -public interface IFactoryReader { - - public List read(); - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java b/src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java deleted file mode 100644 index 7c2775fe..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/IFactoryWriter.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.util.List; - -import com.github.igotyou.FactoryMod.Factorys.IFactory; - -public interface IFactoryWriter { - - public void write(List factories); - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java deleted file mode 100644 index 7198e7e1..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvReader.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory.NetherOperationMode; -import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; -import com.google.common.collect.Lists; - -public class NetherCsvReader implements IFactoryReader { - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - static final int VERSION = 1; - - public NetherCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - @Override - public synchronized List read() { - - List factories = Lists.newArrayList(); - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return factories; - } - - ObjectInputStream ois; - - try { - FileInputStream fileInputStream = new FileInputStream(mFile); - ois = new ObjectInputStream(fileInputStream); - } catch (Exception e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return factories; - } - - int lineNum = 1; - - try { - int version = ois.readInt(); - if(version != VERSION) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); - ois.close(); - return factories; - } - - int count = ois.readInt(); - for (int i = 0; i < count; i++) - { - try { - factories.add(read(ois)); - } catch (Exception ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); - break; - } - } - } catch (IOException ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - - return factories; - } - - public NetherFactory read(ObjectInputStream input) throws Exception { - String worldName = input.readUTF(); - World world = mPlugin.getServer().getWorld(worldName); - - Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location overworldTeleportPlatformLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - - String worldName2 = input.readUTF(); - World world2 = mPlugin.getServer().getWorld(worldName2); - - Location netherTeleportPlatformLocation = new Location(world2, input.readInt(), input.readInt(), input.readInt()); - - boolean active = input.readBoolean(); - NetherOperationMode mode = NetherFactory.NetherOperationMode.byId(input.readInt()); - double currentRepair = input.readDouble(); - long timeDisrepair = input.readLong(); - - return new NetherFactory(centerLocation, inventoryLocation, powerLocation, netherTeleportPlatformLocation, overworldTeleportPlatformLocation, - active, currentRepair, timeDisrepair, mode, mPlugin.getNetherFactoryProperties()); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java deleted file mode 100644 index c4f6d660..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/NetherCsvWriter.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; - -public class NetherCsvWriter implements IFactoryWriter { - - static final int VERSION = 1; - - File mFile; - - public NetherCsvWriter(File file) { - mFile = file; - } - - @Override - public void write(List factories) { - FileBackup.backup(mFile); - - if(!mFile.exists()) { - try { - mFile.createNewFile(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - return; - } - } - - FileOutputStream fileStream = null; - - try { - fileStream = new FileOutputStream(mFile); - } catch (FileNotFoundException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for writing: ").append(ex.getMessage()).toString()); - return; - } - - ObjectOutputStream out = null; - - try { - out = new ObjectOutputStream(fileStream); - out.writeInt(VERSION); - out.writeInt(factories.size()); - } catch(IOException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to file ") - .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); - try { - if(fileStream!= null) fileStream.close(); - } catch (IOException e) {} - return; - } - - for (NetherFactory factory : factories) - { - Location centerlocation = factory.getCenterLocation(); - Location inventoryLocation = factory.getInventoryLocation(); - Location powerLocation = factory.getPowerSourceLocation(); - Location netherTeleportPlatformLocation = factory.getNetherTeleportPlatform(); - Location overworldTeleportPlatformLocation = factory.getOverworldTeleportPlatform(); - - try { - out.writeUTF(centerlocation.getWorld().getName()); - - out.writeInt(centerlocation.getBlockX()); - out.writeInt(centerlocation.getBlockY()); - out.writeInt(centerlocation.getBlockZ()); - - out.writeInt(inventoryLocation.getBlockX()); - out.writeInt(inventoryLocation.getBlockY()); - out.writeInt(inventoryLocation.getBlockZ()); - - out.writeInt(powerLocation.getBlockX()); - out.writeInt(powerLocation.getBlockY()); - out.writeInt(powerLocation.getBlockZ()); - - out.writeInt(overworldTeleportPlatformLocation.getBlockX()); - out.writeInt(overworldTeleportPlatformLocation.getBlockY()); - out.writeInt(overworldTeleportPlatformLocation.getBlockZ()); - - out.writeUTF(netherTeleportPlatformLocation.getWorld().getName()); - out.writeInt(netherTeleportPlatformLocation.getBlockX()); - out.writeInt(netherTeleportPlatformLocation.getBlockY()); - out.writeInt(netherTeleportPlatformLocation.getBlockZ()); - - out.writeBoolean(factory.getActive()); - out.writeInt(factory.getMode().getId()); - out.writeDouble(factory.getCurrentRepair()); - out.writeLong(factory.getTimeDisrepair()); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") - .append(mFile.getName()).append(" for factory ").append(factories.indexOf(factory)).append(": ").append(e.getMessage()).toString()); - } - } - - try { - out.flush(); - fileStream.close(); - } catch(IOException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") - .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); - } - } -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java b/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java deleted file mode 100644 index dbc52251..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/PersistenceFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.IFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.Compactor; -import com.github.igotyou.FactoryMod.classicTriblockFactory.NetherFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; -import com.github.igotyou.FactoryMod.managers.CompactorManager; -import com.github.igotyou.FactoryMod.managers.IManager; -import com.github.igotyou.FactoryMod.managers.NetherFactoryManager; -import com.github.igotyou.FactoryMod.managers.PrintingPressManager; -import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; -import com.github.igotyou.FactoryMod.managers.RepairFactoryManager; - -public class PersistenceFactory { - - //TODO: use type inference for return - @SuppressWarnings("unchecked") - public static FactoryDao getFactoryDao(IManager factoryManager) { - - if(FactoryModPlugin.PERSISTENCE_FORMAT.toLowerCase().equals("txt")) { - if(factoryManager instanceof ProductionFactoryManager) { - File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.PRODUCTION_FACTORY_SAVE_FILE+".txt"); - return (FactoryDao) new FactoryDao(new ProductionCsvReader(factoryManager.getPlugin(), saveFile), new ProductionCsvWriter(saveFile)); - } else if(factoryManager instanceof PrintingPressManager) { - File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE+".txt"); - return (FactoryDao) new FactoryDao(new PrintingPressCsvReader(factoryManager.getPlugin(), saveFile), new PrintingPressCsvWriter(saveFile)); - } else if(factoryManager instanceof NetherFactoryManager) { - File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.NETHER_FACTORY_SAVE_FILE+".txt"); - return (FactoryDao) new FactoryDao(new NetherCsvReader(factoryManager.getPlugin(), saveFile), new NetherCsvWriter(saveFile)); - } else if(factoryManager instanceof RepairFactoryManager) { - File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.REPAIR_FACTORY_SAVE_FILE+".txt"); - return (FactoryDao) new FactoryDao(new RepairCsvReader(factoryManager.getPlugin(), saveFile), new RepairCsvWriter(saveFile)); - } else if(factoryManager instanceof CompactorManager) { - File saveFile = new File(factoryManager.getPlugin().getDataFolder(), FactoryModPlugin.COMPACTOR_SAVE_FILE+".txt"); - return (FactoryDao) new FactoryDao(new CompactorCsvReader(factoryManager.getPlugin(), saveFile), new CompactorCsvWriter(saveFile)); - } - FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported factory manager: " + factoryManager.getClass().getName()); - return null; - } - - FactoryModPlugin.sendConsoleMessage("ERROR: Unsupported file format: " + FactoryModPlugin.PERSISTENCE_FORMAT); - return null; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java deleted file mode 100644 index 226c5f29..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvReader.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; -import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress.OperationMode; -import com.google.common.collect.Lists; - -public class PrintingPressCsvReader implements IFactoryReader { - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - static final int VERSION = 1; - - public PrintingPressCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - @Override - public synchronized List read() { - - List presses = Lists.newArrayList(); - - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return presses; - } - - ObjectInputStream ois; - - try { - FileInputStream fileInputStream = new FileInputStream(mFile); - ois = new ObjectInputStream(fileInputStream); - } catch (Exception e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return presses; - } - - int lineNum = 1; - - try { - int version = ois.readInt(); - if(version != VERSION) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); - ois.close(); - return presses; - } - - int count = ois.readInt(); - for (int i = 0; i < count; i++) - { - try { - presses.add(read(ois)); - } catch (Exception ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); - break; - } - } - } catch (IOException ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - //TODO: ensure everything is closed - return presses; - } - - public PrintingPress read(ObjectInputStream input) throws Exception { - - try { - World world = mPlugin.getServer().getWorld(input.readUTF()); - Location centerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location inventoryLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - Location powerLocation = new Location(world, input.readInt(), input.readInt(), input.readInt()); - boolean active = input.readBoolean(); - OperationMode mode = PrintingPress.OperationMode.byId(input.readInt()); - int productionTimer = input.readInt(); - int energyTimer = input.readInt(); - double currentRepair = input.readDouble(); - long timeDisrepair = input.readLong(); - int containedPaper = input.readInt(); - int containedBindings = input.readInt(); - int containedSecurityMaterials = input.readInt(); - int lockedResultCode = input.readInt(); - - int queueLength = input.readInt(); - int[] processQueue = new int[queueLength]; - - for (int q = 0; q < queueLength; q++) { - processQueue[q] = input.readInt(); - } - - return new PrintingPress( - centerLocation, inventoryLocation, powerLocation, - active, productionTimer, energyTimer, currentRepair, timeDisrepair, - mode, mPlugin.getPrintingPressProperties(), - containedPaper, containedBindings, containedSecurityMaterials, - processQueue, lockedResultCode); - } catch (NumberFormatException e) { - throw new Exception("Expected token was not an integer"); - } - - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java deleted file mode 100644 index 630c17f1..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/PrintingPressCsvWriter.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.PrintingPress; - -public class PrintingPressCsvWriter implements IFactoryWriter { - - static final int VERSION = 1; - - File mFile; - - public PrintingPressCsvWriter(File file) { - mFile = file; - } - - @Override - public synchronized void write(List presses) { - - FileBackup.backup(mFile); - - if(!mFile.exists()) { - try { - mFile.createNewFile(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - return; - } - } - - FileOutputStream fileStream = null; - - try { - fileStream = new FileOutputStream(mFile); - } catch (FileNotFoundException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for writing: ").append(ex.getMessage()).toString()); - return; - } - - ObjectOutputStream out = null; - - try { - out = new ObjectOutputStream(fileStream); - out.writeInt(VERSION); - out.writeInt(presses.size()); - } catch(IOException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to file ") - .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); - try { - if(fileStream!= null) fileStream.close(); - } catch (IOException e) {} - return; - } - for (PrintingPress press : presses) - { - // order: subFactoryType world recipe1,recipe2 - // central_x central_y central_z - // inventory_x inventory_y inventory_z - // power_x power_y power_z - // active productionTimer energyTimer current_Recipe_number - - Location centerlocation = press.getCenterLocation(); - Location inventoryLocation = press.getInventoryLocation(); - Location powerLocation = press.getPowerSourceLocation(); - - try { - out.writeUTF(centerlocation.getWorld().getName()); - - out.writeInt(centerlocation.getBlockX()); - out.writeInt(centerlocation.getBlockY()); - out.writeInt(centerlocation.getBlockZ()); - - out.writeInt(inventoryLocation.getBlockX()); - out.writeInt(inventoryLocation.getBlockY()); - out.writeInt(inventoryLocation.getBlockZ()); - - out.writeInt(powerLocation.getBlockX()); - out.writeInt(powerLocation.getBlockY()); - out.writeInt(powerLocation.getBlockZ()); - - out.writeBoolean(press.getActive()); - out.writeInt(press.getMode().getId()); - out.writeInt(press.getProductionTimer()); - out.writeInt(press.getEnergyTimer()); - out.writeDouble(press.getCurrentRepair()); - out.writeLong(press.getTimeDisrepair()); - - out.writeInt(press.getContainedPaper()); - out.writeInt(press.getContainedBindings()); - out.writeInt(press.getContainedSecurityMaterials()); - out.writeInt(press.getLockedResultCode()); - - int[] processQueue = press.getProcessQueue(); - out.writeInt(processQueue.length); - for (int entry : processQueue) { - out.writeInt(entry); - } - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") - .append(mFile.getName()).append(" for factory ").append(presses.indexOf(press)).append(": ").append(e.getMessage()).toString()); - } - } - - try { - out.flush(); - fileStream.close(); - } catch(IOException ex) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") - .append(mFile.getName()).append(": ").append(ex.getMessage()).toString()); - } - } -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java deleted file mode 100644 index 2b6e3195..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvReader.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import com.google.common.io.Files; - -public class ProductionCsvReader implements IFactoryReader{ - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - public ProductionCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - private enum LineTokens { - SUBTYPE, - RECIPE_LIST, - WORLD, - CENTER_X, - CENTER_Y, - CENTER_Z, - INV_X, - INV_Y, - INV_Z, - POWER_X, - POWER_Y, - POWER_Z, - IS_ACTIVE, - PROD_TIMER, - ENERGY_TIMER, - RECIPE_NUMBER, - REPAIR, - DISREPAIR_TIME, - MAX - } - - @Override - public synchronized List read() { - - List factories = Lists.newArrayList(); - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return factories; - } - - BufferedReader reader; - - try { - reader = Files.newReader(mFile, Charset.defaultCharset()); - } catch (FileNotFoundException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return factories; - } - - int lineNum = 1; - - try { - for (String line; (line = reader.readLine()) != null; ++lineNum) - { - try { - factories.add(read(line)); - } catch(Exception e) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + e.getMessage()); - break; - } - } - } catch (IOException e) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - - try { - reader.close(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not close stream reading from ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - } - //TODO: ensure everything is closed - return factories; - } - - //TODO: split into common csv file handler and factory type parser - public ProductionFactory read(String decode) throws Exception { - String[] tokens = decode.split(" "); - - if(tokens.length != LineTokens.MAX.ordinal()) { - throw new Exception("Unexpected number of tokens: " + tokens.length); - } - - try { - String subFactoryType = tokens[LineTokens.SUBTYPE.ordinal()]; - String recipeNames[] = tokens[LineTokens.RECIPE_LIST.ordinal()].split(","); - - World world = mPlugin.getServer().getWorld(tokens[LineTokens.WORLD.ordinal()]); - Location centerLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.CENTER_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.CENTER_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.CENTER_Z.ordinal()])); - Location inventoryLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.INV_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.INV_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.INV_Z.ordinal()])); - Location powerLocation = new Location(world, - Integer.parseInt(tokens[LineTokens.POWER_X.ordinal()]), - Integer.parseInt(tokens[LineTokens.POWER_Y.ordinal()]), - Integer.parseInt(tokens[LineTokens.POWER_Z.ordinal()])); - - boolean active = Boolean.parseBoolean(tokens[LineTokens.IS_ACTIVE.ordinal()]); - int productionTimer = Integer.parseInt(tokens[LineTokens.PROD_TIMER.ordinal()]); - int energyTimer = Integer.parseInt(tokens[LineTokens.ENERGY_TIMER.ordinal()]); - int currentRecipeNumber = Integer.parseInt(tokens[LineTokens.RECIPE_NUMBER.ordinal()]); - double currentRepair = Double.parseDouble(tokens[LineTokens.REPAIR.ordinal()]); - long timeDisrepair = Long.parseLong(tokens[LineTokens.DISREPAIR_TIME.ordinal()]); - - if(FactoryModPlugin.productionProperties.containsKey(subFactoryType)) - { - Set recipes = Sets.newHashSet(); - - // TODO: Give default recipes for subfactory type - ProductionProperties properties = FactoryModPlugin.productionProperties.get(subFactoryType); - recipes.addAll(properties.getRecipes()); - - for(String name : recipeNames) - { - if(FactoryModPlugin.productionRecipes.containsKey(name)) - { - recipes.add(FactoryModPlugin.productionRecipes.get(name)); - } - } - - return new ProductionFactory( - centerLocation, inventoryLocation, powerLocation, - subFactoryType, active, productionTimer, energyTimer, - new ArrayList(recipes), - currentRecipeNumber, currentRepair, timeDisrepair); - } else { - throw new Exception("Unexpected factory type: " + subFactoryType); - } - } catch (NumberFormatException e) { - throw new Exception("Expected token was not an integer"); - } - - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java deleted file mode 100644 index d852be9a..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/ProductionCsvWriter.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.google.common.io.Files; - -public class ProductionCsvWriter implements IFactoryWriter { - - File mFile; - - public ProductionCsvWriter(File file) { - mFile = file; - } - - @Override - public synchronized void write(List factories) { - FileBackup.backup(mFile); - - if(!mFile.exists()) { - try { - mFile.createNewFile(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - return; - } - } - - BufferedWriter writer; - - try { - writer = Files.newWriter(mFile, Charset.defaultCharset()); - } catch (FileNotFoundException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for writing: ").append(e.getMessage()).toString()); - return; - } - - for (ProductionFactory factory : factories) - { - Location centerlocation = factory.getCenterLocation(); - Location inventoryLoctation = factory.getInventoryLocation(); - Location powerLocation = factory.getPowerSourceLocation(); - - try { - writer.append(factory.getSubFactoryType()); - writer.append(" "); - - for (ProductionRecipe recipe : factory.getRecipes()) - { - writer.append(String.valueOf(recipe.getTitle())); - writer.append(","); - } - writer.append(" "); - - writer.append(centerlocation.getWorld().getName()); - writer.append(" "); - writer.append(Integer.toString(centerlocation.getBlockX())); - writer.append(" "); - writer.append(Integer.toString(centerlocation.getBlockY())); - writer.append(" "); - writer.append(Integer.toString(centerlocation.getBlockZ())); - writer.append(" "); - - writer.append(Integer.toString(inventoryLoctation.getBlockX())); - writer.append(" "); - writer.append(Integer.toString(inventoryLoctation.getBlockY())); - writer.append(" "); - writer.append(Integer.toString(inventoryLoctation.getBlockZ())); - writer.append(" "); - - writer.append(Integer.toString(powerLocation.getBlockX())); - writer.append(" "); - writer.append(Integer.toString(powerLocation.getBlockY())); - writer.append(" "); - writer.append(Integer.toString(powerLocation.getBlockZ())); - writer.append(" "); - - writer.append(Boolean.toString(factory.getActive())); - writer.append(" "); - writer.append(Integer.toString(factory.getProductionTimer())); - writer.append(" "); - writer.append(Integer.toString(factory.getEnergyTimer())); - writer.append(" "); - writer.append(Integer.toString(factory.getCurrentRecipeNumber())); - writer.append(" "); - writer.append(Double.toString(factory.getCurrentRepair())); - writer.append(" "); - writer.append(String.valueOf(factory.getTimeDisrepair())); - writer.newLine(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not write to ") - .append(mFile.getName()).append(" for factory ").append(factories.indexOf(factory)).append(": ").append(e.getMessage()).toString()); - } - } - - try { - writer.flush(); - writer.close(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - } - - } -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java deleted file mode 100644 index 37978aa9..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvReader.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory.RepairFactoryMode; -import com.google.common.collect.Lists; - -public class RepairCsvReader implements IFactoryReader{ - - /** - * The plugin instance - */ - FactoryModPlugin mPlugin; - - /** - * The CSV file being read - */ - File mFile; - - static final int VERSION = 1; - - public RepairCsvReader(FactoryModPlugin plugin, File file) { - mPlugin = plugin; - mFile = file; - } - - @Override - public synchronized List read() { - - List factory = Lists.newArrayList(); - - - if(!mFile.exists() || mFile.isDirectory()) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: ") - .append(mFile.getName()).append(" is not a valid file!").toString()); - return factory; - } - - ObjectInputStream ois; - - try { - FileInputStream fileInputStream = new FileInputStream(mFile); - ois = new ObjectInputStream(fileInputStream); - } catch (Exception e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for reading: ").append(e.getMessage()).toString()); - return factory; - } - - int lineNum = 1; - - try { - int version = ois.readInt(); - if(version != VERSION) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory file version did not match expected value"); - ois.close(); - return factory; - } - - int count = ois.readInt(); - for (int i = 0; i < count; i++) - { - try { - factory.add(read(ois)); - } catch (Exception ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Factory parse error: " + ex.getMessage()); - break; - } - } - } catch (IOException ex) { - FactoryModPlugin.logFileError(mFile.getName(), lineNum, "Could not read file, aborting"); - } - //TODO: ensure everything is closed - return factory; - } - - //TODO: split into common csv file handler and factory type parser - public RepairFactory read(ObjectInputStream ois) throws Exception { - String worldName = ois.readUTF(); - World world = Bukkit.getWorld(worldName); - - Location centerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location inventoryLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - Location powerLocation = new Location(world, ois.readInt(), ois.readInt(), ois.readInt()); - - RepairFactoryMode mode = RepairFactoryMode.byId(ois.readInt()); - double currentRepair = ois.readDouble(); - long timeDisrepair = ois.readLong(); - - return new RepairFactory(centerLocation, inventoryLocation, powerLocation, false, mPlugin.getRepairFactoryProperties(), - mode, currentRepair, timeDisrepair); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java b/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java deleted file mode 100644 index 8367a5bc..00000000 --- a/src/com/github/igotyou/FactoryMod/persistence/RepairCsvWriter.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.github.igotyou.FactoryMod.persistence; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.List; - -import org.bukkit.Location; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.classicTriblockFactory.RepairFactory; - -public class RepairCsvWriter implements IFactoryWriter { - - File mFile; - - public RepairCsvWriter(File file) { - mFile = file; - } - - @Override - public synchronized void write(List factories) { - FileBackup.backup(mFile); - - if(!mFile.exists()) { - try { - mFile.createNewFile(); - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not create file ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - return; - } - } - - try { - FileOutputStream fileOutputStream = new FileOutputStream(mFile); - ObjectOutputStream oos= new ObjectOutputStream(fileOutputStream); - - int version = 1; - oos.writeInt(version); - oos.writeInt(factories.size()); - for (RepairFactory factory: factories) - { - Location centerLocation = factory.getCenterLocation(); - Location inventoryLocation = factory.getInventoryLocation(); - Location powerLocation = factory.getPowerSourceLocation(); - - oos.writeUTF(centerLocation.getWorld().getName()); - - oos.writeInt(centerLocation.getBlockX()); - oos.writeInt(centerLocation.getBlockY()); - oos.writeInt(centerLocation.getBlockZ()); - - oos.writeInt(inventoryLocation.getBlockX()); - oos.writeInt(inventoryLocation.getBlockY()); - oos.writeInt(inventoryLocation.getBlockZ()); - - oos.writeInt(powerLocation.getBlockX()); - oos.writeInt(powerLocation.getBlockY()); - oos.writeInt(powerLocation.getBlockZ()); - - oos.writeInt(factory.getMode().getId()); - oos.writeDouble(factory.getCurrentRepair()); - oos.writeLong(factory.getTimeDisrepair()); - } - - oos.flush(); - fileOutputStream.close(); - } catch (FileNotFoundException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not open file ") - .append(mFile.getName()).append("for writing: ").append(e.getMessage()).toString()); - return; - } catch (IOException e) { - FactoryModPlugin.sendConsoleMessage(new StringBuilder("ERROR: Could not complete write to ") - .append(mFile.getName()).append(": ").append(e.getMessage()).toString()); - } - - } -} diff --git a/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java deleted file mode 100644 index 4054e02e..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/AFactoryProperties.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -public abstract class AFactoryProperties implements IFactoryProperties{ - protected String name; - - public String getName() - { - return name; - } -} diff --git a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java b/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java deleted file mode 100644 index e1ec0a55..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/CompactorProperties.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class CompactorProperties extends AFactoryProperties{ - - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private ItemList recipeMaterials; - private ItemList specificExclusions; - private List generalExlusions; - private int energyTime; - private int repair; - private double repairTime; - private double productionTime; - private String compactLore; - private boolean continuous; - - - public CompactorProperties(ItemList constructionMaterials, - ItemList fuel, ItemList repairMaterials, - ItemList recipeMaterials, int energyTime, int repair, - String name, double repairTime, double productionTime, String compactLore, - boolean continuous, ItemList specificExclusion, List generalExclusion) { - this.constructionMaterials = constructionMaterials; - this.fuel = fuel; - this.repairMaterials = repairMaterials; - this.recipeMaterials = recipeMaterials; - this.energyTime = energyTime; - this.repair = repair; - this.name = name; - this.repairTime = repairTime; - this.productionTime = productionTime; - this.compactLore = compactLore; - this.continuous = continuous; - this.specificExclusions = specificExclusion; - this.generalExlusions = generalExclusion; - } - - public ItemList getConstructionMaterials() { - return constructionMaterials; - } - - public ItemList getFuel() { - return fuel; - } - - public ItemList getRepairMaterials() { - return repairMaterials; - } - - public ItemList getRecipeMaterials() { - return recipeMaterials; - } - - public ItemList getSpecificExclusions() { - return specificExclusions; - } - - public List getGeneralExclusions() { - return generalExlusions; - } - - public int getEnergyTime() { - return energyTime; - } - - public int getRepair() { - return repair; - } - - public double getRepairTime() { - return repairTime; - } - - public double getProductionTime() { - return productionTime; - } - - public String getCompactLore() { - return compactLore; - } - - public boolean getContinuous() { - return continuous; - } - - public static CompactorProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection config) { - ItemList cFuel = plugin.getItems(config.getConfigurationSection("fuel")); - if(cFuel.isEmpty()) { - cFuel = new ItemList(); - cFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"), 1, (short)1, "Charcoal")); - } - ConfigurationSection costs = config.getConfigurationSection("costs"); - ItemList constructionCost = plugin.getItems(costs.getConfigurationSection("construction")); - ItemList repairCost = plugin.getItems(costs.getConfigurationSection("repair")); - ItemList recipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); - ItemList specificExclusion = plugin.getItems(config.getConfigurationSection("specific_exclusions")); - ItemList generalExclusion = plugin.getItems(config.getConfigurationSection("excluded_types")); - int energyTime = config.getInt("fuel_time"); - int repair = costs.getInt("repair_multiple", 1); - String name = config.getString("name", "Compactor"); - int repairTime = config.getInt("repair_time", 12); - int productionTime = config.getInt("production_time"); - String compactLore = config.getString("compact_lore", "Compacted Item"); - boolean continuous = config.getBoolean("continuous", false); - Iterator genExcludeIter = generalExclusion.iterator(); - List generalExclude = new ArrayList(); - - while (genExcludeIter.hasNext()) { - AdvancedItemStack exclude = genExcludeIter.next(); - - generalExclude.add(exclude.getType()); - } - - return new CompactorProperties(constructionCost, cFuel, repairCost, recipeUse, energyTime, repair, name, repairTime, productionTime, compactLore, continuous, specificExclusion, generalExclude); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java deleted file mode 100644 index e206f7dc..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/IFactoryProperties.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -//original file: -/** - * Properties.java - * Purpose: Interface for Properties objects for basic properties functionality - * - * @author MrTwiggy - * @version 0.1 1/17/13 - */ -//edited version: -/** -* Properties.java - * Purpose: Interface for Properties objects for basic properties functionality -* @author igotyou -* -*/ -public interface IFactoryProperties -{ -// public ItemList getInputs() ; - public String getName(); -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java b/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java deleted file mode 100644 index 71745b23..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/RepairFactoryProperties.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class RepairFactoryProperties implements IFactoryProperties{ - - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private ItemList recipeMaterials; - private List allowedRepairable; - private int energyTime; - private String name; - private int repair; - private double repairTime; - private double productionTime; - private int resetLevel; - - public RepairFactoryProperties(ItemList constructionMaterials, ItemList fuel, - ItemList repairMaterials, int energyTime, String name,int repair, double repairTime, - double productionTime, int resetLevel, ItemList recipeMaterials, List allowedRepairable){ - this.constructionMaterials = constructionMaterials; - this.fuel = fuel; - this.repairMaterials = repairMaterials; - this.energyTime = energyTime; - this.name = name; - this.repair = repair; - this.repairTime = repairTime; - this.productionTime = productionTime; - this.resetLevel = resetLevel; - this.recipeMaterials = recipeMaterials; - this.allowedRepairable = allowedRepairable; - } - - public int getRepair() { - return repair; - } - - public ItemList getConstructionMaterials(){ - return constructionMaterials; - } - - public ItemList getFuel(){ - return fuel; - } - - public ItemList getRepairMaterials(){ - return repairMaterials; - } - - public ItemList getRecipeMaterials(){ - return recipeMaterials; - } - - public List getAllowedRepairable(){ - return allowedRepairable; - } - - public int getEnergyTime() - { - return energyTime; - } - - public String getName() - { - return name; - } - - public double getRepairTime() - { - return repairTime; - } - - public double getProductionTime(){ - return productionTime; - } - - public int getResetLevel() { - return resetLevel; - } - - public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){ - ItemList rfFuel = plugin.getItems(section.getConfigurationSection("fuel")); - if (rfFuel.isEmpty()){ - rfFuel = new ItemList(); - rfFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal")); - } - ConfigurationSection costs = section.getConfigurationSection("costs"); - ItemList rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction")); - ItemList rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair")); - ItemList rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe")); - ItemList rfAllowed = plugin.getItems(section.getConfigurationSection("repairable")); - int rfEnergyTime = section.getInt("fuel_time"); - int rfRepair = costs.getInt("repair_multiple", 1); - String rfName = section.getString("name", "Reset Factory"); - int repairTime = section.getInt("repair_time", 12); - int productionTime = section.getInt("production_time"); - int resetLevel = section.getInt("reset_level", 1); - - // We only care about raw material types for repair purposes. - Iterator canRepair = rfAllowed.iterator(); - List repairable = new ArrayList(); - - while (canRepair.hasNext()) { - AdvancedItemStack repair = canRepair.next(); - - repairable.add(repair.getType()); - - FactoryModPlugin.sendConsoleMessage("Adding repairable: " + repair.getType()); - } - return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName, - rfRepair, repairTime, productionTime, resetLevel, rfRecipeUse, repairable); - } -} diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java new file mode 100644 index 00000000..42bbd900 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -0,0 +1,130 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class CompactingRecipe extends InputOutputRecipe { + private List excludedMaterials; + private String compactedLore; + + public CompactingRecipe(ItemMap input, List excludedMaterial, + String name, int productionTime, String compactedLore) { + super(name,productionTime,input); + this.excludedMaterials = excludedMaterial; + this.compactedLore = compactedLore; + } + + public boolean enoughMaterialAvailable(Inventory i) { + if (!input.isContainedIn(new ItemMap(i))) { + return false; + } + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + return true; + } + } + } + return false; + } + + public int getProductionTime() { + return productionTime; + } + + public String getRecipeName() { + return name; + } + + public void applyEffect(Inventory i) { + if (input.isContainedIn(new ItemMap(i))) { + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + List loreList = new LinkedList(); + loreList.add(compactedLore); + for (ItemStack toRemove : input + .getItemStackRepresentation()) { + i.removeItem(toRemove); + } + compact(is); + } + } + } + } + + } + + public List getInputRepresentation(Inventory i) { + List result = new LinkedList(); + ItemMap inventoryMap = new ItemMap(i); + if (input.isContainedIn(inventoryMap)) { + result = createLoredStacksForInfo(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + ItemStack compactedStack = is.clone(); + result.add(compactedStack); + break; + } + } + } + } + return result; + } + + public List getOutputRepresentation(Inventory i) { + List result = new LinkedList(); + if (input.isContainedIn(new ItemMap(i))) { + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + ItemStack decompactedStack = is.clone(); + compact(decompactedStack); + result.add(decompactedStack); + break; + } + } + } + } + + return result; + } + + /** + * Changes the lore of the given ItemStack to the compacted lore and sets + * it's amount to 1 + * + * @param is + */ + private void compact(ItemStack is) { + List loreList = new LinkedList(); + loreList.add(compactedLore); + is.setAmount(1); + ItemMeta im = is.getItemMeta(); + im.setLore(loreList); + is.setItemMeta(im); + } + + /** + * Checks whether compacting a stack is allowed, which means it doesnt have + * meta data, it's a full stack and it's not on the list of excluded + * materials + * + * @param is + * ItemStack to check + * @return True if compacting the stack is allowed, false if not + */ + private boolean compactable(ItemStack is) { + return !excludedMaterials.contains(is.getType()) + && is.getAmount() == is.getMaxStackSize() && !is.hasItemMeta(); + } +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java new file mode 100644 index 00000000..4732867c --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -0,0 +1,118 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class DecompactingRecipe extends InputOutputRecipe { + private String compactedLore; + + public DecompactingRecipe(ItemMap input, String name, int productionTime, + String compactedLore) { + super(name,productionTime,input); + this.compactedLore = compactedLore; + } + + public boolean enoughMaterialAvailable(Inventory i) { + if (!input.isContainedIn(new ItemMap(i))) { + return false; + } + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { + return true; + } + } + } + return false; + } + + public int getProductionTime() { + return productionTime; + } + + public String getRecipeName() { + return name; + } + + public void applyEffect(Inventory i) { + if (input.isContainedIn(new ItemMap(i))) { + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() + && im.getLore().get(0).equals(compactedLore)) { + List loreList = new LinkedList(); + ItemStack decompatedStack = is.clone(); + decompatedStack.setAmount(64); + im.setLore(loreList); + // not changing the original because getItemMeta() just + // gives a copy + decompatedStack.setItemMeta(im); + if (new ItemMap(decompatedStack).fitsIn(i)) { + for (ItemStack toRemove : input + .getItemStackRepresentation()) { + i.removeItem(toRemove); + } + ItemStack removeLoredStack = is.clone(); + removeLoredStack.setAmount(1); + i.removeItem(removeLoredStack); + i.addItem(decompatedStack); + } + break; + } + } + } + } + + } + + public List getInputRepresentation(Inventory i) { + List result = new LinkedList(); + ItemMap inventoryMap = new ItemMap(i); + if (input.isContainedIn(inventoryMap)) { + result = createLoredStacksForInfo(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() + && im.getLore().get(0).equals(compactedLore)) { + ItemStack compactedStack = is.clone(); + result.add(compactedStack); + break; + } + } + } + } + return result; + } + + public List getOutputRepresentation(Inventory i) { + List result = new LinkedList(); + if (input.isContainedIn(new ItemMap(i))) { + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() + && im.getLore().get(0).equals(compactedLore)) { + ItemStack decompactedStack = is.clone(); + decompactedStack.setAmount(decompactedStack.getMaxStackSize()); + List loreList = new LinkedList(); + im.setLore(loreList); + decompactedStack.setItemMeta(im); + result.add(decompactedStack); + break; + } + } + } + } + + return result; + } +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index 4447524c..6f0a5a22 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -1,5 +1,8 @@ package com.github.igotyou.FactoryMod.recipes; +import java.util.List; + +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; public interface IRecipe @@ -8,5 +11,7 @@ public interface IRecipe public int getProductionTime(); - public ItemStack getItemRepresentation(); + public boolean enoughMaterialAvailable(Inventory i); + + public void applyEffect(Inventory i); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java new file mode 100644 index 00000000..e429d9b3 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java @@ -0,0 +1,73 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public abstract class InputOutputRecipe implements IRecipe { + protected String name; + protected int productionTime; + protected ItemMap input; + + public InputOutputRecipe(String name, int productionTime, ItemMap input) { + this.name = name; + this.productionTime = productionTime; + this.input = input; + } + + public abstract List getInputRepresentation(Inventory i); + + public abstract List getOutputRepresentation(Inventory i); + + public String getRecipeName() { + return name; + } + + public int getProductionTime() { + return productionTime; + } + + public ItemMap getInput() { + return input; + } + + /** + * Creates a list of ItemStack for a GUI representation. This list contains + * all the itemstacks contained in the itemstack representation of the input + * map and adds to each of the stacks how many runs could be made with the + * material available in the chest + * + * @param i Inventory to calculate the possible runs for + * @return ItemStacks containing the additional information, ready for the GUI + */ + protected List createLoredStacksForInfo(Inventory i) { + LinkedList result = new LinkedList(); + ItemMap inventoryMap = new ItemMap(i); + if (input.isContainedIn(inventoryMap)) { + for (ItemStack is : input.getItemStackRepresentation()) { + int possibleRuns = new ItemMap(is) + .getMultiplesContainedIn(inventoryMap); + ItemMeta im = is.getItemMeta(); + List lore; + if (im.hasLore()) { + lore = im.getLore(); + } else { + lore = new LinkedList(); + } + lore.add(ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns) + " runs"); + im.setLore(lore); + is.setItemMeta(im); + result.add(is); + } + } + return result; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 998c115b..4280e50a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,63 +1,75 @@ package com.github.igotyou.FactoryMod.recipes; import java.util.LinkedList; +import java.util.List; -import org.bukkit.Material; +import org.bukkit.ChatColor; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.utility.ItemMap; -public class ProductionRecipe implements IRecipe { - private String recipeName; - private int productionTime; - private ItemMap inputs; - private ItemMap outputs; - private ItemStack itemRepresentation; - - public ProductionRecipe(String recipeName, int productionTime, - ItemMap inputs, ItemMap outputs) { - this.recipeName = recipeName; - this.productionTime = productionTime; - this.inputs = inputs; - this.outputs = outputs; - LinkedList outputRepresentation = outputs.getItemStackRepresentation(); - if (outputRepresentation.size() != 0) { - itemRepresentation = outputRepresentation.get(0); - } - else { - itemRepresentation = new ItemStack(Material.STONE); - } - } - - public ItemMap getRawInputs() { - return inputs; - } +public class ProductionRecipe extends InputOutputRecipe { + private ItemMap output; - public ItemMap getRawOutputs() { - return outputs; + public ProductionRecipe(String name, int productionTime, ItemMap inputs, + ItemMap output) { + super(name, productionTime, inputs); + this.output = output; } - public String getRecipeName() { - return recipeName; + public ItemMap getOutput() { + return output; } - public int getProductionTime() { - return productionTime; - } - public int getCurrentMultiplier(Inventory i) { ItemMap im = new ItemMap(i); - return inputs.getMultiplesContainedIn(im); + return input.getMultiplesContainedIn(im); } - + public ItemMap getCurrentOutput(Inventory i) { - ItemMap copy = outputs.clone(); + ItemMap copy = output.clone(); copy.multiplyContent(getCurrentMultiplier(i)); return copy; - } - - public ItemStack getItemRepresentation() { - return itemRepresentation; + } + + public List getOutputRepresentation(Inventory i) { + List stacks = output.getItemStackRepresentation(); + int possibleRuns = input.getMultiplesContainedIn(new ItemMap (i)); + for(ItemStack is: stacks) { + ItemMeta im = is.getItemMeta(); + List lore; + if (im.hasLore()) { + lore = im.getLore(); + } else { + lore = new LinkedList(); + } + lore.add(ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns) + " runs"); + im.setLore(lore); + is.setItemMeta(im); + } + return stacks; + } + + public List getInputRepresentation(Inventory i) { + return createLoredStacksForInfo(i); + } + + public boolean enoughMaterialAvailable(Inventory i) { + return input.isContainedIn(new ItemMap(i)); + } + + public void applyEffect(Inventory i) { + ItemMap toRemove = input.clone(); + ItemMap toAdd = output.clone(); + if (new ItemMap(i).contains(toRemove)) + for (ItemStack is : toRemove.getItemStackRepresentation()) { + i.removeItem(is); + } + for (ItemStack is : toAdd.getItemStackRepresentation()) { + i.addItem(is); + } } } diff --git a/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java b/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java deleted file mode 100644 index 03ceeecd..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/AdvancedItemStack.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.util.Map; - -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -public class AdvancedItemStack extends ItemStack { - - public AdvancedItemStack(final Material type, final int amount, - final short damage, final String commonName) { - super(type, amount, damage); - } - - public AdvancedItemStack(final ItemStack itemStack, final String commonName) { - super(itemStack); - } - - public AdvancedItemStack clone() { - try { - AdvancedItemStack namedItemStack = (AdvancedItemStack) super - .clone(); - return namedItemStack; - } catch (Error e) { - throw e; - } - } - - public String getName() { - return getItemMeta().getDisplayName(); - } - - public void setName(String name) { - ItemMeta im = getItemMeta(); - im.setDisplayName(name); - setItemMeta(im); - } - - public Map getEnchants() { - return getItemMeta().getEnchants(); - } - - public void addEnchant(Enchantment enchant, int level) { - getItemMeta().addEnchant(enchant, level, true); - } - - public void removeEnchant(Enchantment enchant) { - getItemMeta().removeEnchant(enchant); - } -} diff --git a/src/com/github/igotyou/FactoryMod/utility/InteractionResponse.java b/src/com/github/igotyou/FactoryMod/utility/InteractionResponse.java deleted file mode 100644 index b15a1f7e..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/InteractionResponse.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - - -import java.util.List; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; - -/** - * InteractionResponse.java - * Purpose: Object used for sending back interaction results with error/success messages - * - * @author MrTwiggy - * @version 0.1 1/14/13 - */ -public class InteractionResponse -{ - public static enum InteractionResult - { - SUCCESS, - FAILURE - } - - private final InteractionResult interactionResult; //The result of this interaction attempt - private final String interactionMessage; //The message to send to player(s) after interaction attempt - - /** - * Constructor - */ - public InteractionResponse(InteractionResult interactionResult, - String interactionMessage) - { - this.interactionResult = interactionResult; - this.interactionMessage = interactionMessage; - } - - /** - * Returns the interaction result message to be sent to player(s) - */ - public String getInteractionMessage() - { - return getMessageColor() + interactionMessage; - } - - /** - * Messages the given Player this object's interaction message - */ - public static void messagePlayerResult(Player player, InteractionResponse interactionResponse) - { - player.sendMessage(interactionResponse.getInteractionMessage()); - } - - /** - * Messages the given Player all of this object's interaction message - */ - public static void messagePlayerResults(Player player, List interactionResponses) - { - for(InteractionResponse interactionResponse:interactionResponses) - { - player.sendMessage(interactionResponse.getInteractionMessage()); - } - } - - /** - * Returns the appropriate color for interaction messages based on success/failure - */ - private ChatColor getMessageColor() - { - switch (interactionResult) - { - case SUCCESS: - return ChatColor.GREEN; - case FAILURE: - return ChatColor.RED; - default: - return ChatColor.YELLOW; - } - } - - /** - * 'interactionResult' public accessor - */ - public InteractionResult getInteractionResult() - { - return interactionResult; - } -} diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 694ef244..918dcef1 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -37,6 +37,16 @@ public ItemMap(Inventory inv) { update(inv); } + /** + * Constructor to create an ItemMap based on a single ItemStack + * + * @param is + * ItemStack to start with + */ + public ItemMap(ItemStack is) { + addItemStack(is); + } + /** * Constructor to create an item map based on a collection of ItemStacks * @@ -377,7 +387,7 @@ public boolean containedExactlyIn(Inventory i) { * @return true if this instance is completly contained in the given stack, * false if not */ - public boolean isContainedBy(ItemMap im) { + public boolean isContainedIn(ItemMap im) { for (Entry entry : getDifference(im).getEntrySet()) { if (entry.getValue() < 0) { return false; @@ -432,7 +442,7 @@ public void multiplyContent(double multiplier) { * false if not */ public boolean contains(ItemMap im) { - return im.isContainedBy(this); + return im.isContainedIn(this); } /** @@ -483,6 +493,19 @@ public boolean fitsIn(Inventory i) { return instanceCopy.getItemStackRepresentation().size() <= i.getSize(); } + public boolean equals(Object o) { + if (o instanceof ItemMap) { + ItemMap im = (ItemMap) o; + if (im.getTotalItemAmount() == getTotalItemAmount()) { + ItemMap diff = im.getDifference(this); + if (diff.getEntrySet().size() == 0) { + return true; + } + } + } + return false; + } + /** * Utility to not mess with stacks directly taken from inventories * From 8715e4033e8911c3fa1e99be785f002110e37470 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 02:42:19 +0100 Subject: [PATCH 170/459] Fixing recipes, adding repair recipes, starting to work on cofig parsing --- .../igotyou/FactoryMod/ConfigParser.java | 27 + .../igotyou/FactoryMod/FactoryModManager.java | 2 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 595 ++++++++---------- .../classicTriblockFactory/Compactor.java | 347 ---------- .../classicTriblockFactory/RepairFactory.java | 322 ---------- .../FactoryMod/recipes/CompactingRecipe.java | 2 +- .../recipes/DecompactingRecipe.java | 2 +- ...nputOutputRecipe.java => InputRecipe.java} | 8 +- .../FactoryMod/recipes/ProductionRecipe.java | 6 +- .../FactoryMod/recipes/RepairRecipe.java | 52 ++ .../repairManager/IRepairManager.java | 2 +- 11 files changed, 360 insertions(+), 1005 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/ConfigParser.java delete mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java delete mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java rename src/com/github/igotyou/FactoryMod/recipes/{InputOutputRecipe.java => InputRecipe.java} (89%) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java new file mode 100644 index 00000000..42486bbb --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -0,0 +1,27 @@ +package com.github.igotyou.FactoryMod; + +import org.bukkit.Material; +import org.bukkit.configuration.file.FileConfiguration; + +public class ConfigParser { + private FactoryModPlugin plugin; + public ConfigParser(FactoryModPlugin plugin) { + this.plugin = plugin; + } + + public FactoryModManager parse() { + plugin.saveDefaultConfig(); + plugin.reloadConfig(); + FileConfiguration config = plugin.getConfig(); + plugin.CITADEL_ENABLED = config.getBoolean("citadel_enabled", true); + plugin.FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString( + "factory_interaction_material", "STICK")); + // Check if XP drops should be disabled + plugin.DISABLE_EXPERIENCE = config.getBoolean("disable_experience", + false); + int updateTime = config.getInt("update_time"); + + return null; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 07e64c89..7d7fb7ca 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -14,7 +14,7 @@ import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.ItemMap; -public abstract class FactoryModManager { +public class FactoryModManager { protected FactoryModPlugin plugin; private HashMap, HashMap> factoryCreationRecipes; diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 57a23466..39278400 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -23,165 +23,106 @@ import vg.civcraft.mc.civmodcore.ACivMod; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.listeners.NoteStackListener; import com.github.igotyou.FactoryMod.listeners.RedstoneListener; -import com.github.igotyou.FactoryMod.managers.FactoryManagerService; -import com.github.igotyou.FactoryMod.managers.ProductionFactoryManager; -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import com.github.igotyou.FactoryMod.properties.CompactorProperties; import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.properties.ProductionProperties; -import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +public class FactoryModPlugin extends ACivMod { -public class FactoryModPlugin extends ACivMod -{ - /* Special Values */ - public static final String PRINTING_PRESSES_SAVE_FILE = "pressSaves"; // The printing press saves file name - public static final String NETHER_FACTORY_SAVE_FILE = "netherSaves"; // The nether saves file name - public static final String REPAIR_FACTORY_SAVE_FILE = "repairSaves"; - public static final String COMPACTOR_SAVE_FILE = "compactorSaves"; - public static final String PRODUCTION_FACTORY_SAVE_FILE = "productionSaves"; - public static final String PERSISTENCE_FORMAT = "txt"; - public static final int TICKS_PER_SECOND = 20; //ideal number of ticks per second - public static final int TICKS_PER_MIN = 20; //ideal number of ticks per minute - public static final int MILLIS_PER_DAY = 24 * 60 * 60 * 1000; // number of milliseconds per day (86.4M) - public static final int MINUTES_PER_YEAR = 60 * 60 * 24 * 365; //number of minutes per year (31.5M) - private static final String CONFIG_FILE = "config.yml"; // the config file name - private static final AdvancedItemStack DEFAULT_FUEL = new AdvancedItemStack(Material.COAL, 1, (short)1, "Charcoal"); // The default fuel item - - /* General Properties */ - - /** - * How frequently in ticks factory states are updated (Default 20) - */ - public static int PRODUCER_UPDATE_CYCLE; - /** - * How often in minutes the managers should save their factories to file (Default 15) - */ - public static int SAVE_CYCLE; - /** - * Number of days after a factory falls into disrepair until it is removed (Default 14) - */ - public static long DISREPAIR_PERIOD; - /** - * Number of days for a factory to fully degrade from 100% to 0% health (Default 28) - */ - public static long REPAIR_PERIOD; - /** * The item used to interact with factoies (Default STICK) */ - public static Material FACTORY_INTERACTION_MATERIAL; + static Material FACTORY_INTERACTION_MATERIAL; /** * Whether Citadel is enabled (Default true) */ - public static boolean CITADEL_ENABLED; + static boolean CITADEL_ENABLED; /** * Whether XP orb drops are disabled (Default false) */ - public static boolean DISABLE_EXPERIENCE; - - - - - public static Map productionProperties; - public static Map productionRecipes; - - public FactoryManagerService manager; - public PrintingPressProperties printingPressProperties; - public NetherFactoryProperties netherFactoryProperties; - public RepairFactoryProperties repairFactoryProperties; - public CompactorProperties compactorProperties; - - public void onEnable() - { + static boolean DISABLE_EXPERIENCE; + + private static FactoryModManager manager; + private static FactoryModPlugin plugin; + + public void onEnable() { super.onEnable(); plugin = this; - //load the config.yml - initConfig(); - //create the main manager - manager = new FactoryManagerService(this); - //register the events(this should be moved...) + ConfigParser cp = new ConfigParser(this); + manager = cp.parse(); registerEvents(); } - - public void onDisable() - { - //call the disable method, this will save the data etc. - manager.onDisable(); + + public void onDisable() { + } + + public static FactoryModManager getManager() { + return manager; } - + public String getPluginName() { return "FactoryMod"; } - - public void registerEvents() - { - try - { - getServer().getPluginManager().registerEvents(new FactoryModListener(manager), this); - getServer().getPluginManager().registerEvents(new RedstoneListener(manager), this); - getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); - getServer().getPluginManager().registerEvents(new CompactItemListener(compactorProperties.getCompactLore()),this); - } - catch(Exception e) - { + + public void registerEvents() { + try { + getServer().getPluginManager().registerEvents( + new FactoryModListener(manager), this); + getServer().getPluginManager().registerEvents( + new RedstoneListener(manager), this); + getServer().getPluginManager().registerEvents( + new NoteStackListener(this), this); + getServer().getPluginManager().registerEvents( + new CompactItemListener( + compactorProperties.getCompactLore()), this); + } catch (Exception e) { e.printStackTrace(); } } - - public void initConfig() - { - sendConsoleMessage("Initializing FactoryMod Config."); - - productionProperties = Maps.newHashMap(); - productionRecipes = Maps.newHashMap(); - - FileConfiguration config = getConfig(); - if(getConfig().getDefaults().getBoolean("copy_defaults", true)) - { - saveResource(CONFIG_FILE, true); - } - this.saveDefaultConfig(); - reloadConfig(); - config = getConfig(); - //is citadel enabled? - CITADEL_ENABLED = config.getBoolean("general.citadel_enabled",true); - //what's the tool that we use to interact with the factorys? - FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString("general.factory_interaction_material","STICK")); - //Check if XP drops should be disabled - DISABLE_EXPERIENCE=config.getBoolean("general.disable_experience",false); - //How frequently factories are updated - PRODUCER_UPDATE_CYCLE = config.getInt("production_general.update_cycle",20); - //Period of days before a factory is removed after it falls into disrepair - DISREPAIR_PERIOD= config.getLong("general.disrepair_period",14)*24*60*60*1000; - //The length of time it takes a factory to go to 0% health - REPAIR_PERIOD = config.getLong("production_general.repair_period",28)*24*60*60*1000; + public void initConfig() { + // is citadel enabled? + CITADEL_ENABLED = config.getBoolean("general.citadel_enabled", true); + // what's the tool that we use to interact with the factorys? + FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString( + "general.factory_interaction_material", "STICK")); + // Check if XP drops should be disabled + DISABLE_EXPERIENCE = config.getBoolean("general.disable_experience", + false); + // How frequently factories are updated + PRODUCER_UPDATE_CYCLE = config.getInt( + "production_general.update_cycle", 20); + // Period of days before a factory is removed after it falls into + // disrepair + DISREPAIR_PERIOD = config.getLong("general.disrepair_period", 14) * 24 + * 60 * 60 * 1000; + // The length of time it takes a factory to go to 0% health + REPAIR_PERIOD = config.getLong("production_general.repair_period", 28) + * 24 * 60 * 60 * 1000; // Disable the following recipes List toDisable = new ArrayList(); - ItemList disabledRecipes = getItems(config.getConfigurationSection("crafting.disable")); + ItemList disabledRecipes = getItems(config + .getConfigurationSection("crafting.disable")); for (AdvancedItemStack recipe : disabledRecipes) { - sendConsoleMessage("Attempting to disable recipes for " + recipe.getCommonName()); - + sendConsoleMessage("Attempting to disable recipes for " + + recipe.getCommonName()); + List tempList = getServer().getRecipesFor(recipe); - + for (Recipe potential : tempList) { if (potential.getResult().isSimilar(recipe)) { - sendConsoleMessage("Found a disable recipe match " + potential.toString()); + sendConsoleMessage("Found a disable recipe match " + + potential.toString()); toDisable.add(potential); } } @@ -190,328 +131,332 @@ public void initConfig() Iterator it = getServer().recipeIterator(); while (it.hasNext()) { Recipe recipe = it.next(); - for (Recipe disable : toDisable) { // why can't they just override equality tests?! + for (Recipe disable : toDisable) { // why can't they just override + // equality tests?! if (disable.getResult().isSimilar(recipe.getResult())) { it.remove(); - sendConsoleMessage("Disabling recipe " + recipe.getResult().toString()); + sendConsoleMessage("Disabling recipe " + + recipe.getResult().toString()); } } } - - //Enable the following recipes - ConfigurationSection configCraftingEnable = config.getConfigurationSection("crafting.enable"); - for (String recipeName : configCraftingEnable.getKeys(false)) - { - ConfigurationSection configSection=configCraftingEnable.getConfigurationSection(recipeName); + + // Enable the following recipes + ConfigurationSection configCraftingEnable = config + .getConfigurationSection("crafting.enable"); + for (String recipeName : configCraftingEnable.getKeys(false)) { + ConfigurationSection configSection = configCraftingEnable + .getConfigurationSection(recipeName); Recipe recipe; List shape = configSection.getStringList("shape"); - AdvancedItemStack output = getItems(configSection.getConfigurationSection("output")).get(0); - - if(shape.isEmpty()) - { + AdvancedItemStack output = getItems( + configSection.getConfigurationSection("output")).get(0); + + if (shape.isEmpty()) { ShapelessRecipe shapelessRecipe = new ShapelessRecipe(output); - - for (ItemStack input:getItems(configSection.getConfigurationSection("inputs"))) - { - //shapelessRecipe.addIngredient(input.getAmount(), input.getType()); - shapelessRecipe.addIngredient(input.getAmount(), input.getType(), input.getDurability()); + + for (ItemStack input : getItems(configSection + .getConfigurationSection("inputs"))) { + // shapelessRecipe.addIngredient(input.getAmount(), + // input.getType()); + shapelessRecipe.addIngredient(input.getAmount(), + input.getType(), input.getDurability()); } - + recipe = shapelessRecipe; - sendConsoleMessage("Enabling shapeless recipe " + recipeName + " - " + recipe.getResult().getType().name()); - } - else - { + sendConsoleMessage("Enabling shapeless recipe " + recipeName + + " - " + recipe.getResult().getType().name()); + } else { for (String line : shape) { sendConsoleMessage("New Shape Line: [" + line + "]"); } - + sendConsoleMessage("output: " + output.toString()); - + ShapedRecipe shapedRecipe = new ShapedRecipe(output); shapedRecipe.shape(shape.toArray(new String[shape.size()])); - - for(String inputKey : configSection.getConfigurationSection("inputs").getKeys(false)) - { - ItemStack input = getItems(configSection.getConfigurationSection("inputs." + inputKey)).get(0); - shapedRecipe.setIngredient(inputKey.charAt(0),input.getType()); - //shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); + + for (String inputKey : configSection.getConfigurationSection( + "inputs").getKeys(false)) { + ItemStack input = getItems( + configSection.getConfigurationSection("inputs." + + inputKey)).get(0); + shapedRecipe.setIngredient(inputKey.charAt(0), + input.getType()); + // shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); } - + recipe = shapedRecipe; - sendConsoleMessage("Enabling shaped recipe " + recipeName + " - " + recipe.getResult().getType().name()); + sendConsoleMessage("Enabling shaped recipe " + recipeName + + " - " + recipe.getResult().getType().name()); } - + Bukkit.addRecipe(recipe); } - - //Import recipes from config.yml - ConfigurationSection configProdRecipes = config.getConfigurationSection("production_recipes"); - //Temporary Storage array to store where recipes should point to each other + + // Import recipes from config.yml + ConfigurationSection configProdRecipes = config + .getConfigurationSection("production_recipes"); + // Temporary Storage array to store where recipes should point to each + // other Map> outputRecipes = Maps.newHashMap(); - - for (String title : configProdRecipes.getKeys(false)) - { - //Section header in recipe file, also serves as unique identifier for the recipe - //All spaces are replaced with udnerscores so they don't disrupt saving format - //There should be a check for uniqueness of this identifier... - ConfigurationSection configSection = configProdRecipes.getConfigurationSection(title); + + for (String title : configProdRecipes.getKeys(false)) { + // Section header in recipe file, also serves as unique identifier + // for the recipe + // All spaces are replaced with udnerscores so they don't disrupt + // saving format + // There should be a check for uniqueness of this identifier... + ConfigurationSection configSection = configProdRecipes + .getConfigurationSection(title); title = title.replaceAll(" ", "_"); - //Display name of the recipe, Deafult of "Default Name" + // Display name of the recipe, Deafult of "Default Name" String recipeName = configSection.getString("name", "Default Name"); - //Production time of the recipe, default of 1 - //TODO: fix config according to default 1 + // Production time of the recipe, default of 1 + // TODO: fix config according to default 1 int productionTime = configSection.getInt("production_time", 2); - //Inputs of the recipe, empty of there are no inputs - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); - //Inputs of the recipe, empty of there are no inputs - ItemList upgrades = getItems(configSection.getConfigurationSection("upgrades")); - //Outputs of the recipe, empty of there are no inputs - ItemList outputs = getItems(configSection.getConfigurationSection("outputs")); - //EnchantmentOptions of the recipe, all false if nothing set. - ConfigurationSection configEnchant = configSection.getConfigurationSection("enchantment_options"); + // Inputs of the recipe, empty of there are no inputs + ItemList inputs = getItems(configSection + .getConfigurationSection("inputs")); + // Inputs of the recipe, empty of there are no inputs + ItemList upgrades = getItems(configSection + .getConfigurationSection("upgrades")); + // Outputs of the recipe, empty of there are no inputs + ItemList outputs = getItems(configSection + .getConfigurationSection("outputs")); + // EnchantmentOptions of the recipe, all false if nothing set. + ConfigurationSection configEnchant = configSection + .getConfigurationSection("enchantment_options"); EnchantmentOptions enchantmentOptions = null; if (configEnchant != null) { - enchantmentOptions = new EnchantmentOptions(configEnchant.getBoolean("safe_only", false), + enchantmentOptions = new EnchantmentOptions( + configEnchant.getBoolean("safe_only", false), configEnchant.getBoolean("ensure_one", false)); } else { enchantmentOptions = EnchantmentOptions.DEFAULT; } - //Enchantments of the recipe, empty of there are no inputs - List enchantments = getEnchantments(configSection.getConfigurationSection("enchantments")); - //Whether this recipe can only be used once + // Enchantments of the recipe, empty of there are no inputs + List enchantments = getEnchantments(configSection + .getConfigurationSection("enchantments")); + // Whether this recipe can only be used once boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title, recipeName, productionTime, inputs, upgrades, outputs, enchantmentOptions, enchantments, useOnce, new ItemList()); + ProductionRecipe recipe = new ProductionRecipe(title, recipeName, + productionTime, inputs, upgrades, outputs, + enchantmentOptions, enchantments, useOnce, + new ItemList()); productionRecipes.put(title, recipe); - //Store the titles of the recipes that this should point to - List currentOutputRecipes = Lists.newArrayList(); - currentOutputRecipes.addAll(configSection.getStringList("output_recipes")); + // Store the titles of the recipes that this should point to + List currentOutputRecipes = Lists.newArrayList(); + currentOutputRecipes.addAll(configSection + .getStringList("output_recipes")); outputRecipes.put(recipe, currentOutputRecipes); } - - //Once ProductionRecipe objects have been created correctly insert different pointers - for (ProductionRecipe recipe : outputRecipes.keySet()) - { - for( String output : outputRecipes.get(recipe)) - { + + // Once ProductionRecipe objects have been created correctly insert + // different pointers + for (ProductionRecipe recipe : outputRecipes.keySet()) { + for (String output : outputRecipes.get(recipe)) { recipe.addOutputRecipe(productionRecipes.get(output)); } } - - - //Import factories from config.yml - ConfigurationSection configProdFactories = config.getConfigurationSection("production_factories"); - for (String title : configProdFactories.getKeys(false)) - { - ConfigurationSection configSection = configProdFactories.getConfigurationSection(title); + + // Import factories from config.yml + ConfigurationSection configProdFactories = config + .getConfigurationSection("production_factories"); + for (String title : configProdFactories.getKeys(false)) { + ConfigurationSection configSection = configProdFactories + .getConfigurationSection(title); title = title.replaceAll(" ", "_"); - String factoryName = configSection.getString("name", "Default Name"); - //Uses overpowered getItems method for consistency, should always return a list of size=1 - //If no fuel is found, default to charcoal - ItemList fuel = getItems(configSection.getConfigurationSection("fuel")); - if(fuel.isEmpty()) - { + String factoryName = configSection + .getString("name", "Default Name"); + // Uses overpowered getItems method for consistency, should always + // return a list of size=1 + // If no fuel is found, default to charcoal + ItemList fuel = getItems(configSection + .getConfigurationSection("fuel")); + if (fuel.isEmpty()) { fuel = new ItemList(); fuel.add(DEFAULT_FUEL); } - //TODO: default fuel time should be 1 + // TODO: default fuel time should be 1 int fuelTime = configSection.getInt("fuel_time", 2); - ItemList inputs = getItems(configSection.getConfigurationSection("inputs")); - ItemList repairs = getItems(configSection.getConfigurationSection("repair_inputs")); - + ItemList inputs = getItems(configSection + .getConfigurationSection("inputs")); + ItemList repairs = getItems(configSection + .getConfigurationSection("repair_inputs")); + List factoryRecipes = Lists.newArrayList(); - for (String recipe : configSection.getStringList("recipes")) - { + for (String recipe : configSection.getStringList("recipes")) { factoryRecipes.add(productionRecipes.get(recipe)); } - - int repair = configSection.getInt("repair_multiple",0); - //Create repair recipe - productionRecipes.put(title + "REPAIR", new ProductionRecipe(title + "REPAIR", "Repair Factory", 1, repairs)); + + int repair = configSection.getInt("repair_multiple", 0); + // Create repair recipe + productionRecipes.put(title + "REPAIR", new ProductionRecipe(title + + "REPAIR", "Repair Factory", 1, repairs)); factoryRecipes.add(productionRecipes.get(title + "REPAIR")); - ProductionProperties productionProperty = new ProductionProperties(inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); + ProductionProperties productionProperty = new ProductionProperties( + inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); productionProperties.put(title, productionProperty); } - - ConfigurationSection configPrintingPresses = config.getConfigurationSection("printing_presses"); - ConfigurationSection configNetherFactory = config.getConfigurationSection("nether_factory"); - ConfigurationSection configRepairFactory=config.getConfigurationSection("repair_factory"); - ConfigurationSection configCompactor=config.getConfigurationSection("compactor"); - printingPressProperties = PrintingPressProperties.fromConfig(this, configPrintingPresses); - netherFactoryProperties = NetherFactoryProperties.fromConfig(this, configNetherFactory); - repairFactoryProperties = RepairFactoryProperties.fromConfig(this, configRepairFactory); - compactorProperties = CompactorProperties.fromConfig(this, configCompactor); + + ConfigurationSection configPrintingPresses = config + .getConfigurationSection("printing_presses"); + ConfigurationSection configNetherFactory = config + .getConfigurationSection("nether_factory"); + ConfigurationSection configRepairFactory = config + .getConfigurationSection("repair_factory"); + ConfigurationSection configCompactor = config + .getConfigurationSection("compactor"); + printingPressProperties = PrintingPressProperties.fromConfig(this, + configPrintingPresses); + netherFactoryProperties = NetherFactoryProperties.fromConfig(this, + configNetherFactory); + repairFactoryProperties = RepairFactoryProperties.fromConfig(this, + configRepairFactory); + compactorProperties = CompactorProperties.fromConfig(this, + configCompactor); sendConsoleMessage("Finished initializing FactoryMod Config."); } - - private List getEnchantments(ConfigurationSection configEnchantments) - { + + private List getEnchantments( + ConfigurationSection configEnchantments) { List enchantments = Lists.newArrayList(); - if(configEnchantments != null) - { - for (String name : configEnchantments.getKeys(false)) - { - ConfigurationSection configEnchantment = configEnchantments.getConfigurationSection(name); + if (configEnchantments != null) { + for (String name : configEnchantments.getKeys(false)) { + ConfigurationSection configEnchantment = configEnchantments + .getConfigurationSection(name); String type = configEnchantment.getString("type"); - if (type != null) - { + if (type != null) { int level = configEnchantment.getInt("level", 1); - double probability = configEnchantment.getDouble("probability", 1.0); - ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment(name, type, level, probability); + double probability = configEnchantment.getDouble( + "probability", 1.0); + ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment( + name, type, level, probability); enchantments.add(enchantment); } } } return enchantments; } - - private List getPotionEffects(ConfigurationSection configurationSection) { + + private List getPotionEffects( + ConfigurationSection configurationSection) { List potionEffects = Lists.newArrayList(); - if(configurationSection != null) - { - for (String name : configurationSection.getKeys(false)) - { - ConfigurationSection configEffect = configurationSection.getConfigurationSection(name); + if (configurationSection != null) { + for (String name : configurationSection.getKeys(false)) { + ConfigurationSection configEffect = configurationSection + .getConfigurationSection(name); String type = configEffect.getString("type"); - if (type != null) - { + if (type != null) { PotionEffectType effect = PotionEffectType.getByName(type); if (effect != null) { int duration = configEffect.getInt("duration", 200); int amplifier = configEffect.getInt("amplifier", 0); - potionEffects.add(new PotionEffect(effect, duration, amplifier)); + potionEffects.add(new PotionEffect(effect, duration, + amplifier)); } } } } return potionEffects; } - - public ItemList getItems(ConfigurationSection configItems) - { + + public ItemList getItems(ConfigurationSection configItems) { ItemList items = new ItemList(); - if(configItems != null) - { - for(String commonName : configItems.getKeys(false)) - { - - ConfigurationSection configItem = configItems.getConfigurationSection(commonName); + if (configItems != null) { + for (String commonName : configItems.getKeys(false)) { + + ConfigurationSection configItem = configItems + .getConfigurationSection(commonName); String materialName = configItem.getString("material"); Material material = Material.getMaterial(materialName); - //only proceeds if an acceptable material name was provided - if (material == null) - { - getLogger().severe(configItems.getCurrentPath() + " requires invalid material " + materialName); - } - else - { + // only proceeds if an acceptable material name was provided + if (material == null) { + getLogger().severe( + configItems.getCurrentPath() + + " requires invalid material " + + materialName); + } else { int amount = configItem.getInt("amount", 1); - short durability = (short)configItem.getInt("durability", 0); - int repairCost = (short)configItem.getInt("repair_cost", 0); + short durability = (short) configItem.getInt("durability", + 0); + int repairCost = (short) configItem + .getInt("repair_cost", 0); String displayName = configItem.getString("display_name"); String lore = configItem.getString("lore"); - List compulsoryEnchantments = getEnchantments(configItem.getConfigurationSection("enchantments")); - List storedEnchantments = getEnchantments(configItem.getConfigurationSection("stored_enchantments")); - List potionEffects = getPotionEffects(configItem.getConfigurationSection("potion_effects")); - items.add(createItemStack(material, amount, durability, displayName, lore, commonName, repairCost, compulsoryEnchantments, storedEnchantments, potionEffects)); + List compulsoryEnchantments = getEnchantments(configItem + .getConfigurationSection("enchantments")); + List storedEnchantments = getEnchantments(configItem + .getConfigurationSection("stored_enchantments")); + List potionEffects = getPotionEffects(configItem + .getConfigurationSection("potion_effects")); + items.add(createItemStack(material, amount, durability, + displayName, lore, commonName, repairCost, + compulsoryEnchantments, storedEnchantments, + potionEffects)); } } } - + return items; } - private AdvancedItemStack createItemStack(Material material, int stackSize, short durability, String name, String loreString, String commonName, int repairCost, - List compulsoryEnchants, List storedEnchants, List potionEffects) - { - AdvancedItemStack namedItemStack= new AdvancedItemStack(material, stackSize, durability,commonName); - if(name != null || loreString != null || compulsoryEnchants.size() > 0 || storedEnchants.size() > 0 || potionEffects.size() > 0 || repairCost > 0) - { + private AdvancedItemStack createItemStack(Material material, int stackSize, + short durability, String name, String loreString, + String commonName, int repairCost, + List compulsoryEnchants, + List storedEnchants, + List potionEffects) { + AdvancedItemStack namedItemStack = new AdvancedItemStack(material, + stackSize, durability, commonName); + if (name != null || loreString != null || compulsoryEnchants.size() > 0 + || storedEnchants.size() > 0 || potionEffects.size() > 0 + || repairCost > 0) { ItemMeta meta = namedItemStack.getItemMeta(); - + if (name != null) { meta.setDisplayName(name); } - + if (meta instanceof Repairable && repairCost > 0) { ((Repairable) meta).setRepairCost(repairCost); } - - if (loreString!=null) { + + if (loreString != null) { List lore = Lists.newArrayList(); lore.add(loreString); meta.setLore(lore); } - + for (ProbabilisticEnchantment enchant : compulsoryEnchants) { - meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), false); + meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), + false); } - + if (meta instanceof EnchantmentStorageMeta) { EnchantmentStorageMeta esm = (EnchantmentStorageMeta) meta; for (ProbabilisticEnchantment enchant : storedEnchants) { - esm.addStoredEnchant(enchant.getEnchantment(), enchant.getLevel(), false); + esm.addStoredEnchant(enchant.getEnchantment(), + enchant.getLevel(), false); } } - + if (meta instanceof PotionMeta) { PotionMeta pm = (PotionMeta) meta; for (PotionEffect effect : potionEffects) { pm.addCustomEffect(effect, true); } } - + namedItemStack.setItemMeta(meta); } - - return namedItemStack; - } - - public static IFactoryProperties getProperties(FactoryType factoryType, String subFactoryType) - { - switch(factoryType) - { - case PRODUCTION: - return FactoryModPlugin.productionProperties.get(subFactoryType); - default: - return null; - } - } - - public static int getMaxTiers(FactoryType factoryType) - { - // TODO Auto-generated method stub - return 0; - } - public static void sendConsoleMessage(String message) - { - Bukkit.getLogger().info(FactoryModPlugin.PLUGIN_PREFIX + message); - } - - public static void logFileError(String fileName, int lineNum, String error) { - sendConsoleMessage(new StringBuilder("ERROR at line ") - .append(lineNum).append(" of ").append(fileName).append(": ").append(error).toString()); + return namedItemStack; } - public PrintingPressProperties getPrintingPressProperties() { - return printingPressProperties; - } - - public NetherFactoryProperties getNetherFactoryProperties() { - return netherFactoryProperties; - } - public RepairFactoryProperties getRepairFactoryProperties() { - return repairFactoryProperties; - } - - public CompactorProperties getCompactorProperties() { - return compactorProperties; - } - - private static FactoryModPlugin plugin; - public static FactoryModPlugin getPlugin(){ + public static FactoryModPlugin getPlugin() { return plugin; } } diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java deleted file mode 100644 index af0b0ba5..00000000 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/Compactor.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.github.igotyou.FactoryMod.classicTriblockFactory; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -import com.github.igotyou.FactoryMod.properties.CompactorProperties; -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class Compactor extends ABaseFactory { - - private CompactorProperties cp; - private CompactorMode mode; - - - public Compactor(Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, CompactorProperties compactorProperties) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, FactoryType.COMPACTOR, "Compactor"); - cp = compactorProperties; - mode = CompactorMode.REPAIR; - } - - public Compactor(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, CompactorProperties compactorProperties, - CompactorMode mode, double currentRepair, long timeDisrepair) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.COMPACTOR, active, - "Compactor", 0, 0, currentRepair, timeDisrepair); - cp = compactorProperties; - this.mode = mode; - } - - public boolean isRepairing() { - return mode.equals(CompactorMode.REPAIR); - } - - public ItemList getFuel() { - return cp.getFuel(); - } - - public double getEnergyTime() { - return cp.getEnergyTime(); - } - - public double getProductionTime() { - if (mode.equals(CompactorMode.REPAIR)) { - return cp.getRepairTime(); - } else { - return cp.getProductionTime(); - } - } - - public ItemList getInputs() { - ItemList inputs = new ItemList(); - Inventory inv = getInventory(); - if(mode.equals(CompactorMode.DECOMPACT)) { - for(ItemStack is : inv.getContents()) { - if(canDecompact(is)) { - AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); - clone.setAmount(1); - inputs.add(clone); - - return inputs; - } - } - } else if (mode.equals(CompactorMode.COMPACT)) { - for(ItemStack is : inv.getContents()) { - if(canCompact(is)) { - AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); - inputs.add(clone); - - inputs.addAll(cp.getRecipeMaterials()); - return inputs; - } - } - } - return inputs; - } - - /** - * Returns true is the item stack is not null, if the item is a full sized stack, with size - * more than one (to prevent simply adding lore to single items), that the item does NOT have - * lore, and that the item type isn't on the general exclusions nor is the item similar - * to any specific exclusions. - * - * Logic is structure to fail fast; e.g. quickest test is first, down in order to slowest test - * with success at each gate resulting in a slower test, so failure is fast and success is - * comprehensive. - * - * @param is the ItemStack to check validity of compaction - * @return true if can be compacted, false otherwise - */ - private boolean canCompact(ItemStack is) { - if (is != null && is.getAmount() == is.getMaxStackSize() && - is.getAmount() > 1 && !is.getItemMeta().hasLore()) { - if (!cp.getGeneralExclusions().contains(is.getType())) { - for (ItemStack specExclude : cp.getSpecificExclusions()) { - if (specExclude.isSimilar(is)) { - return false; - } - } - return true; - } // else return false - } - return false; - } - - /** - * Returns true if the item stack is not null, and has lore where the lore contains - * the special lore of this factory, and where the item is not excluded. See canCompact. - * - * This is also fail-fast. - * - * @param is the ItemStack to check validity of decompaction - * @return true if can be decompacted, false otherwise - */ - private boolean canDecompact(ItemStack is) { - if (is != null && is.getItemMeta().hasLore() && - is.getItemMeta().getLore().contains(cp.getCompactLore()) ) { - if (!cp.getGeneralExclusions().contains(is.getType())) { - for (ItemStack specExclude : cp.getSpecificExclusions()) { - if (specExclude.isSimilar(is)) { - return false; - } - } - return true; - } // else return false - } - return false; - } - - public ItemList getOutputs() { - ItemList outputs = new ItemList(); - Inventory inv = getInventory(); - if (mode.equals( CompactorMode.DECOMPACT )) { - for(ItemStack is : inv.getContents()) { - if(canDecompact(is)) { - AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); - clone.setAmount(clone.getMaxStackSize()); - ItemMeta cloneMeta = clone.getItemMeta(); - cloneMeta.setLore(null); - clone.setItemMeta(cloneMeta); - outputs.add(clone); - - return outputs; - } - } - } else if (mode.equals( CompactorMode.COMPACT )) { - for (ItemStack is : inv.getContents()) { - if(canCompact(is)) { - AdvancedItemStack clone = new AdvancedItemStack(is.clone(), is.getItemMeta().hasDisplayName() ? is.getItemMeta().getDisplayName() : is.getType().toString()); - clone.setAmount(1); - ItemMeta cloneMeta = clone.getItemMeta(); - List lore = new ArrayList(); - lore.add(cp.getCompactLore()); - cloneMeta.setLore(lore); - clone.setItemMeta(cloneMeta); - - outputs.add(clone); - return outputs; - } - } - } - return outputs; - } - - public ItemList getRepairs() { - if (mode.equals( CompactorMode.REPAIR)) { - return cp.getRepairMaterials(); - } else { - return new ItemList(); - } - } - - public void update() { - if(active) { - if(checkHasMaterials()) { - if(currentProductionTimer < getProductionTime()) { - if(isFuelAvailable()) { - if(currentEnergyTimer == getEnergyTime() - 1) { - getFuel().removeFrom(getPowerSourceInventory()); - currentEnergyTimer = 0; - fuelConsumed(); - } else { - currentEnergyTimer++; - } - currentProductionTimer++; - postUpdate(); - } else { - powerOff(); - } - } else if(currentProductionTimer >= getProductionTime()) { - if (checkHasSpace()) { - if (mode.equals(CompactorMode.REPAIR)) { - repair(getRepairs().removeMaxFrom(getInventory(), (int)currentRepair)); - } else if (mode.equals(CompactorMode.COMPACT) || mode.equals(CompactorMode.DECOMPACT)) { - recipeFinished(); - } - - currentProductionTimer = 0; - currentEnergyTimer = 0; - - // keep going? - if (!cp.getContinuous() || mode.equals(CompactorMode.REPAIR)) { - powerOff(); - } - } else { // No room, shut off. - currentProductionTimer = 0; - currentEnergyTimer = 0; - - powerOff(); - } - } - } else { - powerOff(); - } - } - } - - @Override - public boolean checkHasMaterials() { - if (mode.equals(CompactorMode.REPAIR)) { - return super.checkHasMaterials(); - } else { - return super.checkHasMaterials() && !getInputs().isEmpty(); - } - } - - protected void recipeFinished() { - ItemList output = getOutputs(); - getInputs().removeFrom(getInventory()); - output.putIn(getInventory()); - } - - public int getMaxRepair() { - return cp.getRepair(); - } - - public List getCentralBlockResponse() { - List responses=new ArrayList(); - if (!active) { - CompactorMode mode = this.mode.getNext(); - this.mode = mode; - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to " + this.mode.getDescription() + ".")); - } else { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); - } - return responses; - } - - public List getChestResponse(){ - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - int maxRepair = getMaxRepair(); - boolean maintenanceActive = maxRepair!=0; - String response = ""; // the response specific to the mode. - - if (mode.equals(CompactorMode.COMPACT) ) { - ItemList inputs = getInputs(); - response = (inputs.isEmpty() ? "Nothing to compact." : "Next up to compact: " + inputs.toString() ); - } else if (mode.equals(CompactorMode.DECOMPACT)){ - ItemList inputs = getInputs(); - if (inputs.isEmpty()) { - response = "Nothing to decompact."; - } else { - if (checkHasSpace()) { - response = "Next up for decompact: " + inputs.toString() + " " + cp.getCompactLore(); - } else { - response = "Make room in the chest to decompact"; - } - } - } - - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; - int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, cp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); - - if(!getRepairs().isEmpty()&&maintenanceActive&& mode == CompactorMode.REPAIR) - { - int amountAvailable=getRepairs().amountAvailable(getInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); - } else { - responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); - } - - responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); - - return responses; - } - - public enum CompactorMode { - REPAIR(0, "Repair Factory"), - COMPACT(1, "Compact Items"), - DECOMPACT(2, "De-Compact Items"); - - private static final int MAX_ID = 3; - private int id; - private String description; - - private CompactorMode(int id, String description) { - this.id = id; - this.description = description; - } - - public static CompactorMode byId(int id) { - for(CompactorMode mode : CompactorMode.values()) { - if(mode.getId() == id) { - return mode; - } - } - return null; - } - - public int getId() { - return id; - } - - public String getDescription() { - return description; - } - - public CompactorMode getNext() { - int nextId = (getId() + 1) % MAX_ID; - return byId(nextId); - } - } - - public CompactorMode getMode() { - return mode; - } - - public IFactoryProperties getProperties() { - return cp; - } -} diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java deleted file mode 100644 index 9e9e0f85..00000000 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/RepairFactory.java +++ /dev/null @@ -1,322 +0,0 @@ -package com.github.igotyou.FactoryMod.classicTriblockFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; - -import net.minecraft.server.v1_8_R3.ItemStack; - -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; - -import com.github.igotyou.FactoryMod.properties.IFactoryProperties; -import com.github.igotyou.FactoryMod.properties.RepairFactoryProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class RepairFactory extends ABaseFactory{ - - private RepairFactoryProperties rfp; - private RepairFactoryMode mode; - - private static Logger log = Logger.getLogger(RepairFactory.class.getName()); - - // Constructor for when initial creation of factory. - public RepairFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, RepairFactoryProperties repairFactoryProperties) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, - FactoryType.REPAIR_FACTORY, "Repair Factory"); - this.rfp = repairFactoryProperties; - this.mode = RepairFactoryMode.REPAIR; - } - - public RepairFactory(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, RepairFactoryProperties repairFactoryProperties, - RepairFactoryMode mode, double currentRepair, long timeDisrepair) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, FactoryType.REPAIR_FACTORY, active, - "Repair Factory", 0, 0, currentRepair, timeDisrepair); - this.rfp = repairFactoryProperties; - this.mode = mode; - } - - @Override - public boolean isRepairing() { - return mode == RepairFactoryMode.REPAIR; - } - - @Override - public ItemList getFuel() { - return rfp.getFuel(); - } - - @Override - public void update() - { - //if factory is turned on - if (active){ - //if the materials required to produce the current recipe are in the factory inventory - if (checkHasMaterials()){ - //if the factory has been working for less than the required time for the recipe - if (currentProductionTimer < getProductionTime()){ - //if the factory power source inventory has enough fuel for at least 1 energyCycle - if (isFuelAvailable()){ - //if the time since fuel was last consumed is equal to how often fuel needs to be consumed - if (currentEnergyTimer == getEnergyTime()-1){ - //remove one fuel. - getFuel().removeFrom(getPowerSourceInventory()); - //0 seconds since last fuel consumption - currentEnergyTimer = 0; - fuelConsumed(); - } else { - currentEnergyTimer++; - } - //increment the production timer - currentProductionTimer ++; - postUpdate(); - } else { //if there is no fuel Available turn off the factory - powerOff(); - } - } else if (currentProductionTimer >= getProductionTime()){ - //if the production timer has reached the recipes production time remove input from chest, and add output material - - if (mode == RepairFactoryMode.REPAIR) { - //Repairs the factory - repair(getRepairs().removeMaxFrom(getInventory(),(int)currentRepair)); - } else if (mode == RepairFactoryMode.RESET_ITEMS) { - consumeInputs(); // consumes the items needed. - - // Sets all the items to the miniumum needed repair cost. - recipeFinished(); - } - - currentProductionTimer = 0; - currentEnergyTimer = 0; - powerOff(); - } - } else { - powerOff(); - } - } - } - - @Override - public List togglePower(){ - log.info("Repair factory at " + this.factoryLocation.toString() + " power toggle attempt"); - List response=new ArrayList(); - //if the factory is turned off - if (!active) { - //if the factory isn't broken or the current recipe can repair it - if ( !isBroken() || isRepairing() ) { - //is there fuel enough for at least once energy cycle? - if ( isFuelAvailable() ) { - //are there enough materials for the current recipe in the chest? - if ( checkHasMaterials() ) { - //turn the factory on - powerOn(); - //return a success message - response.add(new InteractionResponse(InteractionResult.SUCCESS, "Factory activated!")); - return response; - } else { //there are not enough materials for the recipe! - //return a failure message, containing which materials are needed for the recipe - //[Requires the following: Amount Name, Amount Name.] - //[Requires one of the following: Amount Name, Amount Name.] - - ItemList needAll=new ItemList(); - ItemList allInputs = null; - - if (mode.equals(RepairFactoryMode.REPAIR)){ - allInputs = rfp.getRepairMaterials(); - } - else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ - allInputs = rfp.getRecipeMaterials(); - } - - needAll.addAll(allInputs.getDifference(getInventory())); - if(!needAll.isEmpty()) - { - response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); - } else if (allInputs == null || allInputs.isEmpty()) { - System.out.println("getAllInputs() returned null or empty; recipe is returning no expectation of input!"); - } - return response; - } - } else { //if there isn't enough fuel for at least one energy cycle - //return a error message - int multiplesRequired=(int)Math.ceil(getProductionTime()/(double)getEnergyTime()); - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is missing fuel! ("+getFuel().getMultiple(multiplesRequired).toString()+")")); - return response; - } - } else { - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory is in disrepair!")); - return response; - } - } else { //if the factory is on already - //turn the factory off - powerOff(); - //return success message - response.add(new InteractionResponse(InteractionResult.FAILURE, "Factory has been deactivated!")); - return response; - } - } - - @Override - public double getEnergyTime() { - return rfp.getEnergyTime(); - } - - @Override - public double getProductionTime() { - if (mode.equals(RepairFactoryMode.REPAIR)) { - return rfp.getRepairTime(); - } else { - return rfp.getProductionTime(); - } - } - - @Override - public ItemList getInputs() { - if (mode.equals(RepairFactoryMode.RESET_ITEMS)) { - return rfp.getRecipeMaterials(); - } else { - return new ItemList(); - } - } - - @Override - public ItemList getOutputs() { - return new ItemList(); - } - - @Override - public ItemList getRepairs() { - if (mode.equals( RepairFactoryMode.REPAIR)) { - return rfp.getRepairMaterials(); - } else { - return new ItemList(); - } - } - - @Override - protected void recipeFinished() { - log.finer("Recipe Finished"); - //getInputs().removeOneFrom(getInventory()); // Don't double dip! Parent consume already ate recipe costs. - org.bukkit.inventory.ItemStack[] contents = getInventory().getContents(); - for (int x = 0; x < contents.length; x++){ - org.bukkit.inventory.ItemStack stack = contents[x]; - if (stack == null) { - continue; - } - if (repairable(stack)) { - log.fine("Found repairable: " + stack.getType()); - ItemStack s = CraftItemStack.asNMSCopy(stack); - s.setRepairCost(rfp.getResetLevel()); - getInventory().setItem(x, CraftItemStack.asBukkitCopy(s)); - } else { - log.fine("Found non-repairable: " + stack.getType()); - } - } - } - - private boolean repairable(org.bukkit.inventory.ItemStack stack) { - return rfp.getAllowedRepairable().contains(stack.getType()); - } - - @Override - public int getMaxRepair() { - return rfp.getRepair(); - } - - @Override - public List getCentralBlockResponse() { - List responses=new ArrayList(); - if (!active) { - RepairFactoryMode mode = this.mode.getNext(); - this.mode = mode; - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched recipe to " + this.mode.getDescription() + ".")); - } else { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change recipes while the factory is on! Turn it off first.")); - } - return responses; - } - - @Override - public List getChestResponse(){ - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - //double time = 0; - int maxRepair = getMaxRepair(); - boolean maintenanceActive = maxRepair!=0; - String response = "Current costs are : "; // the response specific to the mode. - if (mode.equals(RepairFactoryMode.REPAIR)){ - response += getRepairs().toString(); - } else if (mode.equals(RepairFactoryMode.RESET_ITEMS)){ - response += getInputs().toString(); - } - - String percentDone=status.equals("On") ? " - "+Math.round(currentProductionTimer*100/getProductionTime())+"% done." : ""; - int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, rfp.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Current mode: " + mode.getDescription())); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, response)); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, percentDone)); - - if(!getRepairs().isEmpty()&&maintenanceActive&& mode == RepairFactoryMode.REPAIR) - { - // amountAvailable() is pretty broken, so addressing it in config for now. - int amountAvailable= getRepairs().amountAvailable(getInventory()); - int amountRepaired=amountAvailable>currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired=(int) (( (double) amountRepaired)/maxRepair*100); - log.finer(String.format("Repair mode: available %d repaired %d maxrepair %d percentRepaired %d", amountAvailable, amountRepaired, maxRepair, percentRepaired)); - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Will repair "+String.valueOf(percentRepaired)+"% of the factory with "+getRepairs().getMultiple(amountRepaired).toString()+".")); - } - - return responses; - } - - public enum RepairFactoryMode { - REPAIR(0, "Repair Factory"), - RESET_ITEMS(1, "Reset Items"); - - private static final int MAX_ID = 2; - private int id; - private String description; - - private RepairFactoryMode(int id, String description){ - this.id = id; - this.description = description; - } - - public static RepairFactoryMode byId(int id){ - for (RepairFactoryMode mode: RepairFactoryMode.values()) - if (mode.getId() == id) - return mode; - return null; - } - - public String getDescription() { - return description; - } - - public int getId() { - return id; - } - - public RepairFactoryMode getNext(){ - int nextId = (getId() + 1) % MAX_ID; - return byId(nextId); - } - } - - public RepairFactoryMode getMode(){ - return mode; - } - - public IFactoryProperties getProperties(){ - return rfp; - } -} diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 42bbd900..08a1a51c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -11,7 +11,7 @@ import com.github.igotyou.FactoryMod.utility.ItemMap; -public class CompactingRecipe extends InputOutputRecipe { +public class CompactingRecipe extends InputRecipe { private List excludedMaterials; private String compactedLore; diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 4732867c..e7ecfa0c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -9,7 +9,7 @@ import com.github.igotyou.FactoryMod.utility.ItemMap; -public class DecompactingRecipe extends InputOutputRecipe { +public class DecompactingRecipe extends InputRecipe { private String compactedLore; public DecompactingRecipe(ItemMap input, String name, int productionTime, diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java similarity index 89% rename from src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java rename to src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index e429d9b3..aba44348 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputOutputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -10,12 +10,12 @@ import com.github.igotyou.FactoryMod.utility.ItemMap; -public abstract class InputOutputRecipe implements IRecipe { +public abstract class InputRecipe implements IRecipe { protected String name; protected int productionTime; protected ItemMap input; - public InputOutputRecipe(String name, int productionTime, ItemMap input) { + public InputRecipe(String name, int productionTime, ItemMap input) { this.name = name; this.productionTime = productionTime; this.input = input; @@ -36,6 +36,10 @@ public int getProductionTime() { public ItemMap getInput() { return input; } + + public boolean enoughMaterialAvailable(Inventory i) { + return input.isContainedIn(new ItemMap(i)); + } /** * Creates a list of ItemStack for a GUI representation. This list contains diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 4280e50a..2eadf79e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -10,7 +10,7 @@ import com.github.igotyou.FactoryMod.utility.ItemMap; -public class ProductionRecipe extends InputOutputRecipe { +public class ProductionRecipe extends InputRecipe { private ItemMap output; public ProductionRecipe(String name, int productionTime, ItemMap inputs, @@ -57,10 +57,6 @@ public List getInputRepresentation(Inventory i) { return createLoredStacksForInfo(i); } - public boolean enoughMaterialAvailable(Inventory i) { - return input.isContainedIn(new ItemMap(i)); - } - public void applyEffect(Inventory i) { ItemMap toRemove = input.clone(); ItemMap toAdd = output.clone(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java new file mode 100644 index 00000000..f91bbe11 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -0,0 +1,52 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.block.BlockState; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class RepairRecipe extends InputRecipe { + private int healthPerRun; + + public RepairRecipe(String name, int productionTime, ItemMap input, + int healthPerRun) { + super(name, productionTime, input); + this.healthPerRun = healthPerRun; + } + + public List getOutputRepresentation(Inventory i) { + List result = new LinkedList(); + ItemStack furn = new ItemStack(Material.FURNACE); + ItemMeta im = furn.getItemMeta(); + List lore = new LinkedList(); + lore.add("+"+String.valueOf(healthPerRun)+" health"); + im.setLore(lore); + furn.setItemMeta(im); + result.add(furn); + return result; + } + + public List getInputRepresentation(Inventory i) { + return createLoredStacksForInfo(i); + } + + public void applyEffect(Inventory i) { + if (enoughMaterialAvailable(i)) { + for (ItemStack is : input.getItemStackRepresentation()) { + i.removeItem(is); + } + BlockState bs = (BlockState) i.getHolder(); + Factory f = FactoryModPlugin.getManager().getFactoryAt( + bs.getLocation()); + f.getRepairManager().repair(healthPerRun); + } + } +} diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java index 5650ebce..89fbc62e 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -7,7 +7,7 @@ public interface IRepairManager { public boolean atFullHealth(); - public void repair(); + public void repair(int amount); public boolean inDisrepair(); From 8c99765e79ae61d8f05956b40b732165000df232 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 03:36:37 +0100 Subject: [PATCH 171/459] Implementing power manager --- .../FurnCraftChestFactory.java | 13 ++--- .../IInteractionManager.java | 8 +++ .../powerManager/FurnacePowerManager.java | 53 +++++++++++++++++++ .../powerManager/IPowerManager.java | 6 +-- .../igotyou/FactoryMod/utility/ItemMap.java | 16 +++--- 5 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java index ba71c40c..f80f0bd5 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java @@ -7,6 +7,7 @@ import org.bukkit.block.Chest; import org.bukkit.block.Furnace; import org.bukkit.entity.Player; +import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -51,7 +52,7 @@ public Inventory getInventory() { * @return Inventory of the furnace or null if there is no furnace where one * should be */ - public Inventory getFurnaceInventory() { + public FurnaceInventory getFurnaceInventory() { if (!(getFurnace().getType() == Material.FURNACE || getFurnace() .getType() == Material.BURNING_FURNACE)) { return null; @@ -63,7 +64,7 @@ public Inventory getFurnaceInventory() { public void attemptToActivate(Player p) { // TODO Citadel stuff if (mbs.isComplete()) { - if (hasInputMaterials() && pm.fuelAvailable()) { + if (hasInputMaterials() && pm.powerAvailable()) { activate(); run(); } @@ -150,20 +151,20 @@ public void run() { if (currentProductionTimer < currentRecipe.getProductionTime()) { // if the factory power source inventory has enough fuel for // at least 1 energyCycle - if (pm.fuelAvailable()) { + if (pm.powerAvailable()) { // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed if (pm.getPowerCounter() == pm .getPowerConsumptionIntervall() - 1) { // remove one fuel. - pm.consumeFuel(); + pm.consumePower(); // 0 seconds since last fuel consumption pm.setPowerCounter(0); } // if we don't need to consume fuel, just increment the // energy timer else { - pm.incrementPowerCounter(); + pm.increasePowerCounter(updateTime); } // increment the production timer currentProductionTimer += updateTime; @@ -188,7 +189,7 @@ else if (currentProductionTimer >= currentRecipe .getProductionTime()) { applyRecipeEffect(); currentProductionTimer = 0; - if (hasInputMaterials() && pm.fuelAvailable()) { + if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); FactoryModPlugin .getPlugin() diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index 440a0389..5258dabc 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -9,5 +9,13 @@ public interface IInteractionManager { public void leftClick(Player p, Block b); public void blockBreak(Player p, Block b); + + public void failedTurnOnDisrepair(Player p); + + public void failedTurnOnPermission(Player p); + + public void successfullTurnOn(Player p); + + public void turnOff(Player p); } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java new file mode 100644 index 00000000..48d89eb4 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -0,0 +1,53 @@ +package com.github.igotyou.FactoryMod.powerManager; + +import org.bukkit.inventory.FurnaceInventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class FurnacePowerManager implements IPowerManager { + private ItemMap fuel; + private FurnCraftChestFactory fccf; + private int powerCounter; + private int fuelConsumptionIntervall; + + public FurnacePowerManager(FurnCraftChestFactory fccf, ItemMap fuel, + int fuelConsumptionIntervall) { + this.fccf = fccf; + this.fuel = fuel; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + } + + public int getPowerCounter() { + return powerCounter; + } + + public boolean powerAvailable() { + FurnaceInventory fi = fccf.getFurnaceInventory(); + ItemMap im = new ItemMap(); + im.addItemStack(fi.getFuel()); + im.addItemStack(fi.getSmelting()); + return im.contains(fuel); + } + + public int getPowerConsumptionIntervall() { + return fuelConsumptionIntervall; + } + + public void increasePowerCounter(int amount) { + powerCounter += amount; + } + + public void setPowerCounter(int amount) { + powerCounter = amount; + } + + public void consumePower() { + FurnaceInventory fi = fccf.getFurnaceInventory(); + for (ItemStack is : fuel.getItemStackRepresentation()) { + fi.removeItem(is); + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java index 6e5521de..d21f8134 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java @@ -1,15 +1,15 @@ package com.github.igotyou.FactoryMod.powerManager; public interface IPowerManager { - public void consumeFuel(); + public void consumePower(); - public boolean fuelAvailable(); + public boolean powerAvailable(); public int getPowerConsumptionIntervall(); public int getPowerCounter(); - public void incrementPowerCounter(); + public void increasePowerCounter(int amount); public void setPowerCounter(int value); diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 918dcef1..46272b61 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -68,14 +68,16 @@ public ItemMap(Collection stacks) { * ItemStack to insert */ public void addItemStack(ItemStack input) { - ItemStack is = createMapConformCopy(input); - Integer i; - if ((i = items.get(is)) != null) { - items.put(is, i + input.getAmount()); - } else { - items.put(is, input.getAmount()); + if (input != null) { + ItemStack is = createMapConformCopy(input); + Integer i; + if ((i = items.get(is)) != null) { + items.put(is, i + input.getAmount()); + } else { + items.put(is, input.getAmount()); + } + totalItems += input.getAmount(); } - totalItems += input.getAmount(); } /** From 92f7e8bcc512c664f7024f3ba2b47ffd9b455add Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 22:02:29 +0100 Subject: [PATCH 172/459] Cleaning up plugin class, starting with config parsing, implementing eggs, cleaning up listeners --- .../igotyou/FactoryMod/ConfigParser.java | 132 +++++- .../igotyou/FactoryMod/FactoryModManager.java | 30 +- .../igotyou/FactoryMod/FactoryModPlugin.java | 432 ------------------ .../FactoryMod/eggs/FurnCraftChestEgg.java | 77 ++++ .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 5 +- .../FurnCraftChestInteractionManager.java | 16 +- .../IInteractionManager.java | 3 + .../listeners/FactoryModListener.java | 80 +--- .../listeners/NetherPortalListener.java | 37 ++ .../listeners/NoteStackListener.java | 189 -------- .../listeners/RedstoneListener.java | 116 ----- .../FurnCraftChestStructure.java | 13 +- .../MultiBlockStructure.java | 30 +- .../powerManager/FurnacePowerManager.java | 9 + .../FactoryMod/recipes/CompactingRecipe.java | 44 +- .../recipes/DecompactingRecipe.java | 60 +-- .../FactoryMod/recipes/InputRecipe.java | 40 +- .../FactoryMod/recipes/ProductionRecipe.java | 16 + .../FactoryMod/recipes/RepairRecipe.java | 8 + .../PercentageHealthRepairManager.java | 29 ++ 20 files changed, 468 insertions(+), 898 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java create mode 100644 src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java delete mode 100644 src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java delete mode 100644 src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java create mode 100644 src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 42486bbb..2e50424f 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -1,27 +1,141 @@ package com.github.igotyou.FactoryMod; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.Recipe; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; +import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.google.common.collect.Lists; public class ConfigParser { private FactoryModPlugin plugin; + public ConfigParser(FactoryModPlugin plugin) { this.plugin = plugin; } - + public FactoryModManager parse() { plugin.saveDefaultConfig(); plugin.reloadConfig(); FileConfiguration config = plugin.getConfig(); - plugin.CITADEL_ENABLED = config.getBoolean("citadel_enabled", true); - plugin.FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString( - "factory_interaction_material", "STICK")); - // Check if XP drops should be disabled - plugin.DISABLE_EXPERIENCE = config.getBoolean("disable_experience", + boolean citadelEnabled = config.getBoolean("citadel_enabled", true); + Material factoryInteractionMaterial = Material.getMaterial(config + .getString("factory_interaction_material", "STICK")); + boolean disableExperience = config.getBoolean("disable_experience", false); - int updateTime = config.getInt("update_time"); - - return null; + //TODO disable experience + boolean disableNether = config.getBoolean("disable_nether"); + if (disableNether) { + plugin.getServer().getPluginManager() + .registerEvents(new NetherPortalListener(), plugin); + } + int defaultUpdateTime = config.getInt("default_update_time"); + FactoryModManager manager = new FactoryModManager(plugin, + factoryInteractionMaterial, citadelEnabled); + handleEnabledAndDisabledRecipes(config + .getConfigurationSection("crafting")); + + return manager; + } + + public void handleEnabledAndDisabledRecipes(ConfigurationSection config) { + // Disabling recipes + List toDisable = new ArrayList(); + ItemMap disabledRecipes = parseItemMap(config + .getConfigurationSection("disabled")); + for (ItemStack recipe : disabledRecipes.getItemStackRepresentation()) { + plugin.info("Attempting to disable recipes for " + + recipe.toString()); + List tempList = plugin.getServer().getRecipesFor(recipe); + for (Recipe potential : tempList) { + if (potential.getResult().isSimilar(recipe)) { + plugin.info("Found a disable recipe match " + + potential.toString()); + toDisable.add(potential); + } + } + } + Iterator it = plugin.getServer().recipeIterator(); + while (it.hasNext()) { + Recipe recipe = it.next(); + for (Recipe disable : toDisable) { + if (disable.getResult().isSimilar(recipe.getResult())) { + it.remove(); + plugin.info("Disabling recipe " + + recipe.getResult().toString()); + } + } + } + + // TODO enable shaped and unshaped recipes here + + } + + public ItemMap parseItemMap(ConfigurationSection config) { + ItemMap result = new ItemMap(); + for (String key : config.getKeys(false)) { + ConfigurationSection current = config.getConfigurationSection(key); + Material m = Material.valueOf(current.getString("material")); + ItemStack toAdd = new ItemStack(m); + int durability = current.getInt("durability", 0); + toAdd.setDurability((short) durability); + ItemMeta im = toAdd.getItemMeta(); + String name = current.getString("name"); + if (name != null) { + im.setDisplayName(name); + } + String lore = current.getString("lore"); + if (lore != null) { + List loreList = new LinkedList(); + loreList.add(lore); + im.setLore(loreList); + } + if (config.contains("enchants")) { + for (String enchantKey : current.getConfigurationSection( + "enchants").getKeys(false)) { + ConfigurationSection enchantConfig = current + .getConfigurationSection("enchants") + .getConfigurationSection(enchantKey); + Enchantment enchant = Enchantment.getByName(enchantConfig + .getString("enchant")); + int level = enchantConfig.getInt("level"); + im.addEnchant(enchant, level, true); + } + } + toAdd.setItemMeta(im); + result.addItemStack(toAdd); + } + return result; + } + + private List parsePotionEffects( + ConfigurationSection configurationSection) { + List potionEffects = Lists.newArrayList(); + if (configurationSection != null) { + for (String name : configurationSection.getKeys(false)) { + ConfigurationSection configEffect = configurationSection + .getConfigurationSection(name); + String type = configEffect.getString("type"); + PotionEffectType effect = PotionEffectType.getByName(type); + int duration = configEffect.getInt("duration", 200); + int amplifier = configEffect.getInt("amplifier", 0); + potionEffects + .add(new PotionEffect(effect, duration, amplifier)); + } + } + return potionEffects; } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 7d7fb7ca..fc4b567b 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -21,9 +21,15 @@ public class FactoryModManager { private HashMap> locations; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; + private Material factoryInteractionMaterial; + private boolean citadelEnabled; + private String compactLore; - public FactoryModManager(FactoryModPlugin plugin) { + public FactoryModManager(FactoryModPlugin plugin, + Material factoryInteractionMaterial, boolean citadelEnabled) { this.plugin = plugin; + this.factoryInteractionMaterial = factoryInteractionMaterial; + this.citadelEnabled = citadelEnabled; // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); possibleInteractionBlock.add(Material.WORKBENCH); @@ -32,6 +38,14 @@ public FactoryModManager(FactoryModPlugin plugin) { possibleInteractionBlock.add(Material.CHEST); } + public void setCompactLore(String lore) { + compactLore = lore; + } + + public String getCompactLore() { + return compactLore; + } + public void addFactory(Factory f) { for (Block b : f.getMultiBlockStructure().getAllBlocks()) { HashMap forThatMaterial = locations.get(b @@ -44,6 +58,14 @@ public void addFactory(Factory f) { } } + public boolean isCitadelEnabled() { + return citadelEnabled; + } + + public Material getFactoryInteractionMaterial() { + return factoryInteractionMaterial; + } + public void removeFactory(Factory f) { for (Block b : f.getMultiBlockStructure().getAllBlocks()) { HashMap forThatMaterial = locations.get(b @@ -80,8 +102,10 @@ public void attemptCreation(Block b, Player p) { IFactoryEgg egg = eggs.get(new ItemMap((Inventory) (fccs .getChest().getState()))); if (egg != null) { - Factory f = egg.hatch(p); - addFactory(f); + Factory f = egg.hatch(fccs,p); + if (f != null) { + addFactory(f); + } } } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 39278400..3cacc6e4 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,56 +1,8 @@ package com.github.igotyou.FactoryMod; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.inventory.meta.Repairable; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - import vg.civcraft.mc.civmodcore.ACivMod; -import com.github.igotyou.FactoryMod.listeners.CompactItemListener; -import com.github.igotyou.FactoryMod.listeners.FactoryModListener; -import com.github.igotyou.FactoryMod.listeners.NoteStackListener; -import com.github.igotyou.FactoryMod.listeners.RedstoneListener; -import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.recipes.EnchantmentOptions; -import com.github.igotyou.FactoryMod.recipes.ProbabilisticEnchantment; -import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - public class FactoryModPlugin extends ACivMod { - - /** - * The item used to interact with factoies (Default STICK) - */ - static Material FACTORY_INTERACTION_MATERIAL; - - /** - * Whether Citadel is enabled (Default true) - */ - static boolean CITADEL_ENABLED; - - /** - * Whether XP orb drops are disabled (Default false) - */ - static boolean DISABLE_EXPERIENCE; - private static FactoryModManager manager; private static FactoryModPlugin plugin; @@ -59,7 +11,6 @@ public void onEnable() { plugin = this; ConfigParser cp = new ConfigParser(this); manager = cp.parse(); - registerEvents(); } public void onDisable() { @@ -73,389 +24,6 @@ public String getPluginName() { return "FactoryMod"; } - public void registerEvents() { - try { - getServer().getPluginManager().registerEvents( - new FactoryModListener(manager), this); - getServer().getPluginManager().registerEvents( - new RedstoneListener(manager), this); - getServer().getPluginManager().registerEvents( - new NoteStackListener(this), this); - getServer().getPluginManager().registerEvents( - new CompactItemListener( - compactorProperties.getCompactLore()), this); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void initConfig() { - // is citadel enabled? - CITADEL_ENABLED = config.getBoolean("general.citadel_enabled", true); - // what's the tool that we use to interact with the factorys? - FACTORY_INTERACTION_MATERIAL = Material.getMaterial(config.getString( - "general.factory_interaction_material", "STICK")); - // Check if XP drops should be disabled - DISABLE_EXPERIENCE = config.getBoolean("general.disable_experience", - false); - // How frequently factories are updated - PRODUCER_UPDATE_CYCLE = config.getInt( - "production_general.update_cycle", 20); - // Period of days before a factory is removed after it falls into - // disrepair - DISREPAIR_PERIOD = config.getLong("general.disrepair_period", 14) * 24 - * 60 * 60 * 1000; - // The length of time it takes a factory to go to 0% health - REPAIR_PERIOD = config.getLong("production_general.repair_period", 28) - * 24 * 60 * 60 * 1000; - - // Disable the following recipes - List toDisable = new ArrayList(); - ItemList disabledRecipes = getItems(config - .getConfigurationSection("crafting.disable")); - for (AdvancedItemStack recipe : disabledRecipes) { - sendConsoleMessage("Attempting to disable recipes for " - + recipe.getCommonName()); - - List tempList = getServer().getRecipesFor(recipe); - - for (Recipe potential : tempList) { - if (potential.getResult().isSimilar(recipe)) { - sendConsoleMessage("Found a disable recipe match " - + potential.toString()); - toDisable.add(potential); - } - } - } - - Iterator it = getServer().recipeIterator(); - while (it.hasNext()) { - Recipe recipe = it.next(); - for (Recipe disable : toDisable) { // why can't they just override - // equality tests?! - if (disable.getResult().isSimilar(recipe.getResult())) { - it.remove(); - sendConsoleMessage("Disabling recipe " - + recipe.getResult().toString()); - } - } - } - - // Enable the following recipes - ConfigurationSection configCraftingEnable = config - .getConfigurationSection("crafting.enable"); - for (String recipeName : configCraftingEnable.getKeys(false)) { - ConfigurationSection configSection = configCraftingEnable - .getConfigurationSection(recipeName); - Recipe recipe; - List shape = configSection.getStringList("shape"); - - AdvancedItemStack output = getItems( - configSection.getConfigurationSection("output")).get(0); - - if (shape.isEmpty()) { - ShapelessRecipe shapelessRecipe = new ShapelessRecipe(output); - - for (ItemStack input : getItems(configSection - .getConfigurationSection("inputs"))) { - // shapelessRecipe.addIngredient(input.getAmount(), - // input.getType()); - shapelessRecipe.addIngredient(input.getAmount(), - input.getType(), input.getDurability()); - } - - recipe = shapelessRecipe; - sendConsoleMessage("Enabling shapeless recipe " + recipeName - + " - " + recipe.getResult().getType().name()); - } else { - for (String line : shape) { - sendConsoleMessage("New Shape Line: [" + line + "]"); - } - - sendConsoleMessage("output: " + output.toString()); - - ShapedRecipe shapedRecipe = new ShapedRecipe(output); - shapedRecipe.shape(shape.toArray(new String[shape.size()])); - - for (String inputKey : configSection.getConfigurationSection( - "inputs").getKeys(false)) { - ItemStack input = getItems( - configSection.getConfigurationSection("inputs." - + inputKey)).get(0); - shapedRecipe.setIngredient(inputKey.charAt(0), - input.getType()); - // shapedRecipe.setIngredient(inputKey.charAt(0),input.getType(),input.getDurability()); - } - - recipe = shapedRecipe; - sendConsoleMessage("Enabling shaped recipe " + recipeName - + " - " + recipe.getResult().getType().name()); - } - - Bukkit.addRecipe(recipe); - } - - // Import recipes from config.yml - ConfigurationSection configProdRecipes = config - .getConfigurationSection("production_recipes"); - // Temporary Storage array to store where recipes should point to each - // other - Map> outputRecipes = Maps.newHashMap(); - - for (String title : configProdRecipes.getKeys(false)) { - // Section header in recipe file, also serves as unique identifier - // for the recipe - // All spaces are replaced with udnerscores so they don't disrupt - // saving format - // There should be a check for uniqueness of this identifier... - ConfigurationSection configSection = configProdRecipes - .getConfigurationSection(title); - title = title.replaceAll(" ", "_"); - // Display name of the recipe, Deafult of "Default Name" - String recipeName = configSection.getString("name", "Default Name"); - // Production time of the recipe, default of 1 - // TODO: fix config according to default 1 - int productionTime = configSection.getInt("production_time", 2); - // Inputs of the recipe, empty of there are no inputs - ItemList inputs = getItems(configSection - .getConfigurationSection("inputs")); - // Inputs of the recipe, empty of there are no inputs - ItemList upgrades = getItems(configSection - .getConfigurationSection("upgrades")); - // Outputs of the recipe, empty of there are no inputs - ItemList outputs = getItems(configSection - .getConfigurationSection("outputs")); - // EnchantmentOptions of the recipe, all false if nothing set. - ConfigurationSection configEnchant = configSection - .getConfigurationSection("enchantment_options"); - EnchantmentOptions enchantmentOptions = null; - if (configEnchant != null) { - enchantmentOptions = new EnchantmentOptions( - configEnchant.getBoolean("safe_only", false), - configEnchant.getBoolean("ensure_one", false)); - } else { - enchantmentOptions = EnchantmentOptions.DEFAULT; - } - // Enchantments of the recipe, empty of there are no inputs - List enchantments = getEnchantments(configSection - .getConfigurationSection("enchantments")); - // Whether this recipe can only be used once - boolean useOnce = configSection.getBoolean("use_once"); - ProductionRecipe recipe = new ProductionRecipe(title, recipeName, - productionTime, inputs, upgrades, outputs, - enchantmentOptions, enchantments, useOnce, - new ItemList()); - productionRecipes.put(title, recipe); - // Store the titles of the recipes that this should point to - List currentOutputRecipes = Lists.newArrayList(); - currentOutputRecipes.addAll(configSection - .getStringList("output_recipes")); - outputRecipes.put(recipe, currentOutputRecipes); - } - - // Once ProductionRecipe objects have been created correctly insert - // different pointers - for (ProductionRecipe recipe : outputRecipes.keySet()) { - for (String output : outputRecipes.get(recipe)) { - recipe.addOutputRecipe(productionRecipes.get(output)); - } - } - - // Import factories from config.yml - ConfigurationSection configProdFactories = config - .getConfigurationSection("production_factories"); - for (String title : configProdFactories.getKeys(false)) { - ConfigurationSection configSection = configProdFactories - .getConfigurationSection(title); - title = title.replaceAll(" ", "_"); - String factoryName = configSection - .getString("name", "Default Name"); - // Uses overpowered getItems method for consistency, should always - // return a list of size=1 - // If no fuel is found, default to charcoal - ItemList fuel = getItems(configSection - .getConfigurationSection("fuel")); - if (fuel.isEmpty()) { - fuel = new ItemList(); - fuel.add(DEFAULT_FUEL); - } - // TODO: default fuel time should be 1 - int fuelTime = configSection.getInt("fuel_time", 2); - ItemList inputs = getItems(configSection - .getConfigurationSection("inputs")); - ItemList repairs = getItems(configSection - .getConfigurationSection("repair_inputs")); - - List factoryRecipes = Lists.newArrayList(); - for (String recipe : configSection.getStringList("recipes")) { - factoryRecipes.add(productionRecipes.get(recipe)); - } - - int repair = configSection.getInt("repair_multiple", 0); - // Create repair recipe - productionRecipes.put(title + "REPAIR", new ProductionRecipe(title - + "REPAIR", "Repair Factory", 1, repairs)); - factoryRecipes.add(productionRecipes.get(title + "REPAIR")); - ProductionProperties productionProperty = new ProductionProperties( - inputs, factoryRecipes, fuel, fuelTime, factoryName, repair); - productionProperties.put(title, productionProperty); - } - - ConfigurationSection configPrintingPresses = config - .getConfigurationSection("printing_presses"); - ConfigurationSection configNetherFactory = config - .getConfigurationSection("nether_factory"); - ConfigurationSection configRepairFactory = config - .getConfigurationSection("repair_factory"); - ConfigurationSection configCompactor = config - .getConfigurationSection("compactor"); - printingPressProperties = PrintingPressProperties.fromConfig(this, - configPrintingPresses); - netherFactoryProperties = NetherFactoryProperties.fromConfig(this, - configNetherFactory); - repairFactoryProperties = RepairFactoryProperties.fromConfig(this, - configRepairFactory); - compactorProperties = CompactorProperties.fromConfig(this, - configCompactor); - sendConsoleMessage("Finished initializing FactoryMod Config."); - } - - private List getEnchantments( - ConfigurationSection configEnchantments) { - List enchantments = Lists.newArrayList(); - if (configEnchantments != null) { - for (String name : configEnchantments.getKeys(false)) { - ConfigurationSection configEnchantment = configEnchantments - .getConfigurationSection(name); - String type = configEnchantment.getString("type"); - if (type != null) { - int level = configEnchantment.getInt("level", 1); - double probability = configEnchantment.getDouble( - "probability", 1.0); - ProbabilisticEnchantment enchantment = new ProbabilisticEnchantment( - name, type, level, probability); - enchantments.add(enchantment); - } - } - } - return enchantments; - } - - private List getPotionEffects( - ConfigurationSection configurationSection) { - List potionEffects = Lists.newArrayList(); - if (configurationSection != null) { - for (String name : configurationSection.getKeys(false)) { - ConfigurationSection configEffect = configurationSection - .getConfigurationSection(name); - String type = configEffect.getString("type"); - if (type != null) { - PotionEffectType effect = PotionEffectType.getByName(type); - if (effect != null) { - int duration = configEffect.getInt("duration", 200); - int amplifier = configEffect.getInt("amplifier", 0); - potionEffects.add(new PotionEffect(effect, duration, - amplifier)); - } - } - } - } - return potionEffects; - } - - public ItemList getItems(ConfigurationSection configItems) { - ItemList items = new ItemList(); - if (configItems != null) { - for (String commonName : configItems.getKeys(false)) { - - ConfigurationSection configItem = configItems - .getConfigurationSection(commonName); - String materialName = configItem.getString("material"); - Material material = Material.getMaterial(materialName); - // only proceeds if an acceptable material name was provided - if (material == null) { - getLogger().severe( - configItems.getCurrentPath() - + " requires invalid material " - + materialName); - } else { - int amount = configItem.getInt("amount", 1); - short durability = (short) configItem.getInt("durability", - 0); - int repairCost = (short) configItem - .getInt("repair_cost", 0); - String displayName = configItem.getString("display_name"); - String lore = configItem.getString("lore"); - List compulsoryEnchantments = getEnchantments(configItem - .getConfigurationSection("enchantments")); - List storedEnchantments = getEnchantments(configItem - .getConfigurationSection("stored_enchantments")); - List potionEffects = getPotionEffects(configItem - .getConfigurationSection("potion_effects")); - items.add(createItemStack(material, amount, durability, - displayName, lore, commonName, repairCost, - compulsoryEnchantments, storedEnchantments, - potionEffects)); - } - } - } - - return items; - } - - private AdvancedItemStack createItemStack(Material material, int stackSize, - short durability, String name, String loreString, - String commonName, int repairCost, - List compulsoryEnchants, - List storedEnchants, - List potionEffects) { - AdvancedItemStack namedItemStack = new AdvancedItemStack(material, - stackSize, durability, commonName); - if (name != null || loreString != null || compulsoryEnchants.size() > 0 - || storedEnchants.size() > 0 || potionEffects.size() > 0 - || repairCost > 0) { - ItemMeta meta = namedItemStack.getItemMeta(); - - if (name != null) { - meta.setDisplayName(name); - } - - if (meta instanceof Repairable && repairCost > 0) { - ((Repairable) meta).setRepairCost(repairCost); - } - - if (loreString != null) { - List lore = Lists.newArrayList(); - lore.add(loreString); - meta.setLore(lore); - } - - for (ProbabilisticEnchantment enchant : compulsoryEnchants) { - meta.addEnchant(enchant.getEnchantment(), enchant.getLevel(), - false); - } - - if (meta instanceof EnchantmentStorageMeta) { - EnchantmentStorageMeta esm = (EnchantmentStorageMeta) meta; - for (ProbabilisticEnchantment enchant : storedEnchants) { - esm.addStoredEnchant(enchant.getEnchantment(), - enchant.getLevel(), false); - } - } - - if (meta instanceof PotionMeta) { - PotionMeta pm = (PotionMeta) meta; - for (PotionEffect effect : potionEffects) { - pm.addCustomEffect(effect, true); - } - } - - namedItemStack.setItemMeta(meta); - } - - return namedItemStack; - } - public static FactoryModPlugin getPlugin() { return plugin; } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java new file mode 100644 index 00000000..bed38b9c --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -0,0 +1,77 @@ +package com.github.igotyou.FactoryMod.eggs; + +import java.util.List; + +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; +import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class FurnCraftChestEgg implements IFactoryEgg { + private String name; + private int updateTime; + protected List recipes; + private ItemMap fuel; + private int fuelConsumptionIntervall; + + public FurnCraftChestEgg(String name, int updateTime, + List recipes, ItemMap fuel, int fuelConsumptionIntervall) { + this.name = name; + this.updateTime = updateTime; + this.recipes = recipes; + this.fuel = fuel; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + } + + public Factory hatch(MultiBlockStructure mbs, Player p) { + FurnCraftChestStructure fccs = (FurnCraftChestStructure) mbs; + FurnacePowerManager fpm = new FurnacePowerManager(fuel, + fuelConsumptionIntervall); + FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); + PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( + 100); + FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, + fpm, fccs, updateTime, name); + fccim.setFactory(fccf); + fpm.setFactory(fccf); + if (recipes.size() != 0) { + fccf.setRecipe(recipes.get(0)); + } + return fccf; + } + + public String getName() { + return name; + } + + public Factory revive(List blocks, int health, String selectedRecipe) { + FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); + FurnacePowerManager fpm = new FurnacePowerManager(fuel, + fuelConsumptionIntervall); + FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); + PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( + health); + FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, + fpm, fccs, updateTime, name); + fccim.setFactory(fccf); + fpm.setFactory(fccf); + for (IRecipe recipe : recipes) { + if (recipe.getRecipeName() == selectedRecipe) { + fccf.setRecipe(recipe); + } + } + if (fccf.getCurrentRecipe() == null && recipes.size() != 0) { + fccf.setRecipe(recipes.get(0)); + } + return fccf; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index b64de24c..9dd12f18 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -3,9 +3,10 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; public interface IFactoryEgg { - public Factory hatch(Player p); - + public Factory hatch(MultiBlockStructure mbs,Player p); + public String getName(); } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 0175d98b..9c3a2773 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -14,16 +14,24 @@ import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.InputRecipe; public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private ClickableInventory ci; - private HashMap recipes = new HashMap(); + private HashMap recipes = new HashMap(); public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { this.fccf = fccf; } + public FurnCraftChestInteractionManager() { + } + + public void setFactory(FurnCraftChestFactory fccf) { + this.fccf = fccf; + } + public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); if (p != null) { @@ -42,8 +50,10 @@ public void leftClick(Player p, Block b) { if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getCraftingTable()) { // crafting table interaction ArrayList clickables = new ArrayList(); - for (IRecipe recipe : fccf.getRecipes()) { - Clickable c = new Clickable(recipe.getItemRepresentation()) { + for (IRecipe rec : fccf.getRecipes()) { + InputRecipe recipe = (InputRecipe) (rec); + Clickable c = new Clickable(recipe.getOutputRepresentation( + fccf.getInventory()).get(0)) { @Override public void clicked(Player p) { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index 5258dabc..f7bc5d0b 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -2,6 +2,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockRedstoneEvent; public interface IInteractionManager { public void rightClick(Player p, Block b); @@ -17,5 +18,7 @@ public interface IInteractionManager { public void successfullTurnOn(Player p); public void turnOff(Player p); + + public void redStoneEvent(BlockRedstoneEvent e); } diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index d0035d3a..b7122c0f 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,50 +2,35 @@ import java.util.List; -import net.minecraft.server.v1_8_R3.ItemStack; -import net.minecraft.server.v1_8_R3.PossibleFishingResult; - -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntityPortalEvent; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -import org.bukkit.inventory.AnvilInventory; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; -import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryModManager; -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.StringUtils; public class FactoryModListener implements Listener { private FactoryModManager manager; - private ReinforcementManager rm = Citadel.getReinforcementManager(); + private ReinforcementManager rm; public FactoryModListener(FactoryModManager manager) { this.manager = manager; + if (manager.isCitadelEnabled()) { + rm = Citadel.getReinforcementManager(); + } } /** @@ -56,8 +41,8 @@ public FactoryModListener(FactoryModManager manager) { public void blockBreakEvent(BlockBreakEvent e) { Block block = e.getBlock(); if (manager.isPossibleInteractionBlock(block.getType()) - && ((FactoryModPlugin.CITADEL_ENABLED && !rm - .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + && ((manager.isCitadelEnabled() && !rm.isReinforced(block)) || !manager + .isCitadelEnabled())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(e.getPlayer(), block); @@ -66,6 +51,14 @@ public void blockBreakEvent(BlockBreakEvent e) { } + @EventHandler() + public void redstoneChange(BlockRedstoneEvent e) { + Factory f = manager.getFactoryAt(e.getBlock()); + if (f != null) { + f.getInteractionManager().redStoneEvent(e); + } + } + /** * Called when a entity explodes(creeper,tnt etc.) Nearly the same as * blockBreakEvent @@ -75,8 +68,8 @@ public void explosionListener(EntityExplodeEvent e) { List blocks = e.blockList(); for (Block block : blocks) { if (manager.isPossibleInteractionBlock(block.getType()) - && ((FactoryModPlugin.CITADEL_ENABLED && !rm - .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + && ((manager.isCitadelEnabled() && !rm + .isReinforced(block)) || !manager.isCitadelEnabled())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(null, block); @@ -92,8 +85,8 @@ public void explosionListener(EntityExplodeEvent e) { public void burnListener(BlockBurnEvent e) { Block block = e.getBlock(); if (manager.isPossibleInteractionBlock(block.getType()) - && ((FactoryModPlugin.CITADEL_ENABLED && !rm - .isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED)) { + && ((manager.isCitadelEnabled() && !rm + .isReinforced(block)) || !manager.isCitadelEnabled())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(null, block); @@ -101,12 +94,11 @@ public void burnListener(BlockBurnEvent e) { } } - public void playerInteract(PlayerInteractEvent e) { Block block = e.getClickedBlock(); Player player = e.getPlayer(); if (manager.isPossibleInteractionBlock(block.getType()) - && player.getItemInHand().getType() == FactoryModPlugin.FACTORY_INTERACTION_MATERIAL) { + && player.getItemInHand().getType() == manager.getFactoryInteractionMaterial()) { Factory c = manager.getFactoryAt(block); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (c != null) { @@ -126,38 +118,6 @@ public void playerInteract(PlayerInteractEvent e) { } } - @EventHandler(priority = EventPriority.NORMAL) - public void handlePortalTelportEvent(PlayerPortalEvent e) { - if (e.isCancelled()) { - return; - } - - // Disable normal nether portal teleportation - if (e.getCause() == TeleportCause.NETHER_PORTAL - && FactoryModPlugin.DISABLE_PORTALS) { - e.setCancelled(true); - } - } - - @EventHandler(priority = EventPriority.NORMAL) - public void playerTeleportEvent(PlayerTeleportEvent e) { - if (e.isCancelled() || e.getCause() != TeleportCause.NETHER_PORTAL) { - return; - } - - // Disable normal nether portal teleportation - if (FactoryModPlugin.DISABLE_PORTALS) { - e.setCancelled(true); - } - } - - @EventHandler(priority = EventPriority.NORMAL) - public void entityTeleportEvent(EntityPortalEvent event) { - if (FactoryModPlugin.DISABLE_PORTALS) { - event.setCancelled(true); - } - } - /** * Turns slabs with the lore "Smooth double slab" into smooth double slab * blocks and logs with the lore "6-sided log" into logs with the log diff --git a/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java b/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java new file mode 100644 index 00000000..45dc6cf5 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java @@ -0,0 +1,37 @@ +package com.github.igotyou.FactoryMod.listeners; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityPortalEvent; +import org.bukkit.event.player.PlayerPortalEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; + +/** + * This will only be registered as a listener if we want to disable portals + * + */ +public class NetherPortalListener implements Listener { + @EventHandler(priority = EventPriority.NORMAL) + public void handlePortalTelportEvent(PlayerPortalEvent e) { + // Disable normal nether portal teleportation + if (e.getCause() == TeleportCause.NETHER_PORTAL) { + e.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.NORMAL) + public void playerTeleportEvent(PlayerTeleportEvent e) { + // Disable normal nether portal teleportation + if (e.getCause() == TeleportCause.NETHER_PORTAL) { + e.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.NORMAL) + public void entityTeleportEvent(EntityPortalEvent event) { + event.setCancelled(true); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java b/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java deleted file mode 100644 index 623b6c10..00000000 --- a/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.github.igotyou.FactoryMod.listeners; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -//import sun.misc.Regexp; -import com.github.igotyou.FactoryMod.FactoryModPlugin; - -public class NoteStackListener implements Listener { - - private static final Pattern stackableRegexp = Pattern.compile("^(§2.*?)( \\(x([1-9][0-9]*)\\))?$"); - private static final Pattern nameRegexp = Pattern.compile("^(.*?)( §2x([1-9][0-9]*))?$"); - private static final int SCALE_FACTOR = 4; - private static final int MAX_SCALE = 64; - - public NoteStackListener(FactoryModPlugin plugin) { - } - - @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) - public void playerInteractionEvent(PlayerInteractEvent e) - { - Block clicked = e.getClickedBlock(); - Player player = e.getPlayer(); - - ItemStack item = player.getItemInHand(); - if (item == null) return; - if (!item.getType().equals(Material.PAPER)) return; - - //if the player left clicked a block - if (e.getAction().equals(Action.LEFT_CLICK_BLOCK)) - { - if (clicked.getType().equals(Material.ENCHANTMENT_TABLE)) { - // Break notes - int multiplier = getMultiplier(player.getItemInHand()); - if (multiplier >= SCALE_FACTOR) { - int count = item.getAmount() * SCALE_FACTOR; - int newMultiplier = multiplier / SCALE_FACTOR; - player.setItemInHand(new ItemStack(Material.AIR)); - ItemStack newMultipleStack = setMultiplier(item, newMultiplier); - - while (count > 0) { - ItemStack toAdd = new ItemStack(newMultipleStack); - if (count > 64) { - toAdd.setAmount(64); - } else { - toAdd.setAmount(count); - } - // Try to add to hand first when breaking over 64 - if (count > 64 && player.getItemInHand() == null || player.getItemInHand().getType().equals(Material.AIR)) { - player.setItemInHand(toAdd); - } else { - Map overflow = player.getInventory().addItem(toAdd); - if (overflow != null && overflow.size() > 0) { - for (ItemStack spill : overflow.values()) { - player.getWorld().dropItem(player.getLocation(), spill); - } - } - } - count = count - 64; - } - - player.updateInventory(); - } - } - } else if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) { - if (clicked.getType().equals(Material.ENCHANTMENT_TABLE)) { - // Combine notes - int multiplier = getMultiplier(item); - if (multiplier > 0 && item.getAmount() >= SCALE_FACTOR) { - int count = item.getAmount() / SCALE_FACTOR; - int residual = item.getAmount() - count * SCALE_FACTOR; - int newMultiplier = multiplier * SCALE_FACTOR; - if (newMultiplier > MAX_SCALE) { - return; - } - if (residual > 0) { - ItemStack singleRemainder = new ItemStack(item); - singleRemainder.setAmount(residual); - player.setItemInHand(singleRemainder); - } else { - player.setItemInHand(new ItemStack(Material.AIR)); - } - ItemStack newMultipleStack = setMultiplier(item, newMultiplier); - - while (count > 0) { - ItemStack toAdd = new ItemStack(newMultipleStack); - if (count > 64) { - toAdd.setAmount(64); - } else { - toAdd.setAmount(count); - } - // Try to add to hand first - Map overflow = player.getInventory().addItem(toAdd); - if (overflow != null && overflow.size() > 0) { - for (ItemStack spill : overflow.values()) { - player.getWorld().dropItem(player.getLocation(), spill); - } - } - count = count - 64; - } - - e.setCancelled(true); - player.updateInventory(); - } - } - } - } - - private int getMultiplier(ItemStack item) { - List lore = item.getItemMeta().getLore(); - if (item.getType().equals(Material.PAPER)) { - if (lore != null && lore.size() > 0) { - String lastLore = lore.get(lore.size() - 1); - Matcher matcher = stackableRegexp.matcher(lastLore); - if (matcher.find()) { - String digits = matcher.group(3); - if (digits != null) { - return Integer.parseInt(digits); - } else { - return 1; - } - } - return 0; - } else { - return 0; - } - } else { - return 0; - } - } - - private ItemStack setMultiplier(ItemStack item, int multiplier) { - String name = item.getItemMeta().getDisplayName(); - List lore = item.getItemMeta().getLore(); - if (item.getType().equals(Material.PAPER)) { - if (name != null) { - Matcher matcher = nameRegexp.matcher(name); - if (matcher.find()) { - String newName; - if (multiplier == 1) { - newName = matcher.group(1); - } else { - newName = matcher.group(1) + " §2x" + Integer.toString(multiplier); - } - - ItemMeta newMeta = item.getItemMeta().clone(); - newMeta.setDisplayName(newName); - item = new ItemStack(item); - item.setItemMeta(newMeta); - } - } - - if (lore != null && lore.size() > 0) { - String lastLore = lore.get(lore.size() - 1); - Matcher matcher = stackableRegexp.matcher(lastLore); - List newLore = new ArrayList(); - if (matcher.find()) { - for (int i = 0; i < lore.size() - 1; i++) { - newLore.add(lore.get(i)); - } - if (multiplier == 1) { - newLore.add(matcher.group(1)); - } else { - newLore.add(matcher.group(1) + " (x" + Integer.toString(multiplier) + ")"); - } - - ItemMeta newMeta = item.getItemMeta().clone(); - newMeta.setLore(newLore); - item = new ItemStack(item); - item.setItemMeta(newMeta); - } - } - } - return item; - } -} diff --git a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java b/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java deleted file mode 100644 index f529bbf7..00000000 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.github.igotyou.FactoryMod.listeners; - -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockPlaceEvent; -import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.material.Attachable; - -import vg.civcraft.mc.citadel.Citadel; -import vg.civcraft.mc.citadel.ReinforcementManager; -import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.Factorys.ABaseFactory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.ProductionFactory; -import com.github.igotyou.FactoryMod.managers.FactoryManagerService; - -public class RedstoneListener implements Listener { - private FactoryManagerService factoryMan; - private ReinforcementManager rm = Citadel.getReinforcementManager(); - //this is a lazy fix... - - /** - * Constructor - */ - public RedstoneListener(FactoryManagerService manager) - { - this.factoryMan = manager; - } - - @EventHandler(ignoreCancelled = true) - public void leverPlaced(BlockPlaceEvent e) { - if (e.getBlock().getType() != Material.LEVER) { - return; - } - - Block clicked = e.getBlockAgainst(); - //is there a factory there? and if it has all its blocks - if (factoryMan.factoryExistsAt(clicked.getLocation())&&factoryMan.factoryWholeAt(clicked.getLocation())) - { - //if the player is allowed to interact with that block? - if ((!FactoryModPlugin.CITADEL_ENABLED || FactoryModPlugin.CITADEL_ENABLED && !rm.isReinforced(clicked)) || - (((PlayerReinforcement) rm.getReinforcement(clicked)).isAccessible(e.getPlayer()))) - { - // Allowed - } - //if the player is NOT allowed to interact with the clicked block - else - { - e.setCancelled(true); - } - } - } - - - /** - * Called when a block is charged. - * When the furnace block is powered, starts the factory and toggles on any attached levers. - * On completion, toggles off any attached levers. - */ - @EventHandler() - public void redstoneChange(BlockRedstoneEvent e) - { - // Only trigger on transition from 0 to positive - if (e.getOldCurrent() > 0 || e.getNewCurrent() == 0) { - return; - } - - // Allow this to be disabled with config - if (!FactoryModPlugin.REDSTONE_START_ENABLED) { - return; - } - - Block rsBlock = e.getBlock(); - BlockFace[] directions = null; - if (rsBlock.getType() == Material.REDSTONE_WIRE) { - directions = ProductionFactory.REDSTONE_FACES; - } else if (rsBlock.getType() == Material.WOOD_BUTTON) { - directions = new BlockFace[] {((Attachable) rsBlock.getState().getData()).getAttachedFace()}; - } else if (rsBlock.getType() == Material.STONE_BUTTON) { - directions = new BlockFace[] {((Attachable) rsBlock.getState().getData()).getAttachedFace()}; - } else if (rsBlock.getType() == Material.LEVER) { - directions = new BlockFace[] {((Attachable) rsBlock.getState().getData()).getAttachedFace()}; - } else { - return; // Don't care - } - - - for (BlockFace direction : directions) { - Block block = rsBlock.getRelative(direction); - - //Is the block part of a factory? - if(block.getType() == Material.FURNACE || block.getType() == Material.BURNING_FURNACE) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - ABaseFactory factory = (ABaseFactory) factoryMan.getFactory(block.getLocation()); - - Block lever = factory.findActivationLever(); - if (lever == null) { - // No lever - don't respond to redstone - return; - } - - if (!factory.getActive()) { - // Try to start the factory - factory.togglePower(); - } - } - } - } - } -} diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java index 76626412..8485bd58 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -3,6 +3,7 @@ import java.util.LinkedList; import java.util.List; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -16,6 +17,12 @@ public FurnCraftChestStructure(Block center) { initializeBlocks(center); } + public FurnCraftChestStructure(List blocks) { + CraftingTable = blocks.get(0); + Furnace = blocks.get(1); + Chest = blocks.get(2); + } + public boolean isComplete() { return CraftingTable.getType() == Material.WORKBENCH && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) @@ -67,10 +74,14 @@ public Block getChest() { public List getAllBlocks() { LinkedList result = new LinkedList(); + result.add(CraftingTable); result.add(Furnace); result.add(Chest); - result.add(CraftingTable); return result; } + public Location getCenter() { + return Chest.getLocation(); + } + } diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java index e7462c62..8384f79e 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -3,14 +3,15 @@ import java.util.LinkedList; import java.util.List; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; public abstract class MultiBlockStructure { - protected static LinkedList allBlockSides; - protected static LinkedList northEastWestSouthSides; - + protected static LinkedList allBlockSides; + protected static LinkedList northEastWestSouthSides; + public static void initiliazeBlockSides() { northEastWestSouthSides = new LinkedList(); northEastWestSouthSides.add(BlockFace.EAST); @@ -20,12 +21,12 @@ public static void initiliazeBlockSides() { allBlockSides = new LinkedList(northEastWestSouthSides); allBlockSides.add(BlockFace.DOWN); allBlockSides.add(BlockFace.UP); - + } - - protected static List searchForBlockOnSides(Block b, Material m) { - LinkedList result = new LinkedList(); - for(BlockFace face:northEastWestSouthSides) { + + protected static List searchForBlockOnSides(Block b, Material m) { + LinkedList result = new LinkedList(); + for (BlockFace face : northEastWestSouthSides) { Block side = b.getRelative(face); if (side.getType() == m) { result.add(side); @@ -33,12 +34,13 @@ protected static List searchForBlockOnSides(Block b, Material m) { } return result; } - + public abstract boolean isComplete(); - - public abstract void initializeBlocks(Block start); - - public abstract List getAllBlocks(); - + public abstract void initializeBlocks(Block start); + + public abstract List getAllBlocks(); + + public abstract Location getCenter(); + } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index 48d89eb4..0dfa8b85 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -18,6 +18,15 @@ public FurnacePowerManager(FurnCraftChestFactory fccf, ItemMap fuel, this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; } + + public FurnacePowerManager(ItemMap fuel,int fuelConsumptionIntervall) { + this.fuel = fuel; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + } + + public void setFactory(FurnCraftChestFactory fccf) { + this.fccf = fccf; + } public int getPowerCounter() { return powerCounter; diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 08a1a51c..d9f571b5 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -3,7 +3,6 @@ import java.util.LinkedList; import java.util.List; -import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -17,7 +16,7 @@ public class CompactingRecipe extends InputRecipe { public CompactingRecipe(ItemMap input, List excludedMaterial, String name, int productionTime, String compactedLore) { - super(name,productionTime,input); + super(name, productionTime, input); this.excludedMaterials = excludedMaterial; this.compactedLore = compactedLore; } @@ -65,16 +64,13 @@ public void applyEffect(Inventory i) { public List getInputRepresentation(Inventory i) { List result = new LinkedList(); - ItemMap inventoryMap = new ItemMap(i); - if (input.isContainedIn(inventoryMap)) { - result = createLoredStacksForInfo(i); - for (ItemStack is : i.getContents()) { - if (is != null) { - if (compactable(is)) { - ItemStack compactedStack = is.clone(); - result.add(compactedStack); - break; - } + result = createLoredStacksForInfo(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + ItemStack compactedStack = is.clone(); + result.add(compactedStack); + break; } } } @@ -83,15 +79,13 @@ public List getInputRepresentation(Inventory i) { public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); - if (input.isContainedIn(new ItemMap(i))) { - for (ItemStack is : i.getContents()) { - if (is != null) { - if (compactable(is)) { - ItemStack decompactedStack = is.clone(); - compact(decompactedStack); - result.add(decompactedStack); - break; - } + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is)) { + ItemStack decompactedStack = is.clone(); + compact(decompactedStack); + result.add(decompactedStack); + break; } } } @@ -99,6 +93,14 @@ public List getOutputRepresentation(Inventory i) { return result; } + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.CHEST); + ItemMeta im = res.getItemMeta(); + im.setDisplayName(getRecipeName()); + res.setItemMeta(im); + return res; + } + /** * Changes the lore of the given ItemStack to the compacted lore and sets * it's amount to 1 diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index e7ecfa0c..bc451d59 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -3,6 +3,7 @@ import java.util.LinkedList; import java.util.List; +import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -14,7 +15,7 @@ public class DecompactingRecipe extends InputRecipe { public DecompactingRecipe(ItemMap input, String name, int productionTime, String compactedLore) { - super(name,productionTime,input); + super(name, productionTime, input); this.compactedLore = compactedLore; } @@ -75,44 +76,45 @@ public void applyEffect(Inventory i) { public List getInputRepresentation(Inventory i) { List result = new LinkedList(); - ItemMap inventoryMap = new ItemMap(i); - if (input.isContainedIn(inventoryMap)) { - result = createLoredStacksForInfo(i); - for (ItemStack is : i.getContents()) { - if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() - && im.getLore().get(0).equals(compactedLore)) { - ItemStack compactedStack = is.clone(); - result.add(compactedStack); - break; - } + result = createLoredStacksForInfo(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { + ItemStack compactedStack = is.clone(); + result.add(compactedStack); + break; } } } return result; } + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.CHEST); + ItemMeta im = res.getItemMeta(); + im.setDisplayName(getRecipeName()); + res.setItemMeta(im); + return res; + } + public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); - if (input.isContainedIn(new ItemMap(i))) { - for (ItemStack is : i.getContents()) { - if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() - && im.getLore().get(0).equals(compactedLore)) { - ItemStack decompactedStack = is.clone(); - decompactedStack.setAmount(decompactedStack.getMaxStackSize()); - List loreList = new LinkedList(); - im.setLore(loreList); - decompactedStack.setItemMeta(im); - result.add(decompactedStack); - break; - } + for (ItemStack is : i.getContents()) { + if (is != null) { + ItemMeta im = is.getItemMeta(); + if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { + ItemStack decompactedStack = is.clone(); + decompactedStack.setAmount(decompactedStack + .getMaxStackSize()); + List loreList = new LinkedList(); + im.setLore(loreList); + decompactedStack.setItemMeta(im); + result.add(decompactedStack); + break; } } } - - return result; + return result; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index aba44348..7e29a2a9 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -36,10 +36,12 @@ public int getProductionTime() { public ItemMap getInput() { return input; } - + public boolean enoughMaterialAvailable(Inventory i) { return input.isContainedIn(new ItemMap(i)); } + + public abstract ItemStack getRecipeRepresentation(); /** * Creates a list of ItemStack for a GUI representation. This list contains @@ -47,29 +49,29 @@ public boolean enoughMaterialAvailable(Inventory i) { * map and adds to each of the stacks how many runs could be made with the * material available in the chest * - * @param i Inventory to calculate the possible runs for - * @return ItemStacks containing the additional information, ready for the GUI + * @param i + * Inventory to calculate the possible runs for + * @return ItemStacks containing the additional information, ready for the + * GUI */ protected List createLoredStacksForInfo(Inventory i) { LinkedList result = new LinkedList(); ItemMap inventoryMap = new ItemMap(i); - if (input.isContainedIn(inventoryMap)) { - for (ItemStack is : input.getItemStackRepresentation()) { - int possibleRuns = new ItemMap(is) - .getMultiplesContainedIn(inventoryMap); - ItemMeta im = is.getItemMeta(); - List lore; - if (im.hasLore()) { - lore = im.getLore(); - } else { - lore = new LinkedList(); - } - lore.add(ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns) + " runs"); - im.setLore(lore); - is.setItemMeta(im); - result.add(is); + for (ItemStack is : input.getItemStackRepresentation()) { + int possibleRuns = new ItemMap(is) + .getMultiplesContainedIn(inventoryMap); + ItemMeta im = is.getItemMeta(); + List lore; + if (im.hasLore()) { + lore = im.getLore(); + } else { + lore = new LinkedList(); } + lore.add(ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns) + " runs"); + im.setLore(lore); + is.setItemMeta(im); + result.add(is); } return result; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 2eadf79e..cd83048e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -4,6 +4,7 @@ import java.util.List; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -68,4 +69,19 @@ public void applyEffect(Inventory i) { i.addItem(is); } } + + public ItemStack getRecipeRepresentation() { + List out = output.getItemStackRepresentation(); + ItemStack res; + if (out.size() == 0) { + res = new ItemStack(Material.STONE); + } + else { + res = out.get(0); + } + ItemMeta im = res.getItemMeta(); + im.setDisplayName(getRecipeName()); + res.setItemMeta(im); + return res; + } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index f91bbe11..8b4dff5e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -49,4 +49,12 @@ public void applyEffect(Inventory i) { f.getRepairManager().repair(healthPerRun); } } + + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.FURNACE); + ItemMeta im = res.getItemMeta(); + im.setDisplayName(getRecipeName()); + res.setItemMeta(im); + return res; + } } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java new file mode 100644 index 00000000..f35fe09e --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -0,0 +1,29 @@ +package com.github.igotyou.FactoryMod.repairManager; + +public class PercentageHealthRepairManager implements IRepairManager { + private int health; + + public PercentageHealthRepairManager(int initialHealth) { + health = initialHealth; + } + + public boolean atFullHealth() { + return health >= 100; + } + + public boolean inDisrepair() { + return health <= 0; + } + + public String getHealth() { + return String.valueOf(health) + " %"; + } + + public void repair(int amount) { + health = Math.min(health + amount, 100); + } + + public void breakIt() { + health = 0; + } +} From d972f0d01319f456d935d0e53c47dcea2a3ebde0 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 23:07:31 +0100 Subject: [PATCH 173/459] Removing printing press for now --- .../classicTriblockFactory/PrintingPress.java | 856 ------------------ .../properties/PrintingPressProperties.java | 178 ---- 2 files changed, 1034 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java delete mode 100644 src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java b/src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java deleted file mode 100644 index 2766a69e..00000000 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/PrintingPress.java +++ /dev/null @@ -1,856 +0,0 @@ -package com.github.igotyou.FactoryMod.classicTriblockFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.BookMeta; -import org.bukkit.inventory.meta.ItemMeta; - -import com.github.igotyou.FactoryMod.properties.PrintingPressProperties; -import com.github.igotyou.FactoryMod.utility.InteractionResponse; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; -import com.github.igotyou.FactoryMod.utility.StringUtils; - -public class PrintingPress extends ABaseFactory { - - private PrintingPressProperties printingPressProperties; - - private static Logger log = Logger.getLogger(PrintingPress.class.getName()); - - public PrintingPressProperties getProperties() { - return printingPressProperties; - } - - private OperationMode mode; - - public OperationMode getMode() { - return mode; - } - - private int containedPaper; - private int containedBindings; - private int containedSecurityMaterials; - private int[] processQueue; - private int processQueueOffset; - private int lockedResultCode; - - public PrintingPress(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, PrintingPressProperties printingPressProperties) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, active, - FactoryType.PRINTING_PRESS, "press"); - this.mode = OperationMode.REPAIR; - this.printingPressProperties = printingPressProperties; - this.containedPaper = 0; - this.containedBindings = 0; - this.containedSecurityMaterials = 0; - this.processQueue = new int[1]; - this.processQueueOffset = 0; - this.lockedResultCode = 0; - } - - public PrintingPress(Location factoryLocation, - Location factoryInventoryLocation, Location factoryPowerSource, - boolean active, - int currentProductionTimer, int currentEnergyTimer, - double currentMaintenance, long timeDisrepair, OperationMode mode, - PrintingPressProperties printingPressProperties, - int containedPaper, int containedBindings, int containedSecurityMaterials, - int[] processQueue, int lockedResultCode) { - super(factoryLocation, factoryInventoryLocation, factoryPowerSource, - FactoryType.PRINTING_PRESS, active, "Printing Press", currentProductionTimer, - currentEnergyTimer, currentMaintenance, timeDisrepair); - this.mode = mode; - this.active = active; - this.printingPressProperties = printingPressProperties; - this.containedPaper = containedPaper; - this.containedBindings = containedBindings; - this.containedSecurityMaterials = containedSecurityMaterials; - this.processQueue = processQueue; - this.processQueueOffset = 0; - this.lockedResultCode = lockedResultCode; - } - - public int getLockedResultCode() { - return lockedResultCode; - } - - @Override - public ItemList getFuel() { - return printingPressProperties.getFuel(); - } - - public int getContainedPaper() { - return containedPaper; - } - - public int getContainedBindings() { - return containedBindings; - } - - public int getContainedSecurityMaterials() { - return containedSecurityMaterials; - } - - @Override - public double getEnergyTime() { - return printingPressProperties.getEnergyTime(); - } - - @Override - public double getProductionTime() { - switch(mode) { - case SET_PLATES: - AdvancedItemStack plates = getPlateResult(); - int pageCount = 1; - if (plates != null) { - pageCount = Math.max(1, ((BookMeta) plates.getItemMeta()).getPageCount()); - } else { - log.finer("getProductionTime(): plates == null"); - } - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - return printingPressProperties.getSetPlateTime() * pageCount; - case REPAIR: - return printingPressProperties.getRepairTime(); - default: - // Continuous recipes -> 1 year limit at 1 update per second - return 3600 * 24 * 365; - } - } - - @Override - public ItemList getInputs() { - ItemList inputs = new ItemList(); - switch(mode) { - case SET_PLATES: - AdvancedItemStack plates = getPlateResult(); - if (plates != null) { - int pageCount = ((BookMeta) plates.getItemMeta()).getPageCount(); - if (pageCount > 0) { - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); - } - } else { - log.finer("getInputs(): plates == null"); - } - break; - default: - break; - } - return inputs; - } - - @Override - public ItemList getOutputs() { - ItemList outputs = new ItemList(); - switch(mode) { - case SET_PLATES: - AdvancedItemStack plates = getPlateResult(); - if (plates != null) { - outputs.add(plates); - } else { - log.finer("getOutputs(): Plates results are null!"); - } - break; - default: - break; - } - return outputs; - } - - @Override - public ItemList getRepairs() { - ItemList inputs = new ItemList(); - switch(mode) { - case REPAIR: - inputs.addAll(printingPressProperties.getRepairMaterials()); - break; - default: - break; - } - return inputs; - } - - @Override - public int getMaxRepair() { - return printingPressProperties.getMaxRepair(); - } - - @Override - public void powerOn() { - super.powerOn(); - this.containedPaper = 0; - this.containedBindings = 0; - this.containedSecurityMaterials = 0; - int outputDelay = printingPressProperties.getPageLead(); - this.processQueue = new int[outputDelay]; - this.processQueueOffset = 0; - - if (mode == OperationMode.PRINT_BOOKS || - mode == OperationMode.PRINT_PAMPHLETS || - mode == OperationMode.PRINT_SECURITY) { - // Require product - if (!getPrintResult().isValid()) { - powerOff(); - } else { - this.lockedResultCode = getPrintResult().hashCode(); - } - } - } - - @Override - public void fuelConsumed() { - // Check for sneaky plate swaps, shut down - if (mode == OperationMode.PRINT_BOOKS || - mode == OperationMode.PRINT_PAMPHLETS || - mode == OperationMode.PRINT_SECURITY) { - // Require product - int expectedResultCode = getPrintResult().hashCode(); - if (this.lockedResultCode != expectedResultCode) { - powerOff(); - return; - } - } - - switch(mode) { - case PRINT_BOOKS: - printBooksUpdate(); - break; - case PRINT_PAMPHLETS: - printPamphletsUpdate(); - break; - case PRINT_SECURITY: - printSecurityUpdate(); - break; - default: - break; - } - } - - public void printBooksUpdate() { - // Output finished results - - PrintResult printResult = getPrintResult(); - - int finished = processQueue[processQueueOffset]; - if (finished > 0) { - AdvancedItemStack result = printResult.toBook(); - ItemList set = new ItemList(); - set.add(result); - set = set.getMultiple(finished); - set.putIn(getInventory()); - } - - // Load materials - ItemList pages = printingPressProperties.getPageMaterials(); - boolean hasPages = pages.allIn(getInventory()); - boolean inputStall = false; - - int pageCount = printResult.pageCount(); - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - - if (hasPages) { - // Check bindings - int expectedBindings = pageCount == 0 ? containedPaper + printingPressProperties.getPagesPerLot() : (int) Math.floor((double) (containedPaper + printingPressProperties.getPagesPerLot()) / (double) pageCount); - boolean hasBindings = true; - ItemList allBindings = new ItemList(); - if (expectedBindings > containedBindings) { - int neededBindings = expectedBindings - containedBindings; - allBindings = printingPressProperties.getBindingMaterials().getMultiple(neededBindings); - hasBindings = allBindings.allIn(getInventory()); - } - - if (hasBindings) { - pages.removeFrom(getInventory()); - containedPaper += printingPressProperties.getPagesPerLot(); - - while (containedBindings < expectedBindings) { - if (printingPressProperties.getBindingMaterials().allIn(getInventory())) { - printingPressProperties.getBindingMaterials().removeFrom(getInventory()); - containedBindings += 1; - } - } - } else { - inputStall = true; - } - } else { - inputStall = true; - } - - // Put materials in queue - int booksInPages = pageCount == 0 ? containedPaper : containedPaper / pageCount; - int copiesIn = Math.min(booksInPages, containedBindings); - containedPaper -= copiesIn * pageCount; - containedBindings -= copiesIn; - processQueue[processQueueOffset] = copiesIn; - - if (inputStall) { - stopIfEmpty(); - } - - // Rotate on queue - processQueueOffset += 1; - if (processQueueOffset >= processQueue.length) { - processQueueOffset = 0; - } - } - - private void stopIfEmpty() {// Check if queue is empty - boolean queueEmpty = true; - for (int amount : processQueue) { - if (amount > 0) { - queueEmpty = false; - break; - } - } - if (queueEmpty) { - // Stalled and empty - powerOff(); - } - } - - public void printPamphletsUpdate() { - // Output finished results - int finished = processQueue[processQueueOffset]; - if (finished > 0) { - AdvancedItemStack result = getPrintResult().toPamphlet(); - ItemList set = new ItemList(); - set.add(result); - set = set.getMultiple(finished); - set.putIn(getInventory()); - } - - // Load materials - ItemList pages = printingPressProperties.getPamphletMaterials(); - boolean hasPages = pages.allIn(getInventory()); - if (hasPages) { - pages.removeFrom(getInventory()); - processQueue[processQueueOffset] = printingPressProperties.getPamphletsPerLot(); - } else { - processQueue[processQueueOffset] = 0; - stopIfEmpty(); - } - - // Rotate on queue - processQueueOffset += 1; - if (processQueueOffset >= processQueue.length) { - processQueueOffset = 0; - } - } - - public void printSecurityUpdate() { - // Output finished results - int finished = processQueue[processQueueOffset]; - if (finished > 0) { - AdvancedItemStack result = getPrintResult().toSecurityNote(); - ItemList set = new ItemList(); - set.add(result); - set = set.getMultiple(finished); - set.putIn(getInventory()); - } - - // Load materials - ItemList pages = printingPressProperties.getPamphletMaterials(); - boolean hasPages = pages.allIn(getInventory()); - boolean inputStall = false; - if (hasPages) { - // Check security materials - int expectedExtras = (int) Math.ceil((double) containedPaper + printingPressProperties.getPamphletsPerLot()); - boolean hasExtras = true; - ItemList allSecurityMaterials = new ItemList(); - if (expectedExtras > containedSecurityMaterials) { - int neededExtras = expectedExtras - containedSecurityMaterials; - int neededExtraLots = (int) Math.ceil((double) neededExtras / (double) printingPressProperties.getSecurityNotesPerLot()); - allSecurityMaterials = printingPressProperties.getSecurityMaterials().getMultiple(neededExtraLots); - hasExtras = allSecurityMaterials.allIn(getInventory()); - } - - if (hasExtras) { - pages.removeFrom(getInventory()); - containedPaper += printingPressProperties.getPamphletsPerLot(); - - // Load security materials if security notes - while (containedSecurityMaterials < containedPaper) { - if (printingPressProperties.getSecurityMaterials().allIn(getInventory())) { - printingPressProperties.getSecurityMaterials().removeFrom(getInventory()); - containedSecurityMaterials += printingPressProperties.getSecurityNotesPerLot(); - } - } - } else { - inputStall = true; - } - } else { - inputStall = true; - } - - // Put materials in queue - int copiesIn = containedPaper; - containedPaper -= copiesIn; - containedSecurityMaterials -= copiesIn; - processQueue[processQueueOffset] = copiesIn; - - if (inputStall) { - stopIfEmpty(); - } - - // Rotate on queue - processQueueOffset += 1; - if (processQueueOffset >= processQueue.length) { - processQueueOffset = 0; - } - } - - public int[] getProcessQueue() { - // Rotate so that current place in ring buffer is 0 - int[] newQ = new int[processQueue.length]; - int toEnd = processQueue.length - processQueueOffset; - System.arraycopy(processQueue, processQueueOffset, newQ, 0, toEnd); - if (processQueueOffset > 0) { - System.arraycopy(processQueue, 0, newQ, toEnd, processQueueOffset); - } - return newQ; - } - - public boolean isRepairing() { - return mode == OperationMode.REPAIR; - } - - /** - * Returns either a success or error message. - * Called by the blockListener when a player left clicks the center block, with the InteractionMaterial - */ - public List getCentralBlockResponse() - { - List responses=new ArrayList(); - //Is the factory off - if (!active) - { - //is the recipe is initiated - if (mode == null) { - mode = OperationMode.REPAIR; - } else { - mode = mode.getNext(); - } - - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "-----------------------------------------------------")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Switched mode to: " + mode.getDescription()+".")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Next mode is: "+mode.getNext().getDescription()+".")); - } - //if the factory is on, return error message - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "You can't change modes while the press is on! Turn it off first.")); - } - return responses; - } - - /** - * On interaction with the factory chest, return context-appropriate information - * concerning the current mode, relative to the inputs and outputs. - * - * Adding detailed state on the active recipe now, if factory is on. - * - * @return A {@link List} of {@link InteractionResponse} objects containing - * details on the current mode. - */ - public List getChestResponse() - { - List responses=new ArrayList(); - String status=active ? "On" : "Off"; - //Name: Status with XX% health. - int maxRepair = printingPressProperties.getMaxRepair(); - boolean maintenanceActive = maxRepair!=0; - int health =(!maintenanceActive) ? 100 : (int) Math.round(100*(1-currentRepair/(maxRepair))); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, printingPressProperties.getName()+": "+status+" with "+String.valueOf(health)+"% health.")); - //RecipeName: X seconds(Y ticks)[ - XX% done.] - responses.add(new InteractionResponse(InteractionResult.SUCCESS, mode.getDescription())); - - // Never call the same function more than once, especially when this complex. - ItemList getInputs = getInputs(); - //[Inputs: amount Name, amount Name.] - if(getInputs != null && !getInputs.isEmpty()) { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs.toString()+".")); - } else { - log.fine("getChestResponse(): Inputs is null or empty!"); - } - - //[Outputs: amount Name, amount Name.] - ItemList getOutputs = getOutputs(); - if(getOutputs != null && !getOutputs.isEmpty()) { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Output: "+getOutputs.toString()+".")); - } else { - log.fine("getChestResponse(): Outputs is null or empty!"); - } - - //[Will repair XX% of the factory] - ItemList getRepairs = getRepairs(); - if(getRepairs != null && !getRepairs.isEmpty() && maintenanceActive) { - int amountAvailable = getRepairs.amountAvailable(getInventory()); - int amountRepaired = amountAvailable > currentRepair ? (int) Math.ceil(currentRepair) : amountAvailable; - int percentRepaired = (int) (( (double) amountRepaired) / printingPressProperties.getMaxRepair() * 100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Will repair " + - String.valueOf(percentRepaired) + "% of the factory with " + - getRepairs.getMultiple(amountRepaired).toString() + ".")); - } - - - //[% done if plates; queue status else] - if (active && mode != OperationMode.REPAIR) { - int readyCopies = 0; - StringBuffer queueContents = new StringBuffer(); - if (mode == OperationMode.PRINT_BOOKS || - mode == OperationMode.PRINT_PAMPHLETS || - mode == OperationMode.PRINT_SECURITY) { - queueContents.append("Queue Contents: ["); - for (int i = 0; i < processQueue.length; i++) { - readyCopies += processQueue[i]; - if (i > 0) { - queueContents.append(","); - } - if (i == processQueueOffset) { - queueContents.append("{"); - } - queueContents.append(processQueue[i]); - if (i == processQueueOffset) { - queueContents.append("}"); - } - } - queueContents.append("]"); - } - switch(mode) { - case PRINT_BOOKS: - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Books with " + - String.valueOf(readyCopies) + " in the queue.")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); - break; - case PRINT_PAMPHLETS: - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Pamphlets with " + - String.valueOf(readyCopies) + " in the queue.")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); - break; - case PRINT_SECURITY: - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Printing Security Notes with " + - String.valueOf(readyCopies) + " in the queue.")); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, queueContents.toString())); - break; - case SET_PLATES: - int setTime = printingPressProperties.getSetPlateTime() * getBookInventoryPages(); - int percentComplete = (int) (( (double) currentProductionTimer) / setTime * 100); - responses.add(new InteractionResponse(InteractionResult.SUCCESS, "Set Plates is " + - String.valueOf(percentComplete) + "% complete")); - break; - default: - log.severe("getChestResponse(): Active set, but unknown mode: critical error."); - break; - } - } - - return responses; - } - - /** - * Generates a new PrintResult object based on the current production state of the factory, - * reflecting the active mode's output. This does not include plates, which are handled - * separately. - * - * @return {@link PrintResult} object reflecting the current state production state of the - * factory. - */ - private PrintResult getPrintResult() { - return new PrintResult(); - } - - /** - * Lightweight page count function, for active recipes only. Useful for measuring current - * progress in a recipe, for instance. - */ - private int getBookInventoryPages() { - for (ItemStack stack : getInventory().getContents()) { - if (stack == null) { - continue; - } - if (stack.getType().equals(Material.BOOK_AND_QUILL) || - stack.getType().equals(Material.WRITTEN_BOOK)) { - log.finer("getPlateResult(): Found a book in the factory."); - ItemMeta meta = stack.getItemMeta(); - if (meta instanceof BookMeta) { - BookMeta bookData = (BookMeta) meta; - if (bookData.hasPages()) { - return Math.max(1, bookData.getPageCount()); - } - } - } - } - return 0; - } - - /** - * Generates a NamedItemStack containing a 'plate' -- a signed book with lore that - * uniquely reflects the book given as input. This plate can then be used to produce - * copies of the book, security notes, pamphlets, and the like. - * - * @return {@link AdvancedItemStack} of a Signed Book with lore containing the contents of - * the given input book, and other important metadata. - */ - private AdvancedItemStack getPlateResult() { - for (ItemStack stack : getInventory().getContents()) { - if (stack == null) { - continue; - } - if (stack.getType().equals(Material.BOOK_AND_QUILL) || - stack.getType().equals(Material.WRITTEN_BOOK)) { - log.finer("getPlateResult(): Found a book in the factory to use as plate source."); - ItemMeta meta = stack.getItemMeta(); - if (meta instanceof BookMeta) { - log.finer("getPlateResult(): Book found has Metadata associated."); - // Found a book - BookMeta bookData = (BookMeta) meta; - String title = bookData.hasTitle() ? bookData.getTitle() : ""; - String author = bookData.hasAuthor() ? bookData.getAuthor() : ""; - if (author == null) { - author = ""; - } - if (title == null) { - title = ""; - } - List pages = new ArrayList(); - if (bookData.hasPages()) { - pages.addAll(bookData.getPages()); - } else { - pages.add(""); - log.finer("getPlateResult(): Book found has no pages; adding blank."); - } - - AdvancedItemStack plates = new AdvancedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "plate"); - BookMeta plateMeta = (BookMeta) plates.getItemMeta(); - plateMeta.setTitle(title); - plateMeta.setAuthor(author); - plateMeta.setPages(pages); - int watermark = new Random().nextInt(9000) + 1000; - List lore = new ArrayList(); - lore.add("Print plates #" + Integer.toString(watermark)); - plateMeta.setLore(lore); - plates.setItemMeta(plateMeta); - return plates; - } else { - log.warning("getPlateResult(): Book found, but no associated metadata."); - } - } - } - log.warning("getPlateResult(): No book found for plate source."); - return null; - } - - private class PrintResult { - private static final int PAGE_LORE_LENGTH_LIMIT = 140; - private static final int PAGE_LORE_LINE_LIMIT = 35; - private List pages; - private String title; - private String author; - private int watermark; - private boolean valid; - - /** - * Initializes a PrintResult leveraging the contents and state of the - * {@link PrintingPress}. Attempts to find a valid Print plate in the factory, then - * extracts the information from the Plate necessary to produce books, - * pamphlets, or security notes. - */ - PrintResult() { - Pattern printPlateRE = Pattern.compile("^Print plates #([0-9]{4})$"); - Inventory inventory = getInventory(); - - title = ""; - author = ""; - watermark = 0; - valid = false; - pages = new ArrayList(); - - for (ItemStack stack : inventory.getContents()) { - if (stack == null) { - continue; - } - - if (stack.getType().equals(Material.BOOK_AND_QUILL) || - stack.getType().equals(Material.WRITTEN_BOOK)) { - log.finer("PrintResult(): Found a book item."); - ItemMeta meta = stack.getItemMeta(); - List lore = meta.getLore(); - if (lore != null && !lore.isEmpty()) { - log.finer("PrintResult(): Found a lore item attached to the book."); - String firstLore = lore.get(0); - Matcher match = printPlateRE.matcher(firstLore); - if (match.matches()) { - log.finer("PrintResult(): Lore matches a print plate."); - if (meta instanceof BookMeta) { - log.finer("PrintResult(): Book has Associated Book Meta."); - BookMeta bookData = (BookMeta) meta; - if (bookData.hasTitle()) - title = bookData.getTitle(); - if (title == null) - title = ""; - - if (bookData.hasAuthor()) - author = bookData.getAuthor(); - if (author == null) { - author = ""; - } - watermark = Integer.parseInt(match.group(1)); - if (bookData.hasPages()) - pages = new ArrayList(bookData.getPages()); - else { - pages = new ArrayList(0); - pages.add(""); // Blank page. - } - valid = true; - break; - } else { - log.fine("PrintResult(): No Book Meta found!"); - } - } else { - log.fine("PrintResult(): Lore indicates the book is not a print plate."); - } - } else { - log.fine("PrintResult(): No lore item found with the book."); - } - } - } - - if (!valid) { - log.fine("PrintResult(): No valid plate found in the factory."); - } - } - - public boolean isValid() { - return valid; - } - - public int pageCount() { - return pages.size(); - } - - public AdvancedItemStack toBook() { - AdvancedItemStack book = new AdvancedItemStack(Material.WRITTEN_BOOK, 1, (short) 0, "book"); - BookMeta meta = (BookMeta) book.getItemMeta(); - meta.setTitle(title); - meta.setAuthor(author); - meta.setPages(pages); - book.setItemMeta(meta); - return book; - } - - public AdvancedItemStack toPamphlet() { - AdvancedItemStack book = new AdvancedItemStack(Material.PAPER, 1, (short) 0, "pamphlet"); - ItemMeta meta = book.getItemMeta(); - meta.setDisplayName(title); - List lore = new ArrayList(); - if (pages.size() > 0) { - lore.addAll(filterPageLore(pages.get(0))); - } - meta.setLore(lore); - book.setItemMeta(meta); - return book; - } - - public AdvancedItemStack toSecurityNote() { - AdvancedItemStack book = new AdvancedItemStack(Material.PAPER, 1, (short) 0, "note"); - ItemMeta meta = book.getItemMeta(); - meta.setDisplayName(title); - List lore = new ArrayList(); - if (pages.size() > 0) { - lore.addAll(filterPageLore(pages.get(0))); - } - if (author.equals("")) { - lore.add(String.format("§2#%d", watermark)); - } else { - lore.add(String.format("§2%s #%d", author, watermark)); - } - meta.setLore(lore); - book.setItemMeta(meta); - return book; - } - - private List filterPageLore(String lore) { - // Remove green - lore = lore.replace("§2", ""); - - // Remove line breaks - lore = lore.replaceAll("[ \r\n]+", " "); - - // Limit length - lore = StringUtils.limitLengthEllipsis(lore, PAGE_LORE_LENGTH_LIMIT); - - // Split in to lines based on length - List lines = StringUtils.splitLines(lore, PAGE_LORE_LINE_LIMIT); - - return lines; - } - - public int hashCode() { - int code = watermark; - code = code ^ title.hashCode(); - code += 349525; - code = code ^ author.hashCode(); - code += 349525; - for (String page : pages) { - code = code ^ page.hashCode(); - code += 349525; - } - return code; - } - } - - public enum OperationMode { - REPAIR(0, "Repair"), - SET_PLATES(1, "Set plates"), - PRINT_BOOKS(2, "Print books"), - PRINT_PAMPHLETS(3, "Print pamphlets"), - PRINT_SECURITY(4, "Print security notes"); - - private static final int MAX_ID = 5; - private int id; - private String description; - - private OperationMode(int id, String description) { - this.id = id; - this.description = description; - } - - public String getDescription() { - return description; - } - - public static OperationMode byId(int id) { - for (OperationMode mode : OperationMode.values()) { - if (mode.getId() == id) - return mode; - } - return null; - } - - public int getId() { - return id; - } - - public OperationMode getNext() { - int nextId = (getId() + 1) % MAX_ID; - return OperationMode.byId(nextId); - } - } - - @Override - protected void recipeFinished() { - // TODO Auto-generated method stub - - } -} diff --git a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java b/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java deleted file mode 100644 index 0a9804db..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.github.igotyou.FactoryMod.properties; - -import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; - -import com.github.igotyou.FactoryMod.FactoryModPlugin; -import com.github.igotyou.FactoryMod.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.AdvancedItemStack; - -public class PrintingPressProperties extends AFactoryProperties{ - - private ItemList fuel; - private ItemList constructionMaterials; - private ItemList plateMaterials; - private ItemList bindingMaterials; - private ItemList pageMaterials; - private int pagesPerLot; - private ItemList pamphletMaterials; - private int pamphletsPerLot; - private ItemList securityMaterials; - private int securityNotesPerLot; - private int energyTime; - private int maxRepair; - private ItemList repairMaterials; - private int pageLead; - private int setPlateTime; - private int repairTime; - private int bookPagesCap; - - - public int getPageLead() { - return pageLead; - } - - - public PrintingPressProperties( - ItemList fuel, - ItemList constructionMaterials, - ItemList repairMaterials, - ItemList plateMaterials, - ItemList bindingMaterials, - ItemList pageMaterials, - int pagesPerLot, - ItemList pamphletMaterials, - int pamphletsPerLot, - ItemList securityMaterials, - int securityNotesPerLot, - int energyTime, String name, int repair, int paperRate, - int pageLead, int setPlateTime, int repairTime, int bookPagesCap - ) - { - this.fuel = fuel; - this.energyTime = energyTime; - this.name = name; - this.maxRepair=repair; - this.constructionMaterials = constructionMaterials; - this.repairMaterials = repairMaterials; - this.plateMaterials = plateMaterials; - this.bindingMaterials = bindingMaterials; - this.pageMaterials = pageMaterials; - this.pagesPerLot = pagesPerLot; - this.pamphletMaterials = pamphletMaterials; - this.pamphletsPerLot = pamphletsPerLot; - this.securityMaterials = securityMaterials; - this.securityNotesPerLot = securityNotesPerLot; - this.pageLead = pageLead; - this.setPlateTime = setPlateTime; - this.repairTime = repairTime; - this.bookPagesCap = bookPagesCap; - } - - - public int getSetPlateTime() { - return setPlateTime; - } - - - public int getRepairTime() { - return repairTime; - } - - - public ItemList getBindingMaterials() { - return bindingMaterials; - } - - - public ItemList getPageMaterials() { - return pageMaterials; - } - - public ItemList getSecurityMaterials() { - return securityMaterials; - } - - public ItemList getRepairMaterials() { - return repairMaterials; - } - - public ItemList getPlateMaterials() { - return plateMaterials; - } - - - public static PrintingPressProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection configPrintingPresses) { - ItemList ppFuel=plugin.getItems(configPrintingPresses.getConfigurationSection("fuel")); - if(ppFuel.isEmpty()) - { - ppFuel=new ItemList(); - ppFuel.add(new AdvancedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); - } - ConfigurationSection costs = configPrintingPresses.getConfigurationSection("costs"); - ItemList ppConstructionCost=plugin.getItems(costs.getConfigurationSection("construction")); - ItemList ppRepairCost=plugin.getItems(costs.getConfigurationSection("repair")); - ItemList ppPlateCost=plugin.getItems(costs.getConfigurationSection("plates")); - ItemList ppBindingCost=plugin.getItems(costs.getConfigurationSection("binding")); - ItemList ppPageCost=plugin.getItems(costs.getConfigurationSection("page_lot")); - int pagesPerLot = costs.getInt("pages_per_lot",16); - ItemList ppPamphletCost=plugin.getItems(costs.getConfigurationSection("pamphlet_lot")); - int pamphletsPerLot = costs.getInt("pamphlets_per_lot",24); - ItemList ppSecurityCost=plugin.getItems(costs.getConfigurationSection("security_lot")); - int securityNotesPerLot = costs.getInt("security_notes_per_lot",24); - int ppEnergyTime = configPrintingPresses.getInt("fuel_time", 10); - int ppRepair = costs.getInt("repair_multiple",1); - String ppName = configPrintingPresses.getString("name", "Printing Press"); - int paperRate = configPrintingPresses.getInt("paper_rate",3); - int pageLead = configPrintingPresses.getInt("page_lead",12); - int setPageTime = configPrintingPresses.getInt("set_page_time",20); - int repairTime = configPrintingPresses.getInt("repair_time",12); - int bookPagesCap = configPrintingPresses.getInt("book_pages_cap",16); - return new PrintingPressProperties(ppFuel, ppConstructionCost, ppRepairCost, ppPlateCost, ppBindingCost, ppPageCost, pagesPerLot, ppPamphletCost, pamphletsPerLot, ppSecurityCost, securityNotesPerLot, ppEnergyTime, ppName, ppRepair, paperRate, pageLead, setPageTime, repairTime, bookPagesCap); - } - - - public int getMaxRepair() - { - return maxRepair; - } - - public int getPagesPerLot() { - return pagesPerLot; - } - - - public ItemList getPamphletMaterials() { - return pamphletMaterials; - } - - - public int getPamphletsPerLot() { - return pamphletsPerLot; - } - - - public int getSecurityNotesPerLot() { - return securityNotesPerLot; - } - - - public ItemList getFuel() - { - return fuel; - } - - public int getEnergyTime() - { - return energyTime; - } - - public ItemList getConstructionMaterials() { - return constructionMaterials; - } - - - public int getBookPagesCap() { - return bookPagesCap; - } -} From 01dedc6d94647f6da4ad4df32ad19acbf8072d27 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 10 Dec 2015 23:34:21 +0100 Subject: [PATCH 174/459] Small improvements everywhere --- .../igotyou/FactoryMod/FactoryModManager.java | 15 +++++- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../FurnCraftChestFactory.java | 49 +++++++++++++------ .../FurnCraftChestInteractionManager.java | 9 +++- .../IInteractionManager.java | 8 --- .../powerManager/FurnacePowerManager.java | 2 +- 6 files changed, 58 insertions(+), 27 deletions(-) rename src/com/github/igotyou/FactoryMod/{classicTriblockFactory => factories}/FurnCraftChestFactory.java (86%) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index fc4b567b..1f971508 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -19,6 +19,7 @@ public class FactoryModManager { protected FactoryModPlugin plugin; private HashMap, HashMap> factoryCreationRecipes; private HashMap> locations; + private HashMap eggs; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; @@ -30,6 +31,13 @@ public FactoryModManager(FactoryModPlugin plugin, this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; + + factoryCreationRecipes = new HashMap, HashMap>(); + locations = new HashMap>(); + eggs = new HashMap(); + possibleCenterBlocks = new HashSet(); + possibleInteractionBlock = new HashSet(); + // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); possibleInteractionBlock.add(Material.WORKBENCH); @@ -102,7 +110,7 @@ public void attemptCreation(Block b, Player p) { IFactoryEgg egg = eggs.get(new ItemMap((Inventory) (fccs .getChest().getState()))); if (egg != null) { - Factory f = egg.hatch(fccs,p); + Factory f = egg.hatch(fccs, p); if (f != null) { addFactory(f); } @@ -121,6 +129,7 @@ public void addFactoryEgg(Class blockStructureClass, eggs = new HashMap(); } eggs.put(recipe, egg); + this.eggs.put(egg.getName(), egg); } public boolean isPossibleCenterBlock(Material m) { @@ -130,4 +139,8 @@ public boolean isPossibleCenterBlock(Material m) { public boolean isPossibleInteractionBlock(Material m) { return possibleInteractionBlock.contains(m); } + + public IFactoryEgg getEgg(String name) { + return eggs.get(name); + } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index bed38b9c..7c73b1ef 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.Factory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; diff --git a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java similarity index 86% rename from src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java rename to src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index f80f0bd5..02aa015e 100644 --- a/src/com/github/igotyou/FactoryMod/classicTriblockFactory/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.classicTriblockFactory; +package com.github.igotyou.FactoryMod.factories; import java.util.List; @@ -17,6 +17,7 @@ import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; /** @@ -31,7 +32,8 @@ public class FurnCraftChestFactory extends Factory { protected IRecipe currentRecipe; public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, - IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, String name) { + IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, + String name) { super(im, rm, ipm, mbs, updateTime, name); this.active = false; } @@ -64,9 +66,29 @@ public FurnaceInventory getFurnaceInventory() { public void attemptToActivate(Player p) { // TODO Citadel stuff if (mbs.isComplete()) { - if (hasInputMaterials() && pm.powerAvailable()) { - activate(); - run(); + if (hasInputMaterials()) { + if (pm.powerAvailable()) { + if (rm.inDisrepair() + && !(currentRecipe instanceof RepairRecipe)) { + if (p != null) { + p.sendMessage("This factory is in disrepair, you have to repair it before using it"); + } + return; + } + if (p != null) { + p.sendMessage("Activated " + name + " with recipe: " + + currentRecipe.getRecipeName()); + } + activate(); + run(); + } else { + if (p != null) { + p.sendMessage("Failed to activate factory, there is no fuel in the furnace"); + } + } + } + else { + p.sendMessage("Not enough materials available"); //TODO how much is needed } } } @@ -192,15 +214,14 @@ else if (currentProductionTimer >= currentRecipe if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); FactoryModPlugin - .getPlugin() - .getServer() - .getScheduler() - .scheduleSyncDelayedTask( - FactoryModPlugin.getPlugin(), this, - (long) updateTime); - //keep going - } - else { + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask( + FactoryModPlugin.getPlugin(), this, + (long) updateTime); + // keep going + } else { deactivate(); } } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 9c3a2773..647011d0 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -6,12 +6,13 @@ import org.bukkit.ChatColor; import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.inventory.InventoryType; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; -import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; @@ -27,10 +28,14 @@ public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { public FurnCraftChestInteractionManager() { } - + public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } + + public void redStoneEvent(BlockRedstoneEvent e) { + //TODO + } public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index f7bc5d0b..d0405963 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -11,14 +11,6 @@ public interface IInteractionManager { public void blockBreak(Player p, Block b); - public void failedTurnOnDisrepair(Player p); - - public void failedTurnOnPermission(Player p); - - public void successfullTurnOn(Player p); - - public void turnOff(Player p); - public void redStoneEvent(BlockRedstoneEvent e); } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index 0dfa8b85..ae989266 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -3,7 +3,7 @@ import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.classicTriblockFactory.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.utility.ItemMap; public class FurnacePowerManager implements IPowerManager { From 33e647f8f86ec090112b9005b13508d10b2bf7fa Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 11 Dec 2015 00:17:59 +0100 Subject: [PATCH 175/459] Deleted old config --- config.yml | 11401 --------------------------------------------------- 1 file changed, 11401 deletions(-) diff --git a/config.yml b/config.yml index 5d7cc2ed..e69de29b 100644 --- a/config.yml +++ b/config.yml @@ -1,11401 +0,0 @@ -#Example: Production_general -# update_cycle: 20 the period of ticks between which factories are updated -# maintenance_cycle: 15 the period of ticks between which the maintenance of the factories are updated -# maintenance_rate: 1 %Modifies the rate at which factories degrade, higher numbers degrade the factories faster -#Example recipe entry with defaults included any section should be able to be excluded -# TITLE: (Don't use spaces, should be a unique identifier) -# name: Default Name (Displayed name to user) -# production_time: 1 (Time to produce the recipe) -# inputs: (only include if there are inputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# upgrades: (only include if there are inputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# outputs: (only include if there are outputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# enchantments: -# Common Name: -# type: (Offificial bukkit enchantment name, Require) -# level: 1 (level of the enchantment -# probability: 1 (0-1 probability of the enchantment being applied) -# output_recipes: -# - TITLE (TITLE of the output recipe) -# use_once: false (If this recipe is removed after its first use) -# maintenance: 0 (Maximum amount of maintence required for this recipe) -###################################################################### -#Example factory entry with defaults included any section should be able to be excluded -# TITLE: (Don't use spaces, should be a unique identifier) -# name: Default Name (Displayed name to user) -# fuel: (Defaults to charcoal if not present, only first entry used) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default)# -# lore: (lore of the item, null by default)# fuel_time: 1 (Time that a piece of fuel lasts) -# fuel_time: 1 (Time which fuel lasts) -# inputs: (required) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# production_recipes: -# - TITLE (title of recipe) -# repair_material: (Defaults to coal if none are present) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -######################################################################### -repair_factory: - fuel: - Charcoal: - material: 'COAL' - amount: 1 - durability: 1 - fuel_time: 5 - name: 'Reset Factory' - production_time: 10 - reset_level: 1 - costs: - construction: - Coal Ore: - material: 'COAL_ORE' - amount: 256 - Iron Ore: - material: 'IRON_ORE' - amount: 16 - Redstone Ore: - material: 'REDSTONE_ORE' - amount: 16 - Diamond Ore: - material: 'DIAMOND_ORE' - amount: 16 - Emerald Blocks: - material: 'EMERALD_BLOCK' - amount: 16 - repair_multiple: 2 - repair: - Coal Ore: - material: 'COAL_ORE' - amount: 10 - Iron Ore: - material: 'IRON_ORE' - amount: 1 - Redstone Ore: - material: 'REDSTONE_ORE' - amount: 1 - Diamond Ore: - material: 'DIAMOND_ORE' - amount: 1 - Emerald Blocks: - material: 'EMERALD_BLOCK' - amount: 1 - recipe: - Emerald Blocks: - material: 'EMERALD_BLOCK' - amount: 7 - repairable: - WOODEN_PICKAXE: - material: WOOD_PICKAXE - STONE_PICKAXE: - material: STONE_PICKAXE - IRON_PICKAXE: - material: IRON_PICKAXE - GOLDEN_PICKAXE: - material: GOLD_PICKAXE - DIAMOND_PICKAXE: - material: DIAMOND_PICKAXE - WOODEN_AXE: - material: WOOD_AXE - STONE_AXE: - material: STONE_AXE - IRON_AXE: - material: IRON_AXE - GOLDEN_AXE: - material: GOLD_AXE - DIAMOND_AXE: - material: DIAMOND_AXE - WOODEN_SHOVEL: - material: WOOD_SPADE - STONE_SHOVEL: - material: STONE_SPADE - IRON_SHOVEL: - material: IRON_SPADE - GOLDEN_SHOVEL: - material: GOLD_SPADE - DIAMOND_SHOVEL: - material: DIAMOND_SPADE - WOODEN_HOE: - material: WOOD_HOE - STONE_HOE: - material: STONE_HOE - IRON_HOE: - material: IRON_HOE - GOLDEN_HOE: - material: GOLD_HOE - DIAMOND_HOE: - material: DIAMOND_HOE - WOODEN_SWORD: - material: WOOD_SWORD - STONE_SWORD: - material: STONE_SWORD - IRON_SWORD: - material: IRON_SWORD - GOLDEN_SWORD: - material: GOLD_SWORD - DIAMOND_SWORD: - material: DIAMOND_SWORD - BOW: - material: BOW - FISHING_ROD: - material: FISHING_ROD - SHEARS: - material: SHEARS - LEATHER_BOOTS: - material: LEATHER_BOOTS - CHAIN_BOOTS: - material: CHAINMAIL_BOOTS - IRON_BOOTS: - material: IRON_BOOTS - GOLDEN_BOOTS: - material: GOLD_BOOTS - DIAMOND_BOOTS: - material: DIAMOND_BOOTS - LEATHER_PANTS: - material: LEATHER_LEGGINGS - CHAIN_LEGGINGS: - material: CHAINMAIL_LEGGINGS - IRON_LEGGINGS: - material: IRON_LEGGINGS - GOLDEN_LEGGINGS: - material: GOLD_LEGGINGS - DIAMOND_LEGGINGS: - material: DIAMOND_LEGGINGS - LEATHER_TUNIC: - material: LEATHER_CHESTPLATE - CHAIN_CHESTPLATE: - material: CHAINMAIL_CHESTPLATE - IRON_CHESTPLATE: - material: IRON_CHESTPLATE - GOLDEN_CHESTPLATE: - material: GOLD_CHESTPLATE - DIAMOND_CHESTPLATE: - material: DIAMOND_CHESTPLATE - LEATHER_CAP: - material: LEATHER_HELMET - CHAIN_HELMET: - material: CHAINMAIL_HELMET - IRON_HELMET: - material: IRON_HELMET - GOLDEN_HELMET: - material: GOLD_HELMET - DIAMOND_HELMET: - material: DIAMOND_HELMET -compactor: - fuel: - Charcoal: - material: 'COAL' - amount: 1 - durability: 1 - fuel_time: 1 - name: 'Compactor' - production_time: 1 - costs: - construction: - Crate: - material: CHEST - amount: 64 - display_name: Crate - lore: A crate for compacting items - 'Redstone Blocks': - material: REDSTONE_BLOCK - amount: 16 - Piston: - material: PISTON_BASE - amount: 192 - 'Iron Ingots': - material: IRON_INGOT - amount: 64 - 'Diamonds': - material: DIAMOND - amount: 48 - 'Slime Balls': - material: SLIME_BALL - amount: 24 - repair_multiple: 3 - repair: - Crate: - material: CHEST - amount: 2 - display_name: Crate - lore: A crate for compacting items - Redstone: - material: REDSTONE - amount: 4 - Piston: - material: PISTON_BASE - amount: 6 - 'Diamonds': - material: DIAMOND - amount: 2 - 'Iron Ingots': - material: IRON_INGOT - amount: 2 - 'Slime Balls': - material: SLIME_BALL - amount: 1 - recipe: - CRATE: - material: 'CHEST' - amount: 1 - display_name: Crate - lore: A crate for compacting items - compact_lore: Compacted Item - continuous: true - specific_exclusions: - excluded_types: - Written Book: - material: WRITTEN_BOOK - Book: - material: BOOK - Book and Quill: - material: BOOK_AND_QUILL - Enchanted Book: - material: ENCHANTED_BOOK - Paper: - material: PAPER - Map: - material: EMPTY_MAP - Filled Map: - material: MAP - Banner: - material: BANNER -copy_defaults: false -general: - central_block: WORKBENCH - save_cycle: 15 - return_build_materials: false - citadel_enabled: true - factory_interaction_material: STICK - disable_experience: true -production_general: - update_cycle: 20 - repair_period: 28 - disrepair_period: 14 -nether_general: - disable_portals: true - nether_scale: 8 - world_name: world - nether_name: world_nether - teleport_platform_material_nether_factory: OBSIDIAN - marker_material_nether_factory: COAL_BLOCK - marker_max_distance: 64 - allow_reinforcement_creation_above_teleport_platform: false - allow_block_placement_above_teleport_platform: true - teleport_platform_invunerable: false - regenerate_teleport_block_on_teleport: true - remove_blocks_above_teleport_platform_on_teleport: true -printing_presses: - fuel: - Charcoal: - material: 'COAL' - durability: 1 - fuel_time: 5 - costs: - construction: - "Iron block": - material: 'IRON_BLOCK' - amount: 60 - "Redstone": - material: REDSTONE - amount: 256 - "Quartz": - material: QUARTZ - amount: 64 - "Piston": - material: PISTON_BASE - amount: 20 - "Gold plate": - material: GOLD_PLATE - amount: 20 - plates: - "Iron ingot": - material: 'IRON_INGOT' - amount: 1 - "Gold nugget": - material: "GOLD_NUGGET" - amount: 1 - set_page_time: 5 - repair: - "Iron block": - material: 'IRON_BLOCK' - amount: 1 - repair_multiple: 5 - binding: # Each - Leather: - material: 'LEATHER' - amount: 1 - page_lot: - Paper: - material: 'PAPER' - amount: 4 - Ink: - material: 'INK_SACK' - durability: 0 - amount: 1 - pages_per_lot: 32 - page_lead: 6 - pamphlet_lot: - Paper: - material: 'PAPER' - amount: 4 - Ink: - material: 'INK_SACK' - durability: 0 - amount: 1 - pamphlets_per_lot: 32 - security_lot: - "Gold nuggets": - material: 'GOLD_NUGGET' - amount: 1 - "Cactus green": - material: 'INK_SACK' - durability: 2 - amount: 6 - security_notes_per_lot: 128 -crafting: - disable: - CHISSELED_STONE_BRICK: - material: SMOOTH_BRICK - durability: 3 - MOSSY_STONE: - material: SMOOTH_BRICK - durability: 1 - CRACKED_STONE_BRICK: - material: SMOOTH_BRICK - durability: 2 - MOSSY_COBBLE: - material: MOSSY_COBBLESTONE - enable: - XP to Emerald: - inputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 9 - output: - Emerald: - material: EMERALD - Emerald to XP: - inputs: - Emerald: - material: EMERALD - output: - Exp Bottle: - material: EXP_BOTTLE - amount: 9 - Stone Slab to Double Slab: - inputs: - Stone Slab: - material: STEP - amount: 9 - output: - Double Stone Slab: - material: STEP - amount: 4 - lore: Smooth double slab - Sandstone Slab to Double Slab: - inputs: - Sandstone Slab: - material: STEP - durability: 1 - amount: 9 - output: - Double Sandstone Slab: - material: STEP - durability: 1 - lore: Smooth double slab - amount: 4 - Sixsided oaklog: - inputs: - Oak log: - material: LOG - amount: 9 - output: - 6sided log: - material: LOG - amount: 6 - lore: Sixsided log - Sixsided sprucelog: - inputs: - Spruce log: - material: LOG - amount: 9 - durability: 1 - output: - 6sided log: - material: LOG - amount: 6 - lore: Sixsided log - durability: 1 - Sixsided birchlog: - inputs: - Birch log: - material: LOG - amount: 9 - durability: 2 - output: - 6sided log: - material: LOG - amount: 6 - lore: Sixsided log - durability: 2 - Sixsided junglelog: - inputs: - jungle log: - material: LOG - amount: 9 - durability: 3 - output: - 6sided log: - material: LOG - amount: 6 - lore: Sixsided log - durability: 3 - Sixsided acacialog: - inputs: - acacia log: - material: LOG_2 - amount: 9 - output: - 6sided log: - material: LOG_2 - amount: 6 - lore: Sixsided log - Sixsided dark oaklog: - inputs: - dark oak log: - material: LOG_2 - amount: 9 - durability: 1 - output: - 6sided log: - material: LOG_2 - amount: 6 - lore: Sixsided log - durability: 1 -production_factories: - Bakery: - name: Bakery - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Baked Potato: - material: BAKED_POTATO - amount: 512 - Cookie: - material: COOKIE - amount: 1024 - Bread: - material: BREAD - amount: 256 - Pumpkin Pie: - material: PUMPKIN_PIE - amount: 192 - recipes: - - Baked_Potato - - Bake_Cookie - - Bake_Bread - - Bake_Cake - - Bake_Pumpkin_Pie - repair_multiple: 10 - repair_inputs: - Baked Potato: - material: BAKED_POTATO - amount: 5 - Cookie: - material: COOKIE - amount: 10 - Bread: - material: BREAD - amount: 2 - Pumpkin Pie: - material: PUMPKIN_PIE - Black_Wool_Processing: - name: Black Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Black Wool: - material: WOOL - amount: 20 - durability: 15 - recipes: - - Dye_Black_Wool_Blue - - Dye_Black_Wool_Gray - - Dye_Black_Wool_Brown - - Dye_Black_Wool_Purple - - Dye_Black_Wool_Yellow - - Dye_Black_Wool_Magenta - - Dye_Black_Wool_Pink - - Dye_Black_Wool_Cyan - - Dye_Black_Wool_Orange - - Dye_Black_Wool_Green - - Dye_Black_Wool_White - - Dye_Black_Wool_Light_Gray - - Dye_Black_Wool_Light_Blue - - Dye_Black_Wool_Red - - Dye_Black_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Black Wool: - material: WOOL - durability: 15 - Brown_Wool_Processing: - name: Brown Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Brown Wool: - material: WOOL - amount: 20 - durability: 12 - recipes: - - Dye_Brown_Wool_Blue - - Dye_Brown_Wool_Gray - - Dye_Brown_Wool_Purple - - Dye_Brown_Wool_Yellow - - Dye_Brown_Wool_Black - - Dye_Brown_Wool_Magenta - - Dye_Brown_Wool_Pink - - Dye_Brown_Wool_Cyan - - Dye_Brown_Wool_Orange - - Dye_Brown_Wool_Green - - Dye_Brown_Wool_White - - Dye_Brown_Wool_Light_Gray - - Dye_Brown_Wool_Light_Blue - - Dye_Brown_Wool_Red - - Dye_Brown_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Brown Wool: - material: WOOL - durability: 12 - Charcoal_Smelter: - name: Charcoal Burner - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Charcoal: - material: COAL - amount: 768 - durability: 1 - recipes: - - Smelt_Oak_Wood - - Smelt_Spruce_Wood - - Smelt_Birch_Wood - - Smelt_Jungle_Wood - - Burn_Acacia_Wood - - Burn_Dark_Oak_Wood - - Smelt_Coal - - Smelt_Charcoal - repair_multiple: 10 - repair_inputs: - Charcoal: - material: COAL - durability: 1 - amount: 8 - Diamond_Axe_Smithy: - name: Diamond Axe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 64 - recipes: - - Diamond_Axe - repair_multiple: 7 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Boots_Smithy: - name: Diamond Boots Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 160 - recipes: - - Diamond_Boots - repair_multiple: 16 - repair_inputs: - Diamond: - material: DIAMOND - Emerald_Cauldron: - name: Emerald Cauldron - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 192 - Diamonds: - material: DIAMOND - amount: 128 - Iron: - material: IRON_INGOT - amount: 256 - recipes: - - Emerald_XP_0 - - Emerald_XP_1 - - Emerald_XP_2 - repair_multiple: 10 - repair_inputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - Diamonds: - material: DIAMOND - amount: 2 - Iron: - material: IRON_INGOT - amount: 3 - Nether_Compactor: - name: Nether Compactor - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Bedrock: - material: BEDROCK - amount: 3456 - lore: 'Admin Crimes Only' - recipes: - - Nether_Craft_Crate_of_Acacia_Sapling - - Nether_Craft_Crate_of_Baked_Potatoes - - Nether_Craft_Crate_of_Birch_Sapling - - Nether_Craft_Crate_of_Bread - - Nether_Craft_Crate_of_Brown_Mushrooms - - Nether_Craft_Crate_of_Cacti - - Nether_Craft_Crate_of_Carrots - - Nether_Craft_Crate_of_Cocoa - - Nether_Craft_Crate_of_Cookies - - Nether_Craft_Crate_of_Dark_Oak_Sapling - - Nether_Craft_Crate_of_Fish - - Nether_Craft_Crate_of_Glass_Bottles - - Nether_Craft_Crate_of_Grass - - Nether_Craft_Crate_of_Grass_Blocks - - Nether_Craft_Crate_of_Jungle_Sapling - - Nether_Craft_Crate_of_Melons - - Nether_Craft_Crate_of_Nether_Warts - - Nether_Craft_Crate_of_Oak_Sapling - - Nether_Craft_Crate_of_Pumpkins - - Nether_Craft_Crate_of_Red_Mushrooms - - Nether_Craft_Crate_of_Red_Rose - - Nether_Craft_Crate_of_Salmon - - Nether_Craft_Crate_of_Spruce_Sapling - - Nether_Craft_Crate_of_Sugar_Cane - - Nether_Craft_Crate_of_Vine - - Nether_Craft_Crate_of_Wheat - - Nether_Craft_Crate_of_Yellow_Flower - repair_multiple: 54 - repair_inputs: - Bedrock: - material: BEDROCK - amount: 64 - lore: 'Admin Crimes Only' - Nether_Decompactor: - name: Nether Decompactor - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Bedrock: - material: BEDROCK - amount: 64 - lore: 'Admin Crimes Only' - recipes: - - Nether_Decraft_Crate_of_Acacia_Sapling - - Nether_Decraft_Crate_of_Baked_Potatoes - - Nether_Decraft_Crate_of_Birch_Sapling - - Nether_Decraft_Crate_of_Bread - - Nether_Decraft_Crate_of_Brown_Mushrooms - - Nether_Decraft_Crate_of_Cacti - - Nether_Decraft_Crate_of_Carrots - - Nether_Decraft_Crate_of_Cocoa - - Nether_Decraft_Crate_of_Cookies - - Nether_Decraft_Crate_of_Dark_Oak_Sapling - - Nether_Decraft_Crate_of_Fish - - Nether_Decraft_Crate_of_Glass_Bottles - - Nether_Decraft_Crate_of_Grass - - Nether_Decraft_Crate_of_Grass_Blocks - - Nether_Decraft_Crate_of_Jungle_Sapling - - Nether_Decraft_Crate_of_Melons - - Nether_Decraft_Crate_of_Nether_Warts - - Nether_Decraft_Crate_of_Oak_Sapling - - Nether_Decraft_Crate_of_Pumpkins - - Nether_Decraft_Crate_of_Red_Mushrooms - - Nether_Decraft_Crate_of_Red_Rose - - Nether_Decraft_Crate_of_Salmon - - Nether_Decraft_Crate_of_Spruce_Sapling - - Nether_Decraft_Crate_of_Sugar_Cane - - Nether_Decraft_Crate_of_Vine - - Nether_Decraft_Crate_of_Wheat - - Nether_Decraft_Crate_of_Yellow_Flower - repair_multiple: 54 - repair_inputs: - Bedrock: - material: BEDROCK - amount: 64 - lore: 'Admin Crimes Only' - Diamond_Cauldron: - name: Diamond Cauldron - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 128 - Iron Ingot: - material: IRON_INGOT - amount: 256 - recipes: - - Diamond_XP_Bottle_0 - - Diamond_XP_Bottle_1 - - Diamond_XP_Bottle_2 - repair_multiple: 10 - repair_inputs: - Diamond: - material: DIAMOND - amount: 1 - Iron Ingot: - material: IRON_INGOT - amount: 3 - Diamond_Chestplate_Smithy: - name: Diamond Chestplate Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 320 - recipes: - - Diamond_Chestplate - repair_multiple: 32 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Helmet_Smithy: - name: Diamond Helmet Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 192 - recipes: - - Diamond_Helmet - repair_multiple: 20 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Hoe_Smithy: - name: Diamond Hoe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 32 - recipes: - - Diamond_Hoe - repair_multiple: 4 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Leggings_Smithy: - name: Diamond Leggings Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 256 - recipes: - - Diamond_Leggings - repair_multiple: 26 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Pickaxe_Smithy: - name: Diamond Pickaxe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 96 - recipes: - - Diamond_Pickaxe - repair_multiple: 10 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Spade_Smithy: - name: Diamond Spade Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 48 - recipes: - - Diamond_Spade - repair_multiple: 5 - repair_inputs: - Diamond: - material: DIAMOND - Diamond_Sword_Smithy: - name: Diamond Sword Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 80 - recipes: - - Diamond_Sword - repair_multiple: 8 - repair_inputs: - Diamond: - material: DIAMOND - Random_Wooden_Tool_Factory: - name: Random Wooden Tool Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Sticks: - material: STICK - amount: 96 - recipes: - - Create_Wooden_Pickaxe - - Create_Wooden_Spade - - Create_Wooden_Axe - - Create_Fishing_Rod - repair_multiple: 9 - repair_inputs: - Sticks: - material: STICK - amount: 1 - Random_Leather_Armor_Factory: - name: Random Leather Armor Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Leather: - material: LEATHER - amount: 64 - recipes: - - Create_Leather_Leggings - - Create_Leather_Boots - - Create_Leather_Chestplate - - Create_Leather_Helmet - repair_multiple: 6 - repair_inputs: - Leather: - material: LEATHER - amount: 1 - Random_Wooden_Weapon_Factory: - name: Random Wooden Weapon Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Sticks: - material: STICK - amount: 32 - recipes: - - Create_Wooden_Sword - repair_multiple: 1 - repair_inputs: - Sticks: - material: STICK - amount: 3 - Random_Iron_Tool_Factory: - name: Random Iron Tool Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 96 - recipes: - - Create_Iron_Axe - - Create_Iron_Pickaxe - - Create_Iron_Spade - repair_multiple: 9 - repair_inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 1 - Random_Iron_Armor_Factory: - name: Random Iron Armor Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 64 - recipes: - - Create_Iron_Leggings - - Create_Iron_Boots - - Create_Iron_Chestplate - - Create_Iron_Helmet - repair_multiple: 6 - repair_inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 1 - Random_Iron_Weapon_Factory: - name: Random Iron Weapon Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 32 - recipes: - - Create_Iron_Sword - repair_multiple: 3 - repair_inputs: - Iron Blocks: - material: IRON_BLOCK - amount: 1 - Random_Diamond_Tool_Factory: - name: Random Diamond Tool Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 96 - recipes: - - Create_Diamond_Axe - - Create_Diamond_Pickaxe - - Create_Diamond_Spade - repair_multiple: 9 - repair_inputs: - Emerald Blocks: - material: EMERALD_BLOCK - Random_Diamond_Armor_Factory: - name: Random Diamond Armor Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 64 - recipes: - - Create_Diamond_Leggings - - Create_Diamond_Boots - - Create_Diamond_Chestplate - - Create_Diamond_Helmet - repair_multiple: 6 - repair_inputs: - Emerald Blocks: - material: EMERALD_BLOCK - Random_Diamond_Weapon_Factory: - name: Random Diamond Weapon Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 32 - recipes: - - Create_Bow - - Create_Diamond_Sword - repair_multiple: 3 - repair_inputs: - Emerald Blocks: - material: EMERALD_BLOCK - Sword_Enchantment_Factory: - name: Sword Enchantment Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond Block: - material: DIAMOND_BLOCK - amount: 32 - Emerald Block: - material: EMERALD_BLOCK - amount: 64 - recipes: - - Enchant_Sharpness - - Enchant_Fire_Aspect - - Enchant_Looting - repair_multiple: 10 - repair_inputs: - Diamonds: - material: DIAMOND - amount: 3 - Emeralds: - material: EMERALD - amount: 6 - Armour_Enchantment_Factory: - name: Armour Enchantment Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond Block: - material: DIAMOND_BLOCK - amount: 64 - Emerald Block: - material: EMERALD_BLOCK - amount: 96 - recipes: - - Enchant_P4_Chest - - Enchant_P4_Legs - - Enchant_P4_Boots - - Enchant_P4_Helmet - - Enchant_U3_Chest - - Enchant_U3_Legs - - Enchant_U3_Boots - - Enchant_U3_Helmet - repair_multiple: 10 - repair_inputs: - Diamonds: - material: DIAMOND - amount: 6 - Emeralds: - material: EMERALD - amount: 9 - Tool_Enchantment_Factory: - name: Tool Enchantment Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond Block: - material: DIAMOND_BLOCK - amount: 96 - Emerald Block: - material: EMERALD_BLOCK - amount: 128 - recipes: - - Enchant_Picks_E5 - - Enchant_Picks_U3 - - Enchant_Picks_S1 - - Enchant_Picks_F3 - - Enchant_Axes_E5 - - Enchant_Axes_U3 - - Enchant_Axes_S1 - - Enchant_Axes_F3 - - Enchant_Spades_E5 - - Enchant_Spades_U3 - - Enchant_Spades_S1 - - Enchant_Spades_F3 - repair_multiple: 10 - repair_inputs: - Diamonds: - material: DIAMOND - amount: 9 - Emeralds: - material: EMERALD - amount: 12 - Glass_Smelter: - name: Glass Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Sand: - material: SAND - amount: 2048 - Charcoal: - material: COAL - amount: 256 - durability: 1 - recipes: - - Smelt_Glass - - Smelt_Sandstone - - Smelt_Glass_Panes - - Smelt_Bottles - - Smelt_Red_Sand - - Smelt_Red_Sandstone - - Smelt_Glass_From_Sandstone - repair_multiple: 26 - repair_inputs: - Sand: - material: SAND - amount: 8 - Charcoal: - material: COAL - durability: 1 - Nether_Brick_Smelter: - name: Nether Brick Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Netherrack: - material: NETHERRACK - amount: 2048 - Charcoal: - material: COAL - amount: 256 - durability: 1 - recipes: - - Smelt_Nether_bricks - repair_multiple: 26 - repair_inputs: - Netherrack: - material: NETHERRACK - amount: 8 - Charcoal: - material: COAL - durability: 1 - Kiln: - name: Kiln - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Clay: - material: CLAY - amount: 1280 - Charcoal: - material: COAL - amount: 256 - durability: 1 - recipes: - - Bake_clay_blocks - - Bake_bricks - - Bake_pots - - Bake_brick_blocks - repair_multiple: 26 - repair_inputs: - Clay: - material: CLAY - amount: 8 - Charcoal: - material: COAL - durability: 1 - Gold_Axe_Smithy: - name: Gold Axe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 64 - recipes: - - Gold_Axe - repair_multiple: 7 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Boots_Smithy: - name: Gold Boots Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 160 - recipes: - - Gold_Boots - repair_multiple: 16 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Chestplate_Smithy: - name: Gold Chestplate Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 320 - recipes: - - Gold_Chestplate - repair_multiple: 32 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Helmet_Smithy: - name: Gold Helmet Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 192 - recipes: - - Gold_Helmet - repair_multiple: 20 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Hoe_Smithy: - name: Gold Hoe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 32 - recipes: - - Gold_Hoe - repair_multiple: 4 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Leggings_Smithy: - name: Gold Leggings Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 256 - recipes: - - Gold_Leggings - repair_multiple: 26 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Pickaxe_Smithy: - name: Gold Pickaxe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 96 - recipes: - - Gold_Pickaxe - repair_multiple: 10 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Spade_Smithy: - name: Gold Spade Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 48 - recipes: - - Gold_Spade - repair_multiple: 5 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gold_Sword_Smithy: - name: Gold Sword Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 80 - recipes: - - Gold_Sword - repair_multiple: 8 - repair_inputs: - Gold Ingot: - material: GOLD_INGOT - Gray_Wool_Processing: - name: Gray Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Gray Wool: - material: WOOL - amount: 20 - durability: 7 - recipes: - - Dye_Gray_Wool_Blue - - Dye_Gray_Wool_Brown - - Dye_Gray_Wool_Purple - - Dye_Gray_Wool_Yellow - - Dye_Gray_Wool_Black - - Dye_Gray_Wool_Magenta - - Dye_Gray_Wool_Pink - - Dye_Gray_Wool_Cyan - - Dye_Gray_Wool_Orange - - Dye_Gray_Wool_Green - - Dye_Gray_Wool_White - - Dye_Gray_Wool_Light_Gray - - Dye_Gray_Wool_Light_Blue - - Dye_Gray_Wool_Red - - Dye_Gray_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Gray Wool: - material: WOOL - durability: 7 - Grill: - name: Grill - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Cooked Chicken: - material: COOKED_CHICKEN - amount: 192 - Cooked Fish: - material: COOKED_FISH - amount: 16 - Cooked Salmon: - material: COOKED_FISH - amount: 16 - durability: 1 - Grilled Pork: - material: GRILLED_PORK - amount: 160 - Cooked Beef: - material: COOKED_BEEF - amount: 64 - recipes: - - Cooked_Chicken - - Cooked_Fish - - Grilled_Pork - - Cooked_Beef - - Cook_Salmon - - Cook_Mutton - - Cook_Rabbit - - Bastion_Rations - repair_multiple: 2 - repair_inputs: - Cooked Chicken: - material: COOKED_CHICKEN - amount: 10 - Cooked Fish: - material: COOKED_FISH - Cooked Salmon: - material: COOKED_FISH - durability: 1 - Grilled Pork: - material: GRILLED_PORK - amount: 8 - Cooked Beef: - material: COOKED_BEEF - amount: 4 - Iron_Axe_Smithy: - name: Iron Axe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 64 - recipes: - - Iron_Axe - repair_multiple: 7 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Boots_Smithy: - name: Iron Boots Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 160 - recipes: - - Iron_Boots - repair_multiple: 16 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Cauldron: - name: Iron Cauldron - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 224 - recipes: - - Iron_XP_Bottle_0 - - Iron_XP_Bottle_1 - - Iron_XP_Bottle_2 - - Iron_XP_Bottle_3 - - Bastion_Smaragdus_Polisher - repair_multiple: 20 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Chestplate_Smithy: - name: Iron Chestplate Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 320 - recipes: - - Iron_Chestplate - repair_multiple: 32 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Helmet_Smithy: - name: Iron Helmet Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 192 - recipes: - - Iron_Helmet - repair_multiple: 20 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Hoe_Smithy: - name: Iron Hoe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 32 - recipes: - - Iron_Hoe - repair_multiple: 4 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Leggings_Smithy: - name: Iron Leggings Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 256 - recipes: - - Iron_Leggings - repair_multiple: 26 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Pickaxe_Smithy: - name: Iron Pickaxe Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 96 - recipes: - - Iron_Pickaxe - repair_multiple: 10 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Spade_Smithy: - name: Iron Spade Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 48 - recipes: - - Iron_Spade - repair_multiple: 5 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Iron_Sword_Smithy: - name: Iron Sword Smithy - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 80 - recipes: - - Iron_Sword - repair_multiple: 8 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - Light_Gray_Wool_Processing: - name: Light Gray Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Light Gray Wool: - material: WOOL - amount: 20 - durability: 8 - recipes: - - Dye_Light_Gray_Wool_Blue - - Dye_Light_Gray_Wool_Gray - - Dye_Light_Gray_Wool_Brown - - Dye_Light_Gray_Wool_Purple - - Dye_Light_Gray_Wool_Yellow - - Dye_Light_Gray_Wool_Black - - Dye_Light_Gray_Wool_Magenta - - Dye_Light_Gray_Wool_Pink - - Dye_Light_Gray_Wool_Cyan - - Dye_Light_Gray_Wool_Orange - - Dye_Light_Gray_Wool_Green - - Dye_Light_Gray_Wool_White - - Dye_Light_Gray_Wool_Light_Blue - - Dye_Light_Gray_Wool_Red - - Dye_Light_Gray_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Light Gray Wool: - material: WOOL - durability: 8 - Pink_Wool_Processing: - name: Pink Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Pink Wool: - material: WOOL - amount: 20 - durability: 6 - recipes: - - Dye_Pink_Wool_Blue - - Dye_Pink_Wool_Gray - - Dye_Pink_Wool_Brown - - Dye_Pink_Wool_Purple - - Dye_Pink_Wool_Yellow - - Dye_Pink_Wool_Black - - Dye_Pink_Wool_Magenta - - Dye_Pink_Wool_Cyan - - Dye_Pink_Wool_Orange - - Dye_Pink_Wool_Green - - Dye_Pink_Wool_White - - Dye_Pink_Wool_Light_Gray - - Dye_Pink_Wool_Light_Blue - - Dye_Pink_Wool_Red - - Dye_Pink_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Pink Wool: - material: WOOL - durability: 6 - Rail_Factory: - name: Rail Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 320 - Stick: - material: STICK - amount: 128 - Gold Ingot: - material: GOLD_INGOT - amount: 192 - Redstone: - material: REDSTONE - amount: 32 - recipes: - - Produce_Rail - - Produce_Powered_Rail - - Produce_Detector_Rail - - Produce_Activator_Rail - - Produce_Minecarts - repair_multiple: 4 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - amount: 7 - Stick: - material: STICK - amount: 3 - Gold Ingot: - material: GOLD_INGOT - amount: 5 - Redstone: - material: REDSTONE - Horse_Factory: - name: Animal Husbandry Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Block: - material: IRON_BLOCK - amount: 64 - Hay Bale: - material: HAY_BLOCK - amount: 64 - Golden Apple: - material: GOLDEN_APPLE - amount: 64 - Slime ball: - material: SLIME_BALL - amount: 16 - recipes: - - Produce_Saddle - - Produce_Diamond_Horse_Armor - - Produce_Gold_Horse_Armor - - Produce_Iron_Horse_Armor - - Produce_Leads - - Produce_Donkey_Chest - repair_multiple: 6 - repair_inputs: - Iron Block: - material: IRON_BLOCK - Hay Bale: - material: HAY_BLOCK - Golden Apple: - material: GOLDEN_APPLE - amount: 1 - durability: 0 - Basic_Redstone_Factory: - name: Basic Redstone Mechanism Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Redstone: - material: REDSTONE - amount: 960 - Stick: - material: STICK - amount: 512 - Stone: - material: STONE - amount: 576 - Netherquartz: - material: QUARTZ - amount: 256 - Glass: - material: GLASS - amount: 128 - recipes: - - Produce_Redstone_Torches - - Produce_Repeaters - - Produce_Comparators - - Produce_Daylight_Sensors - repair_multiple: 10 - repair_inputs: - Netherquartz: - material: QUARTZ - amount: 25 - Glass: - material: GLASS - amount: 12 - Redstone: - material: REDSTONE - amount: 9 - Advanced_Redstone_Factory: - name: Advanced Redstone Mechanism Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Redstone: - material: REDSTONE - amount: 960 - Chest: - material: CHEST - amount: 72 - Glowstone: - material: GLOWSTONE - amount: 256 - Iron Ingot: - material: IRON_INGOT - amount: 576 - Slime ball: - material: SLIME_BALL - amount: 64 - Diamond: - material: DIAMOND - amount: 64 - recipes: - - Produce_Noteblocks - - Produce_Dispensers - - Produce_Redstone_lamps - - Produce_Pistons - - Produce_Sticky_Pistons - - Produce_Jukeboxes - - Produce_Hoppers - - Produce_Droppers - repair_multiple: 10 - repair_inputs: - Redstone: - material: REDSTONE - amount: 9 - Glowstone: - material: GLOWSTONE - amount: 2 - Iron Ingot: - material: IRON_INGOT - amount: 6 - Slime ball: - material: SLIME_BALL - amount: 1 - Carpentry_factory: - name: Carpentry factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Paper: - material: PAPER - amount: 384 - Chest: - material: CHEST - amount: 128 - Leather: - material: LEATHER - amount: 128 - recipes: - - Craft_Fences - - Craft_Boats - - Craft_Signs - - Craft_Ladders - - Craft_Trap_Doors - - Craft_Item_Frames - - Craft_Bookshelfs - - Bastion_Framing - - Craft_Crate - - Craft_Crate_Oak_Bulk - - Craft_Crate_Birch_Bulk - - Craft_Crate_Jungle_Bulk - - Craft_Crate_Acacia_Bulk - - Craft_Crate_Dark_Oak_Bulk - - Craft_Crate_Spruce_Bulk - repair_multiple: 10 - repair_inputs: - Paper: - material: PAPER - amount: 4 - Chest: - material: CHEST - amount: 1 - Leather: - material: LEATHER - amount: 1 - Industrial_Ore_Refinery: - name: Industrial Ore Refinery - fuel: - Coal Blocks: - material: COAL_BLOCK - inputs: - Lapis Lazuli Blocks: - material: LAPIS_BLOCK - amount: 128 - Netherquartz: - material: QUARTZ - amount: 576 - Diamond Blocks: - material: DIAMOND_BLOCK - amount: 96 - Coal Blocks: - material: COAL_BLOCK - amount: 576 - Iron Blocks: - material: IRON_BLOCK - amount: 256 - Gold Blocks: - material: GOLD_BLOCK - amount: 128 - Redstone Blocks: - material: REDSTONE_BLOCK - amount: 256 - recipes: - - Refine_Diamond_Ore - - Refine_Lapis_Lazuli_Ore - - Refine_Netherquartz_Ore - - Refine_Coal_Ore - - Refine_Redstone_Ore - - Refine_Iron_Ore - - Refine_Gold_Ore - - Bastion_Base - - Bastion_Walls - repair_multiple: 10 - repair_inputs: - Lapis Lazuli Blocks: - material: LAPIS_BLOCK - Netherquartz: - material: QUARTZ - amount: 5 - Diamond Blocks: - material: DIAMOND_BLOCK - amount: 1 - Coal Blocks: - material: COAL_BLOCK - amount: 5 - Iron Blocks: - material: IRON_BLOCK - amount: 3 - Gold Blocks: - material: GOLD_BLOCK - amount: 3 - Redstone Blocks: - material: REDSTONE_BLOCK - amount: 3 - Fancy_Ore_Smelter: - name: Gem Extractor - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 1024 - durability: 4 - Netherquartz: - material: QUARTZ - amount: 384 - Diamond: - material: DIAMOND - amount: 160 - recipes: - - Smelt_Lapis_Lazuli_Ore - - Smelt_Netherquartz_Ore - - Bastion_Walls - - Smelt_Diamond_Ore - repair_multiple: 10 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - amount: 10 - durability: 4 - Netherquartz: - material: QUARTZ - amount: 4 - Diamond: - material: DIAMOND - amount: 2 - Smelter: - name: Ore Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Coal: - material: COAL - amount: 1024 - Iron Ingot: - material: IRON_INGOT - amount: 256 - Gold Ingot: - material: GOLD_INGOT - amount: 128 - Redstone: - material: REDSTONE - amount: 1024 - recipes: - - Smelt_Coal_Ore - - Smelt_Redstone_Ore - - Smelt_Iron_Ore - - Smelt_Gold_Ore - - Bastion_Base - repair_multiple: 10 - repair_inputs: - Coal: - material: COAL - amount: 10 - Iron Ingot: - material: IRON_INGOT - amount: 3 - Gold Ingot: - material: GOLD_INGOT - amount: 1 - Redstone: - material: REDSTONE - amount: 10 - Igneous_Stone_Smelter: - name: Igneous Stone smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Bedrock: - material: BEDROCK - lore: Admincrimes only - amount: 1 - recipes: - - Smelt_Granite - - Smelt_Diorite - - Smelt_Andesite - repair_multiple: 10 - repair_inputs: - Bedrock: - material: BEDROCK - lore: Admincrimes only - amount: 1 - Stone_Brick_Smelter: - name: Stone Brick Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 2560 - Lapis Lazuli: - material: INK_SACK - amount: 256 - durability: 4 - Netherquartz: - material: QUARTZ - amount: 256 - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 256 - recipes: - - Smelt_Prismarine - - Smelt_Prismarine_Bricks - - Smelt_Dark_Prismarine - - Smelt_Cracked_Stone_Brick - - Smelt_Mossy_Stone_Brick - - Smelt_Chiseled_Stone_Brick - - Smelt_Granite - - Smelt_Diorite - - Smelt_Andesite - - Bastion_Flooring - - Smelt_Stone - repair_multiple: 10 - repair_inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 25 - Lapis Lazuli: - material: INK_SACK - amount: 3 - durability: 4 - Netherquartz: - material: QUARTZ - amount: 3 - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 3 - Stone_Smelter: - name: Stone Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Stone: - material: STONE - amount: 2048 - recipes: - - Smelt_Stone - repair_multiple: 10 - repair_inputs: - Stone: - material: STONE - armount: 20 - Bio_Lab: - name: Bio Lab - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Oak Saplings: - material: SAPLING - amount: 512 - Grass: - material: GRASS - amount: 512 - recipes: - - Mutate_Spruce_Saplings - - Mutate_Birch_Saplings - - Mutate_Jungle_Saplings - - Mutate_Acacia_Saplings - - Mutate_Dark_Oak_Saplings - - Mutate_Podzol - - Mutate_Grassless_Dirt - - Sequencing_Allium - - Sequencing_Sunflower - - Sequencing_Lilac - - Sequencing_Double_Tallgrass - - Sequencing_Large_Fern - - Sequencing_Rose_Bush - - Sequencing_Peony - repair_multiple: 10 - repair_inputs: - Oak Saplings: - material: SAPLING - amount: 5 - Grass: - material: GRASS - amount: 5 - Mad_Scientist_Lab: - name: Mad Scientist Lab - fuel: - Emeralds: - material: EMERALD - inputs: - Glass bottles: - material: GLASS_BOTTLE - amount: 512 - Pig eggs: - material: MONSTER_EGG - durability: 90 - amount: 16 - Villager eggs: - material: MONSTER_EGG - durability: 120 - amount: 16 - Squid eggs: - material: MONSTER_EGG - durability: 94 - amount: 16 - Horse eggs: - material: MONSTER_EGG - durability: 100 - amount: 16 - Silk touch book: - material: ENCHANTED_BOOK - amount: 1 - stored_enchantments: - Silk Touch 1: - type: SILK_TOUCH - level: 1 - recipes: - - Mutate_Pigmen - - Infect_Zombies - - Mutate_Skeletons - - Mutate_Creepers - - Mutate_Witches - - Mutate_Spiders - - Mutate_Cave_Spiders - - Mutate_Ghasts - repair_multiple: 2 - repair_inputs: - Glass_bottles: - material: GLASS_BOTTLE - amount: 32 - Pig eggs: - material: MONSTER_EGG - durability: 90 - amount: 1 - Villager eggs: - material: MONSTER_EGG - durability: 120 - amount: 1 - Squid eggs: - material: MONSTER_EGG - durability: 94 - amount: 1 - Horse eggs: - material: MONSTER_EGG - durability: 100 - amount: 1 - Explosives_Factory: - name: Explosives Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Sulphur: - material: SULPHUR - amount: 384 - Sand: - material: SAND - amount: 384 - Blaze Powder: - material: BLAZE_POWDER - amount: 64 - recipes: - - Produce_TNT - - Produce_Fire_Charges - - Produce_Eyes_of_Ender - - Bastion_Silicon_Tetranitratobihydrotrioxycarbon - repair_multiple: 10 - repair_inputs: - Sulphur: - material: SULPHUR - amount: 4 - Sand: - material: SAND - amount: 4 - Iron_Forge_factory: - name: Iron Forge - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 1152 - recipes: - - Forge_Shears - - Forge_Anvils - - Forge_Tripwire_Hooks - - Forge_Iron_Bars - - Forge_Buckets - - Forge_Iron_Doors - - Forge_Iron_Trapdoors - - Forge_Flint_And_Steel - - Bastion_Gearbox - repair_multiple: 10 - repair_inputs: - Iron Ingot: - material: IRON_INGOT - amount: 12 - Stained_Clay_Processing: - name: Stained Clay Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Hardened Clay: - material: HARD_CLAY - amount: 20 - recipes: - - Dye_Blue_Stained_Clay - - Dye_Brown_Stained_Clay - - Dye_Purple_Stained_Clay - - Dye_Yellow_Stained_Clay - - Dye_Black_Stained_Clay - - Dye_Magenta_Stained_Clay - - Dye_Pink_Stained_Clay - - Dye_Cyan_Stained_Clay - - Dye_Orange_Stained_Clay - - Dye_Gray_Stained_Clay - - Dye_Green_Stained_Clay - - Dye_White_Stained_Clay - - Dye_Light_Gray_Stained_Clay - - Dye_Light_Blue_Stained_Clay - - Dye_Red_Stained_Clay - - Dye_Lime_Stained_Clay - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Hardened Clay: - material: HARD_CLAY - Stained_Glass_Processing: - name: Stained Glass Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - Stained Glass: - material: STAINED_GLASS - amount: 20 - durability: 7 - Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 20 - durability: 7 - recipes: - - Dye_Blue_Stained_Glass - - Dye_Brown_Stained_Glass - - Dye_Purple_Stained_Glass - - Dye_Yellow_Stained_Glass - - Dye_Black_Stained_Glass - - Dye_Magenta_Stained_Glass - - Dye_Pink_Stained_Glass - - Dye_Cyan_Stained_Glass - - Dye_Orange_Stained_Glass - - Dye_Gray_Stained_Glass - - Dye_Green_Stained_Glass - - Dye_White_Stained_Glass - - Dye_Light_Gray_Stained_Glass - - Dye_Light_Blue_Stained_Glass - - Dye_Red_Stained_Glass - - Dye_Lime_Stained_Glass - - Dye_Blue_Stained_Glass_Pane - - Dye_Brown_Stained_Glass_Pane - - Dye_Purple_Stained_Glass_Pane - - Dye_Yellow_Stained_Glass_Pane - - Dye_Black_Stained_Glass_Pane - - Dye_Magenta_Stained_Glass_Pane - - Dye_Pink_Stained_Glass_Pane - - Dye_Cyan_Stained_Glass_Pane - - Dye_Orange_Stained_Glass_Pane - - Dye_Gray_Stained_Glass_Pane - - Dye_Green_Stained_Glass_Pane - - Dye_White_Stained_Glass_Pane - - Dye_Light_Gray_Stained_Glass_Pane - - Dye_Light_Blue_Stained_Glass_Pane - - Dye_Red_Stained_Glass_Pane - - Dye_Lime_Stained_Glass_Pane - - Bastion_Objet_Dart - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - Gray Stained Glass: - material: STAINED_GLASS - durability: 7 - Gray Stained Glass Pane: - material: STAINED_GLASS_PANE - durability: 7 - Crystallisation_Factory: - name: Crystallisation Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Ice: - material: ICE - amount: 2048 - Charcoal: - material: COAL - amount: 256 - durability: 1 - recipes: - - Compact_Ice - - Bastion_Pure_Ice - repair_multiple: 10 - repair_inputs: - Ice: - material: ICE - amount: 20 - Charcoal: - material: COAL - durability: 1 - White_Wool_Processing: - name: White Wool Processing - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 20 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 20 - durability: 8 - Cocoa: - material: INK_SACK - amount: 20 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 20 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 20 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 20 - Magenta Dye: - material: INK_SACK - amount: 20 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 20 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 20 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 20 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 20 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 20 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 20 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 20 - durability: 12 - Rose Red: - material: INK_SACK - amount: 20 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 20 - durability: 10 - White Wool: - material: WOOL - amount: 20 - recipes: - - Dye_White_Wool_Blue - - Dye_White_Wool_Gray - - Dye_White_Wool_Brown - - Dye_White_Wool_Purple - - Dye_White_Wool_Yellow - - Dye_White_Wool_Black - - Dye_White_Wool_Magenta - - Dye_White_Wool_Pink - - Dye_White_Wool_Cyan - - Dye_White_Wool_Orange - - Dye_White_Wool_Green - - Dye_White_Wool_Light_Gray - - Dye_White_Wool_Light_Blue - - Dye_White_Wool_Red - - Dye_White_Wool_Lime - repair_multiple: 2 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - durability: 4 - Gray Dye: - material: INK_SACK - durability: 8 - Cocoa: - material: INK_SACK - durability: 3 - Purple Dye: - material: INK_SACK - durability: 5 - Dandelion Yellow: - material: INK_SACK - durability: 11 - Ink Sack: - material: INK_SACK - Magenta Dye: - material: INK_SACK - durability: 13 - Pink Dye: - material: INK_SACK - durability: 9 - Cyan Dye: - material: INK_SACK - durability: 6 - Orange Dye: - material: INK_SACK - durability: 14 - Cactus Green: - material: INK_SACK - durability: 2 - Bone Meal: - material: INK_SACK - durability: 15 - Light Gray Dye: - material: INK_SACK - durability: 7 - Light Blue Dye: - material: INK_SACK - durability: 12 - Rose Red: - material: INK_SACK - durability: 1 - Lime Dye: - material: INK_SACK - durability: 10 - White Wool: - material: WOOL - Wood_Cauldron: - name: Wood Cauldron - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Stick: - material: STICK - amount: 1024 - recipes: - - Wood_XP_0 - - Wood_XP_1 - - Wood_XP_2 - - Wood_XP_3 - repair_multiple: 103 - repair_inputs: - Stick: - material: STICK - Bastion_Factory: - name: Bastion Factory - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Silicon Tetranitratobihydrotrioxycarbon: - material: FIREWORK_CHARGE - amount: 64 - display_name: Silicon Tetranitratobihydrotrioxycarbon - lore: An item used to create a Bastion Block - Smaragdus: - material: EMERALD - amount: 64 - display_name: Smaragdus - lore: An item used to create a Bastion Block - Flooring: - material: CLAY_BRICK - amount: 8 - display_name: Flooring - lore: An item used to create a Bastion Block - Framing: - material: STICK - amount: 8 - display_name: Framing - lore: An item used to create a Bastion Block - Gearbox: - material: WATCH - amount: 8 - display_name: Gearbox - lore: An item used to create a Bastion Block - Base: - material: IRON_INGOT - amount: 8 - display_name: Base - lore: An item used to create a Bastion Block - Walls: - material: INK_SACK - amount: 32 - durablity: 4 - display_name: Walls - lore: An item used to create a Bastion Block - recipes: - - Bastion_Block - repair_multiple: 16 - repair_inputs: - Pure Ice: - material: QUARTZ - amount: 1 - display_name: Pure Ice - lore: An item used to repair the Bastion Factory - Silicon Tetranitratobihydrotrioxycarbon: - material: FIREWORK_CHARGE - amount: 1 - display_name: Silicon Tetranitratobihydrotrioxycarbon - lore: An item used to create a Bastion Block - Smaragdus: - material: EMERALD - amount: 1 - display_name: Smaragdus - lore: An item used to create a Bastion Block - Aspect_Factory: - name: Arcane Elementizer - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Netherbrick: - material: NETHER_BRICK - amount: 1536 - Redstone: - material: REDSTONE - amount: 1152 - Netherquartz: - material: QUARTZ - amount: 576 - recipes: - - Forge_Aspect_of_Terra - - Forge_Aspect_of_End - - Forge_Aspect_of_Nether - - Craft_Eye_of_Ender - repair_multiple: 26 - repair_inputs: - Nether Brick: - material: NETHER_BRICK - amount: 6 - Redstone: - material: REDSTONE - amount: 5 - Netherquartz: - material: QUARTZ - amount: 2 -nether_factory: - name: Nether Factory - fuel: - Charcoal: - material: COAL - durability: 1 - costs: - construction: - Aspect of Nether: - material: MAGMA_CREAM - amount: 8 - display_name: Aspect of Nether - lore: A concentrated essence of the Nether - Aspect of Terra: - material: DIAMOND - amount: 8 - display_name: Aspect of Terra - lore: A concentrated essence of Terra - Aspect of End: - material: FLINT - amount: 8 - display_name: Aspect of End - lore: A concentrated essence of the End - repair: - Diamond block: - material: DIAMOND_BLOCK - amount: 1 - repair_multiple: 1 - fuel_time: 10 - repair_time: 12 - scaling_radius: 5000 - cost_scaling_radius: 5000 - use_fuel_on_teleport: false -production_recipes: - Baked_Potato: - name: Bake Potato - production_time: 24 - inputs: - Potato: - material: POTATO_ITEM - amount: 192 - outputs: - Baked Potato: - material: BAKED_POTATO - amount: 384 - Dye_Black_Wool_Cyan: - name: Dye Black Wool Cyan - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Dye_Light_Gray_Wool_Purple: - name: Dye Light Gray Wool Purple - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_Black_Wool_Orange: - name: Dye Black Wool Orange - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Dye_Light_Gray_Wool_Green: - name: Dye Light Gray Wool Green - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Dye_Light_Gray_Wool_Gray: - name: Dye Light Gray Wool Gray - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Smelt_Diamond_Ore: - name: Smelt Diamond Ore - production_time: 4 - inputs: - Diamond Ore: - material: DIAMOND_ORE - amount: 32 - outputs: - Diamond: - material: DIAMOND - amount: 96 - Diamond_XP_Bottle_0: - name: Brew XP Bottles - 1 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 256 - Carrot: - material: CARROT_ITEM - amount: 512 - Melon Block: - material: MELON_BLOCK - amount: 4 - Brown Mushroom: - material: BROWN_MUSHROOM - amount: 128 - Cocoa: - material: INK_SACK - amount: 64 - durability: 3 - Grass Blocks: - material: GRASS - amount: 128 - Bread: - material: BREAD - amount: 128 - Sugar Cane: - material: SUGAR_CANE - amount: 32 - Yellow Flower: - material: YELLOW_FLOWER - amount: 32 - Oak Sapling: - material: SAPLING - amount: 8 - durability: 0 - Jungle Sapling: - material: SAPLING - amount: 6 - durability: 3 - Acacia Sapling: - material: SAPLING - amount: 12 - durability: 4 - outputs: - Emerald Block: - material: EMERALD_BLOCK - amount: 2 - Dye_Brown_Wool_Orange: - name: Dye Brown Wool Orange - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Smelt_Jungle_Wood: - name: Burn Jungle Wood - production_time: 24 - inputs: - Jungle Wood: - material: LOG - amount: 256 - durability: 3 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Burn_Acacia_Wood: - name: Burn Acacia Wood - production_time: 24 - inputs: - Acacia Wood: - material: LOG_2 - amount: 256 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Burn_Dark_Oak_Wood: - name: Burn Dark Oak Wood - production_time: 24 - inputs: - Dark Oak Wood: - material: LOG_2 - amount: 256 - durability: 1 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Diamond_Boots: - name: Forge Diamond Boots. - production_time: 20 - inputs: - Diamond: - material: DIAMOND - amount: 20 - outputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 15 - Dye_Gray_Wool_Black: - name: Dye Gray Wool Black - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Ink Sack: - material: INK_SACK - amount: 4 - outputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Dye_Black_Wool_Brown: - name: Dye Black Wool Brown - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Cocoa: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Iron_Boots: - name: Forge Iron Boots. - production_time: 20 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 20 - outputs: - Iron Boots: - material: IRON_BOOTS - amount: 15 - Dye_Pink_Wool_Brown: - name: Dye Pink Wool Brown - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Cocoa: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Gold_Spade: - name: Forge Gold Spade. - production_time: 5 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 5 - outputs: - Gold Spade: - material: GOLD_SPADE - amount: 15 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.1 - Efficiency 1: - type: DIG_SPEED - level: 1 - probability: 0.3 - Efficiency 2: - type: DIG_SPEED - level: 2 - probability: 0.2 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.1 - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.05 - Efficiency 5: - type: DIG_SPEED - level: 5 - probability: 0.01 - Dye_Black_Wool_Gray: - name: Dye Black Wool Gray - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Dye_Gray_Wool_Light_Gray: - name: Dye Gray Wool Light Gray - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Dye_White_Wool_Cyan: - name: Dye White Wool Cyan - inputs: - White Wool: - material: WOOL - amount: 64 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Diamond_Hoe: - name: Forge Diamond Hoe. - production_time: 10 - inputs: - Diamond: - material: DIAMOND - amount: 10 - outputs: - Diamond Hoe: - material: DIAMOND_HOE - amount: 30 - Gold_Chestplate: - name: Forge Gold Chestplate. - production_time: 40 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 40 - outputs: - Gold Chestplate: - material: GOLD_CHESTPLATE - amount: 15 - durability: -218 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Blast Protection 1: - type: PROTECTION_EXPLOSIONS - level: 1 - probability: 0.5 - Blast Protection 2: - type: PROTECTION_EXPLOSIONS - level: 2 - probability: 0.4 - Blast Protection 3: - type: PROTECTION_EXPLOSIONS - level: 3 - probability: 0.3 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.4 - Fire Protection 1: - type: PROTECTION_FIRE - level: 1 - probability: 0.5 - Fire Protection 2: - type: PROTECTION_FIRE - level: 2 - probability: 0.4 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.3 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.4 - Projectile Protection 1: - type: PROTECTION_PROJECTILE - level: 1 - probability: 0.5 - Projectile Protection 2: - type: PROTECTION_PROJECTILE - level: 2 - probability: 0.4 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.3 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.4 - Dye_Light_Gray_Wool_Light_Blue: - name: Dye Light Gray Wool Light Blue - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Dye_Brown_Wool_Cyan: - name: Dye Brown Wool Cyan - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Iron_XP_Bottle_0: - name: Brew XP Bottles - 1 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 32 - Carrot: - material: CARROT_ITEM - amount: 512 - Cactus: - material: CACTUS - amount: 16 - Cocoa: - material: INK_SACK - amount: 64 - durability: 3 - Melon Block: - material: MELON_BLOCK - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 32 - Dye_White_Wool_Red: - name: Dye White Wool Red - inputs: - White Wool: - material: WOOL - amount: 64 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Dye_Brown_Wool_Purple: - name: Dye Brown Wool Purple - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_White_Wool_Purple: - name: Dye White Wool Purple - inputs: - White Wool: - material: WOOL - amount: 64 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_Light_Gray_Wool_Orange: - name: Dye Light Gray Wool Orange - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Dye_Black_Wool_Yellow: - name: Dye Black Wool Yellow - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Dye_Light_Gray_Wool_Pink: - name: Dye Light Gray Wool Pink - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dye_Light_Gray_Wool_Brown: - name: Dye Light Gray Wool Brown - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Cocoa: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Smelt_Spruce_Wood: - name: Burn Spruce Wood - production_time: 24 - inputs: - Spruce Wood: - material: LOG - amount: 256 - durability: 1 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Dye_Brown_Wool_Magenta: - name: Dye Brown Wool Magenta - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Dye_White_Wool_Brown: - name: Dye White Wool Brown - inputs: - White Wool: - material: WOOL - amount: 64 - Cocoa: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Dye_Gray_Wool_Lime: - name: Dye Gray Wool Lime - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Dye_Light_Gray_Wool_Black: - name: Dye Light Gray Wool Black - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Ink Sack: - material: INK_SACK - amount: 4 - outputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Dye_Brown_Wool_Yellow: - name: Dye Brown Wool Yellow - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Dye_Pink_Wool_White: - name: Dye Pink Wool White - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Wool: - material: WOOL - amount: 64 - Smelt_Coal_Ore: - name: Smelt Coal Ore - production_time: 12 - inputs: - Coal Ore: - material: COAL_ORE - amount: 128 - outputs: - Coal: - material: COAL - amount: 384 - Dye_Brown_Wool_Green: - name: Dye Brown Wool Green - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Dye_Light_Gray_Wool_Lime: - name: Dye Light Gray Wool Lime - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Smelt_Birch_Wood: - name: Burn Birch Wood - production_time: 24 - inputs: - Birch Wood: - material: LOG - amount: 256 - durability: 2 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Diamond_Sword: - name: Forge Diamond Sword. - production_time: 10 - inputs: - Diamond: - material: DIAMOND - amount: 10 - outputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 15 - Dye_Pink_Wool_Orange: - name: Dye Pink Wool Orange - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Dye_Black_Wool_Blue: - name: Dye Black Wool Blue - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Dye_Black_Wool_Magenta: - name: Dye Black Wool Magenta - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Iron_Helmet: - name: Forge Iron Helmet. - production_time: 25 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 25 - outputs: - Iron Helmet: - material: IRON_HELMET - amount: 15 - Dye_Gray_Wool_Cyan: - name: Dye Gray Wool Cyan - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Cooked_Chicken: - name: Grill Raw Chicken - production_time: 6 - inputs: - Raw Chicken: - material: RAW_CHICKEN - amount: 64 - outputs: - Cooked Chicken: - material: COOKED_CHICKEN - amount: 128 - Cook_Mutton: - name: Grill Raw Mutton - production_time: 6 - inputs: - Raw Mutton: - material: MUTTON - amount: 64 - outputs: - Cooked Mutton: - material: COOKED_MUTTON - amount: 128 - Cook_Rabbit: - name: Grill Raw Rabbit - production_time: 6 - inputs: - Raw Rabbit: - material: RABBIT - amount: 64 - outputs: - Cooked Rabbit: - material: COOKED_RABBIT - amount: 128 - Dye_Brown_Wool_Pink: - name: Dye Brown Wool Pink - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dye_Black_Wool_White: - name: Dye Black Wool White - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Wool: - material: WOOL - amount: 64 - Dye_Gray_Wool_Pink: - name: Dye Gray Wool Pink - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dye_White_Wool_Pink: - name: Dye White Wool Pink - inputs: - White Wool: - material: WOOL - amount: 64 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dye_Light_Gray_Wool_Yellow: - name: Dye Light Gray Wool Yellow - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Dye_Pink_Wool_Green: - name: Dye Pink Wool Green - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Dye_White_Wool_Black: - name: Dye White Wool Black - inputs: - White Wool: - material: WOOL - amount: 64 - Ink Sack: - material: INK_SACK - amount: 4 - outputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Dye_Gray_Wool_Blue: - name: Dye Gray Wool Blue - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Gold_Pickaxe: - name: Forge Gold Pickaxe. - production_time: 15 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 15 - outputs: - Gold Pickaxe: - material: GOLD_PICKAXE - amount: 15 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.1 - Efficiency 1: - type: DIG_SPEED - level: 1 - probability: 0.3 - Efficiency 2: - type: DIG_SPEED - level: 2 - probability: 0.2 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.1 - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.05 - Efficiency 5: - type: DIG_SPEED - level: 5 - probability: 0.01 - Dye_Pink_Wool_Blue: - name: Dye Pink Wool Blue - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Dye_Light_Gray_Wool_Cyan: - name: Dye Light Gray Wool Cyan - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Dye_Pink_Wool_Magenta: - name: Dye Pink Wool Magenta - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Dye_Light_Gray_Wool_Blue: - name: Dye Light Gray Wool Blue - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Dye_White_Wool_Orange: - name: Dye White Wool Orange - inputs: - White Wool: - material: WOOL - amount: 64 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Cooked_Beef: - name: Cook Beef - production_time: 6 - inputs: - Raw Beef: - material: RAW_BEEF - amount: 64 - outputs: - Cooked Beef: - material: COOKED_BEEF - amount: 128 - Cook_Salmon: - name: Cook Salmon - production_time: 6 - inputs: - Raw Salmon: - material: RAW_FISH - amount: 64 - durability: 1 - outputs: - Cooked Salmon: - material: COOKED_FISH - amount: 512 - durability: 1 - Produce_TNT: - name: Produce TNT - production_time: 128 - inputs: - Sulphur: - material: SULPHUR - amount: 128 - Sand: - material: SAND - amount: 128 - outputs: - TNT: - material: TNT - amount: 64 - Produce_Fire_Charges: - name: Produce Fire Charges - production_time: 128 - inputs: - Sulphur: - material: SULPHUR - amount: 16 - Blaze Powder: - material: BLAZE_POWDER - amount: 16 - outputs: - Fire Charge: - material: FIREBALL - amount: 128 - Produce_Eyes_of_Ender: - name: Produce Eyes of Ender - production_time: 8 - inputs: - Ender pearls: - material: ENDER_PEARL - amount: 32 - Blaze Powder: - material: BLAZE_POWDER - amount: 16 - outputs: - Eyes of Ender: - material: EYE_OF_ENDER - amount: 32 - Dye_White_Wool_Green: - name: Dye White Wool Green - inputs: - White Wool: - material: WOOL - amount: 64 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Iron_Chestplate: - name: Forge Iron Chestplate. - production_time: 40 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 40 - outputs: - Iron Chestplate: - material: IRON_CHESTPLATE - amount: 15 - Dye_Black_Wool_Red: - name: Dye Black Wool Red - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Gold_Leggings: - name: Forge Gold Leggings. - production_time: 35 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 35 - outputs: - Gold Leggings: - material: GOLD_LEGGINGS - amount: 15 - durability: -218 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Blast Protection 1: - type: PROTECTION_EXPLOSIONS - level: 1 - probability: 0.5 - Blast Protection 2: - type: PROTECTION_EXPLOSIONS - level: 2 - probability: 0.4 - Blast Protection 3: - type: PROTECTION_EXPLOSIONS - level: 3 - probability: 0.3 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.4 - Fire Protection 1: - type: PROTECTION_FIRE - level: 1 - probability: 0.5 - Fire Protection 2: - type: PROTECTION_FIRE - level: 2 - probability: 0.4 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.3 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.4 - Projectile Protection 1: - type: PROTECTION_PROJECTILE - level: 1 - probability: 0.5 - Projectile Protection 2: - type: PROTECTION_PROJECTILE - level: 2 - probability: 0.4 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.3 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.4 - Dye_White_Wool_Light_Gray: - name: Dye White Wool Light Gray - inputs: - White Wool: - material: WOOL - amount: 64 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Dye_Gray_Wool_Green: - name: Dye Gray Wool Green - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Diamond_Chestplate: - name: Forge Diamond Chestplate. - production_time: 40 - inputs: - Diamond: - material: DIAMOND - amount: 40 - outputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 15 - Dye_Light_Gray_Wool_Magenta: - name: Dye Light Gray Wool Magenta - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Dye_Brown_Wool_Light_Gray: - name: Dye Brown Wool Light Gray - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Iron_Leggings: - name: Forge Iron Leggings. - production_time: 35 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 35 - outputs: - Iron Leggings: - material: IRON_LEGGINGS - amount: 15 - Diamond_XP_Bottle_1: - name: Brew XP Bottles - 2 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 256 - Cactus: - material: CACTUS - amount: 32 - Wheat: - material: WHEAT - amount: 384 - Pumpkin: - material: PUMPKIN - amount: 16 - Grass: - material: LONG_GRASS - amount: 128 - durability: 1 - Cocoa: - material: INK_SACK - amount: 64 - durability: 3 - Red Mushroom: - material: RED_MUSHROOM - amount: 128 - Cooked Fish: - material: COOKED_FISH - amount: 16 - Red Rose: - material: RED_ROSE - amount: 16 - Cooked Salmon: - material: COOKED_FISH - amount: 8 - durability: 1 - Spruce Sapling: - material: SAPLING - amount: 10 - durability: 1 - Dark Oak Sapling: - material: SAPLING - amount: 4 - durability: 5 - outputs: - Emerald Block: - material: EMERALD_BLOCK - amount: 2 - Diamond_XP_Bottle_2: - name: Brew XP Bottles - 3 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 256 - Cookie: - material: COOKIE - amount: 768 - Baked Potato: - material: BAKED_POTATO - amount: 512 - Sugar Cane: - material: SUGAR_CANE - amount: 32 - Grass Blocks: - material: GRASS - amount: 32 - Pumpkin: - material: PUMPKIN - amount: 16 - Nether Wart: - material: NETHER_STALK - amount: 128 - Vine: - material: VINE - amount: 128 - Red Mushroom: - material: RED_MUSHROOM - amount: 128 - Melon Block: - material: MELON_BLOCK - amount: 4 - Yellow Flower: - material: YELLOW_FLOWER - amount: 32 - Birch Sapling: - material: SAPLING - amount: 8 - durability: 2 - outputs: - Emerald Block: - material: EMERALD_BLOCK - amount: 2 - Dye_White_Wool_Gray: - name: Dye White Wool Gray - inputs: - White Wool: - material: WOOL - amount: 64 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Iron_Spade: - name: Forge Iron Spade. - production_time: 5 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 5 - outputs: - Iron Spade: - material: IRON_SPADE - amount: 15 - Dye_Brown_Wool_Light_Blue: - name: Dye Brown Wool Light Blue - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Dye_White_Wool_Lime: - name: Dye White Wool Lime - inputs: - White Wool: - material: WOOL - amount: 64 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Dye_Black_Wool_Light_Gray: - name: Dye Black Wool Light Gray - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Dye_White_Wool_Blue: - name: Dye White Wool Blue - inputs: - White Wool: - material: WOOL - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Dye_Brown_Wool_White: - name: Dye Brown Wool White - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Wool: - material: WOOL - amount: 64 - Dye_Pink_Wool_Purple: - name: Dye Pink Wool Purple - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_Pink_Wool_Cyan: - name: Dye Pink Wool Cyan - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - - Cyan Wool: - material: WOOL - amount: 64 - durability: 9 - Dye_Light_Gray_Wool_Red: - name: Dye Light Gray Wool Red - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Iron_Axe: - name: Forge Iron Axe. - production_time: 15 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 15 - outputs: - Iron Axe: - material: IRON_AXE - amount: 30 - Bake_Cookie: - name: Bake Cocoa - production_time: 24 - inputs: - Wheat: - material: WHEAT - amount: 256 - Cocoa: - material: INK_SACK - amount: 128 - durability: 3 - outputs: - Cookie: - material: COOKIE - amount: 2048 - Dye_White_Wool_Light_Blue: - name: Dye White Wool Light Blue - inputs: - White Wool: - material: WOOL - amount: 64 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Dye_White_Wool_Yellow: - name: Dye White Wool Yellow - inputs: - White Wool: - material: WOOL - amount: 64 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Dye_Light_Gray_Wool_White: - name: Dye Light Gray Wool White - inputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Wool: - material: WOOL - amount: 64 - Bake_Bread: - name: Bake Wheat - production_time: 24 - inputs: - Wheat: - material: WHEAT - amount: 384 - outputs: - Bread: - material: BREAD - amount: 256 - Bake_Cake: - name: Bake Cake - production_time: 24 - inputs: - Sugar: - material: SUGAR - amount: 36 - Egg: - material: EGG - amount: 13 - Wheat: - material: WHEAT - amount: 54 - Milk Bucket: - material: MILK_BUCKET - amount: 18 - outputs: - Cake: - material: CAKE - amount: 24 - Bucket: - material: BUCKET - amount: 18 - Bake_Pumpkin_Pie: - name: Bake Pumpkin Pie - production_time: 24 - inputs: - Sugar: - material: SUGAR - amount: 192 - Egg: - material: EGG - amount: 192 - Pumpkin: - material: PUMPKIN - amount: 192 - outputs: - Pumpkin_Pie: - material: PUMPKIN_PIE - amount: 256 - Smelt_Glass: - name: Smelt Glass - production_time: 48 - inputs: - Sand: - material: SAND - amount: 256 - outputs: - Glass: - material: GLASS - amount: 768 - Smelt_Nether_bricks: - name: Smelt Nether bricks - production_time: 32 - inputs: - Netherrack: - material: NETHERRACK - amount: 512 - outputs: - Nether bricks: - material: NETHER_BRICK - amount: 256 - Bake_clay_blocks: - name: Bake Clay Blocks - production_time: 32 - inputs: - Clay: - material: CLAY - amount: 512 - outputs: - Hardened Clay: - material: HARD_CLAY - amount: 1024 - Bake_bricks: - name: Bake Individual Bricks - production_time: 32 - inputs: - Clay: - material: CLAY - amount: 128 - outputs: - Bricks: - material: CLAY_BRICK - amount: 1024 - Bake_pots: - name: Bake Flowerpots - production_time: 5 - inputs: - Clay: - material: CLAY - amount: 16 - outputs: - Flower Pots: - material: FLOWER_POT_ITEM - amount: 64 - Bake_brick_blocks: - name: Bake brick blocks - production_time: 32 - inputs: - Clay: - material: CLAY - amount: 128 - outputs: - Brick blocks: - material: BRICK - amount: 256 - Smelt_Sandstone: - name: Smelt Sandstone - production_time: 32 - inputs: - Sand: - material: SAND - amount: 512 - outputs: - Sandstone: - material: SANDSTONE - amount: 384 - Smelt_Glass_Panes: - name: Smelt Glass Panes - production_time: 32 - inputs: - Glass: - material: GLASS - amount: 192 - outputs: - Glass Pane: - material: THIN_GLASS - amount: 768 - Smelt_Bottles: - name: Smelt Bottles - production_time: 64 - inputs: - Sand: - material: SAND - amount: 256 - outputs: - Bottle: - material: GLASS_BOTTLE - amount: 768 - Smelt_Red_Sand: - name: Smelt Red Sand - production_time: 16 - inputs: - Sand: - material: SAND - amount: 64 - outputs: - Red Sand: - material: SAND - amount: 64 - durability: 1 - Smelt_Red_Sandstone: - name: Smelt Red Sandstone - production_time: 32 - inputs: - Red Sand: - material: SAND - amount: 512 - durability: 1 - outputs: - Red Sandstone: - material: RED_SANDSTONE - amount: 384 - durability: 0 - Smelt_Glass_From_Sandstone: - name: Smelt Glass From Sandstone - production_time: 32 - inputs: - Sandstone: - material: SANDSTONE - amount: 512 - outputs: - Glass: - material: GLASS - amount: 768 - production_time: 6 - Smelt_Lapis_Lazuli_Ore: - name: Smelt Lapis Lazuli Ore - production_time: 16 - inputs: - Lapis Ore: - material: LAPIS_ORE - amount: 32 - outputs: - Lapis Lazuli: - material: INK_SACK - amount: 640 - durability: 4 - Smelt_Redstone_Ore: - name: Smelt Redstone Ore - production_time: 16 - inputs: - Redstone Ore: - material: REDSTONE_ORE - amount: 64 - outputs: - Redstone: - material: REDSTONE - amount: 640 - Smelt_Netherquartz_Ore: - name: Smelt Netherquartz ore - production_time: 6 - inputs: - Netherquartz ore: - material: QUARTZ_ORE - amount: 128 - outputs: - Quartz: - material: QUARTZ - amount: 640 - Dye_Brown_Wool_Gray: - name: Dye Brown Wool Gray - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Diamond_Helmet: - name: Forge Diamond Helmet. - production_time: 25 - inputs: - Diamond: - material: DIAMOND - amount: 25 - outputs: - Diamond Helmet: - material: DIAMOND_HELMET - amount: 15 - Produce_Rail: - name: Produce Rails - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 128 - Stick: - material: STICK - amount: 16 - outputs: - Rail: - material: RAILS - amount: 576 - Produce_Redstone_Torches: - name: Produce Redstone Torches - inputs: - Redstone: - material: REDSTONE - amount: 128 - Stick: - material: STICK - amount: 128 - outputs: - Redstone Torches: - material: REDSTONE_TORCH_ON - amount: 256 - Produce_Repeaters: - name: Produce Repeaters - inputs: - Redstone: - material: REDSTONE - amount: 128 - Stone: - material: STONE - amount: 128 - outputs: - Redstone Repeaters: - material: DIODE - amount: 96 - Produce_Comparators: - name: Produce Comparators - inputs: - Redstone: - material: REDSTONE - amount: 32 - Stone: - material: STONE - amount: 128 - Netherquartz: - material: QUARTZ - amount: 24 - outputs: - Comparators: - material: REDSTONE_COMPARATOR - amount: 32 - Produce_Daylight_Sensors: - name: Produce Daylight Sensors - inputs: - Chest: - material: CHEST - amount: 4 - Glass: - material: GLASS - amount: 64 - Netherquartz: - material: QUARTZ - amount: 64 - outputs: - Daylight sensors: - material: DAYLIGHT_DETECTOR - amount: 32 - Produce_Noteblocks: - name: Produce Noteblocks - inputs: - Chest: - material: CHEST - amount: 48 - Redstone: - material: REDSTONE - amount: 32 - outputs: - Noteblocks: - material: NOTE_BLOCK - amount: 64 - Produce_Dispensers: - name: Produce Dispensers - inputs: - Cobblestone: - material: COBBLESTONE - amount: 320 - Redstone: - material: REDSTONE - amount: 32 - String: - material: STRING - amount: 128 - Chest: - material: CHEST - amount: 4 - outputs: - Dispensers: - material: DISPENSER - amount: 64 - Produce_Redstone_lamps: - name: Produce Redstone lamps - inputs: - Glowstone: - material: GLOWSTONE - amount: 128 - Redstone: - material: REDSTONE - amount: 256 - outputs: - Redstone lamps: - material: REDSTONE_LAMP_OFF - amount: 128 - Produce_Pistons: - name: Produce Pistons - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 128 - Chest: - material: CHEST - amount: 32 - Cobblestone: - material: COBBLESTONE - amount: 320 - Redstone: - material: REDSTONE - amount: 48 - outputs: - Pistons: - material: PISTON_BASE - amount: 128 - Produce_Sticky_Pistons: - name: Produce Sticky Pistons - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 32 - Chest: - material: CHEST - amount: 8 - Redstone: - material: REDSTONE - amount: 12 - Slime Ball: - material: SLIME_BALL - amount: 16 - outputs: - Pistons: - material: PISTON_STICKY_BASE - amount: 32 - Produce_Jukeboxes: - name: Produce Jukeboxes - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 32 - Diamond: - material: DIAMOND - amount: 48 - outputs: - Jukebox: - material: JUKEBOX - amount: 64 - Produce_Hoppers: - name: Produce Hoppers - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 32 - Iron Ingot: - material: IRON_INGOT - amount: 192 - outputs: - Hopper: - material: HOPPER - amount: 64 - Produce_Droppers: - name: Produce Droppers - inputs: - Cobblestone: - material: COBBLESTONE - amount: 320 - Redstone: - material: REDSTONE - amount: 32 - outputs: - Droppers: - material: DROPPER - amount: 64 - Smelt_Gold_Ore: - name: Smelt Gold Ore - production_time: 8 - inputs: - Gold Ore: - material: GOLD_ORE - amount: 32 - outputs: - Gold Ingot: - material: GOLD_INGOT - amount: 384 - Dye_Gray_Wool_Brown: - name: Dye Gray Wool Brown - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Cocoa: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Iron_Pickaxe: - name: Forge Iron Pickaxe. - production_time: 15 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 15 - outputs: - Iron Pickaxe: - material: IRON_PICKAXE - amount: 15 - Dye_Black_Wool_Pink: - name: Dye Black Wool Pink - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dye_Gray_Wool_Orange: - name: Dye Gray Wool Orange - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Wool: - material: WOOL - amount: 64 - durability: 1 - Smelt_Cracked_Stone_Brick: - name: Smelt Cracked Stone Brick - production_time: 64 - inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 32 - durability: 4 - Flint: - material: FLINT - amount: 64 - outputs: - Cracked Stone Brick: - material: SMOOTH_BRICK - amount: 64 - durability: 2 - Iron_XP_Bottle_1: - name: Brew XP Bottles - 2 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 32 - Wheat: - material: WHEAT - amount: 256 - Baked Potato: - material: BAKED_POTATO - amount: 256 - Sugar Cane: - material: SUGAR_CANE - amount: 16 - Pumpkin: - material: PUMPKIN - amount: 8 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 32 - Iron_XP_Bottle_3: - name: Brew XP Bottles - 4 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 32 - Wheat: - material: WHEAT - amount: 256 - Cactus: - material: CACTUS - amount: 16 - Cocoa: - material: INK_SACK - amount: 64 - durability: 3 - Pumpkin: - material: PUMPKIN - amount: 8 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 32 - Iron_XP_Bottle_2: - name: Brew XP Bottles - 3 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 32 - Carrot: - material: CARROT_ITEM - amount: 512 - Baked Potato: - material: BAKED_POTATO - amount: 256 - Sugar Cane: - material: SUGAR_CANE - amount: 16 - Melon Block: - material: MELON_BLOCK - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 32 - Diamond_Leggings: - name: Forge Diamond Leggings. - production_time: 35 - inputs: - Diamond: - material: DIAMOND - amount: 35 - outputs: - Diamond Leggings: - material: DIAMOND_LEGGINGS - amount: 15 - Dye_Gray_Wool_Red: - name: Dye Gray Wool Red - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Dye_Pink_Wool_Light_Gray: - name: Dye Pink Wool Light Gray - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Wool: - material: WOOL - amount: 64 - durability: 8 - Iron_Sword: - name: Forge Iron Sword. - production_time: 10 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 10 - outputs: - Iron Sword: - material: IRON_SWORD - amount: 15 - Dye_Gray_Wool_Purple: - name: Dye Gray Wool Purple - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_Black_Wool_Green: - name: Dye Black Wool Green - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Wool: - material: WOOL - amount: 64 - durability: 13 - Dye_Brown_Wool_Red: - name: Dye Brown Wool Red - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Dye_Pink_Wool_Light_Blue: - name: Dye Pink Wool Light Blue - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Gold_Hoe: - name: Forge Gold Hoe. - production_time: 10 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 10 - outputs: - Gold Hoe: - material: GOLD_HOE - amount: 30 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Gold_Sword: - name: Forge Gold Sword. - production_time: 10 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 10 - outputs: - Gold Sword: - material: GOLD_SWORD - amount: 15 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Bane of the Anthropods 1: - type: DAMAGE_ARTHROPODS - level: 1 - probability: 0.4 - Bane of the Anthropods 2: - type: DAMAGE_ARTHROPODS - level: 2 - probability: 0.3 - Bane of the Anthropods 3: - type: DAMAGE_ARTHROPODS - level: 3 - probability: 0.2 - Bane of the Anthropods 4: - type: DAMAGE_ARTHROPODS - level: 4 - probability: 0.1 - Bane of the Anthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 - probability: 0.3 - Smite 1: - type: DAMAGE_UNDEAD - level: 1 - probability: 0.4 - Smite 2: - type: DAMAGE_UNDEAD - level: 2 - probability: 0.3 - Smite 3: - type: DAMAGE_UNDEAD - level: 3 - probability: 0.2 - Smite 4: - type: DAMAGE_UNDEAD - level: 4 - probability: 0.1 - Smite 5: - type: DAMAGE_UNDEAD - level: 5 - probability: 0.05 - Looting 1: - type: LOOT_BONUS_MOBS - level: 1 - probability: 0.5 - Looting 2: - type: LOOT_BONUS_MOBS - level: 2 - probability: 0.4 - Looting 3: - type: LOOT_BONUS_MOBS - level: 3 - probability: 0.3 - Smelt_Chiseled_Stone_Brick: - name: Smelt Chiseled Stone Brick - production_time: 64 - inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 32 - durability: 4 - Gravel: - material: GRAVEL - amount: 64 - outputs: - Chiseled Stone Brick: - material: SMOOTH_BRICK - amount: 64 - durability: 3 - Diamond_Pickaxe: - name: Forge Diamond Pickaxe. - production_time: 15 - inputs: - Diamond: - material: DIAMOND - amount: 15 - outputs: - Diamond Pickaxe: - material: DIAMOND_PICKAXE - amount: 15 - Smelt_Mossy_Stone_Brick: - name: Smelt Mossy Stone Brick - production_time: 64 - inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 32 - durability: 4 - Vine: - material: VINE - amount: 64 - outputs: - Mossy Stone Brick: - material: SMOOTH_BRICK - amount: 64 - durability: 1 - Dye_White_Wool_Magenta: - name: Dye White Wool Magenta - inputs: - White Wool: - material: WOOL - amount: 64 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Iron_Hoe: - name: Forge Iron Hoe. - production_time: 10 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 10 - outputs: - Iron Hoe: - material: IRON_HOE - amount: 30 - Dye_Pink_Wool_Gray: - name: Dye Pink Wool Gray - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Dye_Pink_Wool_Red: - name: Dye Pink Wool Red - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Wool: - material: WOOL - amount: 64 - durability: 14 - Dye_Black_Wool_Purple: - name: Dye Black Wool Purple - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Wool: - material: WOOL - amount: 64 - durability: 10 - Dye_Gray_Wool_Light_Blue: - name: Dye Gray Wool Light Blue - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Smelt_Coal: - name: Burn Coal - production_time: 24 - inputs: - Coal: - material: COAL - amount: 256 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Smelt_Charcoal: - name: Burn Charcoal - production_time: 24 - inputs: - Charcoal: - material: COAL - amount: 1024 - durability: 1 - outputs: - Coal: - material: COAL - amount: 128 - Gold_Axe: - name: Forge Gold Axe. - production_time: 15 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 15 - outputs: - Gold Axe: - material: GOLD_AXE - amount: 30 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.1 - Efficiency 1: - type: DIG_SPEED - level: 1 - probability: 0.3 - Efficiency 2: - type: DIG_SPEED - level: 2 - probability: 0.2 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.1 - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.05 - Efficiency 5: - type: DIG_SPEED - level: 5 - probability: 0.01 - Bane of the Anthropods 1: - type: DAMAGE_ARTHROPODS - level: 1 - probability: 0.4 - Bane of the Anthropods 2: - type: DAMAGE_ARTHROPODS - level: 2 - probability: 0.3 - Bane of the Anthropods 3: - type: DAMAGE_ARTHROPODS - level: 3 - probability: 0.2 - Bane of the Anthropods 4: - type: DAMAGE_ARTHROPODS - level: 4 - probability: 0.1 - Bane of the Anthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 - probability: 0.3 - Smite 1: - type: DAMAGE_UNDEAD - level: 1 - probability: 0.4 - Smite 2: - type: DAMAGE_UNDEAD - level: 2 - probability: 0.3 - Smite 3: - type: DAMAGE_UNDEAD - level: 3 - probability: 0.2 - Smite 4: - type: DAMAGE_UNDEAD - level: 4 - probability: 0.1 - Smite 5: - type: DAMAGE_UNDEAD - level: 5 - probability: 0.05 - Looting 1: - type: LOOT_BONUS_MOBS - level: 1 - probability: 0.5 - Looting 2: - type: LOOT_BONUS_MOBS - level: 2 - probability: 0.4 - Looting 3: - type: LOOT_BONUS_MOBS - level: 3 - probability: 0.3 - Cooked_Fish: - name: Grill Raw Fish - production_time: 6 - inputs: - Raw Fish: - material: RAW_FISH - amount: 64 - outputs: - Cooked Fish: - material: COOKED_FISH - amount: 256 - Dye_Pink_Wool_Black: - name: Dye Pink Wool Black - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Ink Sack: - material: INK_SACK - amount: 4 - outputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Diamond_Spade: - name: Forge Diamond Spade. - production_time: 5 - inputs: - Diamond: - material: DIAMOND - amount: 5 - outputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 15 - Dye_Pink_Wool_Yellow: - name: Dye Pink Wool Yellow - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Smelt_Iron_Ore: - name: Smelt Iron Ore - production_time: 12 - inputs: - Iron Ore: - material: IRON_ORE - amount: 128 - outputs: - Iron Ingot: - material: IRON_INGOT - amount: 256 - Produce_Powered_Rail: - name: Produce Powered Rails - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 72 - Redstone: - material: REDSTONE - amount: 8 - Stick: - material: STICK - amount: 8 - outputs: - Powered Rail: - material: POWERED_RAIL - amount: 128 - Produce_Detector_Rail: - name: Produce Detector Rails - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 18 - Redstone: - material: REDSTONE - amount: 2 - outputs: - Detector Rail: - material: DETECTOR_RAIL - amount: 32 - Produce_Activator_Rail: - name: Produce Activator Rails - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 18 - Redstone: - material: REDSTONE - amount: 2 - Stick: - material: STICK - amount: 8 - outputs: - Activator Rail: - material: ACTIVATOR_RAIL - amount: 32 - Produce_Minecarts: - name: Produce Minecarts - production_time: 16 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 64 - outputs: - Minecart: - material: MINECART - amount: 27 - Gold_Helmet: - name: Forge Gold Helmet. - production_time: 25 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 25 - outputs: - Gold Helmet: - material: GOLD_HELMET - amount: 15 - durability: -218 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Respiration 1: - type: OXYGEN - level: 1 - probability: 0.5 - Respiration 2: - type: OXYGEN - level: 2 - probability: 0.4 - Respiration 3: - type: OXYGEN - level: 3 - probability: 0.3 - Blast Protection 1: - type: PROTECTION_EXPLOSIONS - level: 1 - probability: 0.5 - Blast Protection 2: - type: PROTECTION_EXPLOSIONS - level: 2 - probability: 0.4 - Blast Protection 3: - type: PROTECTION_EXPLOSIONS - level: 3 - probability: 0.3 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.4 - Fire Protection 1: - type: PROTECTION_FIRE - level: 1 - probability: 0.5 - Fire Protection 2: - type: PROTECTION_FIRE - level: 2 - probability: 0.4 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.3 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.4 - Projectile Protection 1: - type: PROTECTION_PROJECTILE - level: 1 - probability: 0.5 - Projectile Protection 2: - type: PROTECTION_PROJECTILE - level: 2 - probability: 0.4 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.3 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.4 - Aqua Affinity 1: - type: WATER_WORKER - level: 1 - probability: 0.3 - Dye_Brown_Wool_Black: - name: Dye Brown Wool Black - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Ink Sack: - material: INK_SACK - amount: 4 - outputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Dye_Brown_Wool_Lime: - name: Dye Brown Wool Lime - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Gold_Boots: - name: Forge Gold Boots. - production_time: 20 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 20 - outputs: - Gold Boots: - material: GOLD_BOOTS - amount: 15 - durability: -218 - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - Blast Protection 1: - type: PROTECTION_EXPLOSIONS - level: 1 - probability: 0.5 - Blast Protection 2: - type: PROTECTION_EXPLOSIONS - level: 2 - probability: 0.4 - Blast Protection 3: - type: PROTECTION_EXPLOSIONS - level: 3 - probability: 0.3 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.4 - Feather Falling 1: - type: PROTECTION_FALL - level: 1 - probability: 0.5 - Feather Falling 2: - type: PROTECTION_FALL - level: 2 - probability: 0.4 - Feather Falling 3: - type: PROTECTION_FALL - level: 3 - probability: 0.3 - Feather Falling 4: - type: PROTECTION_FALL - level: 4 - probability: 0.4 - Fire Protection 1: - type: PROTECTION_FIRE - level: 1 - probability: 0.5 - Fire Protection 2: - type: PROTECTION_FIRE - level: 2 - probability: 0.4 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.3 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.4 - Projectile Protection 1: - type: PROTECTION_PROJECTILE - level: 1 - probability: 0.5 - Projectile Protection 2: - type: PROTECTION_PROJECTILE - level: 2 - probability: 0.4 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.3 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.4 - Depth Strider 1: - type: DEPTH_STRIDER - level: 1 - probability: 0.5 - Depth Strider 2: - type: DEPTH_STRIDER - level: 2 - probability: 0.4 - Depth Strider 3: - type: DEPTH_STRIDER - level: 3 - probability: 0.3 - Dye_Gray_Wool_Yellow: - name: Dye Gray Wool Yellow - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Wool: - material: WOOL - amount: 64 - durability: 4 - Dye_Pink_Wool_Lime: - name: Dye Pink Wool Lime - inputs: - Pink Wool: - material: WOOL - amount: 64 - durability: 6 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Dye_Gray_Wool_Magenta: - name: Dye Gray Wool Magenta - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Wool: - material: WOOL - amount: 64 - durability: 2 - Dye_Brown_Wool_Blue: - name: Dye Brown Wool Blue - inputs: - Brown Wool: - material: WOOL - amount: 64 - durability: 12 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Wool: - material: WOOL - amount: 64 - durability: 11 - Dye_Black_Wool_Lime: - name: Dye Black Wool Lime - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Wool: - material: WOOL - amount: 64 - durability: 5 - Smelt_Stone: - name: Smelt Stone - production_time: 80 - inputs: - Cobblestone: - material: COBBLESTONE - amount: 640 - outputs: - Stone: - material: STONE - amount: 854 - Grilled_Pork: - name: Grill Pork - production_time: 6 - inputs: - Pork: - material: PORK - amount: 64 - outputs: - Grilled Pork: - material: GRILLED_PORK - amount: 128 - Dye_Black_Wool_Light_Blue: - name: Dye Black Wool Light Blue - inputs: - Black Wool: - material: WOOL - amount: 64 - durability: 15 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Wool: - material: WOOL - amount: 64 - durability: 3 - Dye_Gray_Wool_White: - name: Dye Gray Wool White - inputs: - Gray Wool: - material: WOOL - amount: 64 - durability: 7 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Wool: - material: WOOL - amount: 64 - Diamond_Axe: - name: Forge Diamond Axe. - production_time: 15 - inputs: - Diamond: - material: DIAMOND - amount: 15 - outputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 30 - Smelt_Oak_Wood: - name: Burn Oak Wood - production_time: 24 - inputs: - Oak Wood: - material: LOG - amount: 256 - outputs: - Charcoal: - material: COAL - amount: 512 - durability: 1 - Produce_Saddle: - name: Produce Saddles - production_time: 20 - inputs: - Diamond: - material: DIAMOND - amount: 16 - Leather: - material: LEATHER - amount: 64 - White Wool: - material: WOOL - amount: 64 - outputs: - Saddle: - material: SADDLE - amount: 8 - Produce_Diamond_Horse_Armor: - name: Produce Diamond Horse Armor - production_time: 20 - inputs: - Diamond: - material: DIAMOND - amount: 64 - outputs: - Diamond Horse Armor: - material: DIAMOND_BARDING - amount: 1 - Produce_Gold_Horse_Armor: - name: Produce Gold Horse Armor - production_time: 20 - inputs: - Gold Ingot: - material: GOLD_INGOT - amount: 64 - outputs: - Gold Horse Armor: - material: GOLD_BARDING - amount: 1 - Produce_Iron_Horse_Armor: - name: Produce Iron Horse Armor - production_time: 20 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 64 - outputs: - Iron Horse Armor: - material: IRON_BARDING - amount: 1 - Produce_Leads: - name: Produce Leads - inputs: - Slime Ball: - material: SLIME_BALL - amount: 4 - String: - material: STRING - amount: 16 - outputs: - Lead: - material: LEASH - amount: 8 - Produce_Donkey_Chest: - name: Produce Donkey Chest - inputs: - Ender Chest: - material: ENDER_CHEST - amount: 8 - Saddle: - material: SADDLE - amount: 4 - outputs: - Donkey Double Chest: - material: CHEST - amount: 4 - lore: Donkey double chest - Craft_Fences: - name: Craft Oak Fences - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 12 - outputs: - Oak Fence: - material: FENCE - amount: 256 - Craft_Signs: - name: Craft Signs - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 8 - outputs: - Sign: - material: SIGN - amount: 64 - Craft_Boats: - name: Craft Boats - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 8 - outputs: - Boat: - material: BOAT - amount: 27 - Craft_Ladders: - name: Craft Ladders - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 8 - outputs: - Ladder: - material: LADDER - amount: 256 - Craft_Trap_Doors: - name: Craft Trap Doors - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 48 - outputs: - Trap Door: - material: TRAP_DOOR - amount: 256 - Craft_Item_Frames: - name: Craft Item Frames - production_time: 32 - inputs: - Chest: - material: CHEST - amount: 8 - Leather: - material: LEATHER - amount: 48 - outputs: - Item Frames: - material: ITEM_FRAME - amount: 64 - Craft_Bookshelfs: - name: Craft Bookshelfs - production_time: 32 - inputs: - Chest: - material: CHEST - amount: 8 - Leather: - material: LEATHER - amount: 48 - Paper: - material: PAPER - amount: 192 - outputs: - Bookshelf: - material: BOOKSHELF - amount: 64 - Forge_Shears: - name: Forge Shears - production_time: 8 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 18 - outputs: - Shears: - material: SHEARS - amount: 18 - Forge_Anvils: - name: Forge Anvils - production_time: 64 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 256 - outputs: - Anvil: - material: ANVIL - amount: 16 - Forge_Tripwire_Hooks: - name: Forge Tripwire Hooks - production_time: 16 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 16 - outputs: - Tripwire Hook: - material: TRIPWIRE_HOOK - amount: 64 - Forge_Iron_Bars: - name: Forge Iron Bars - production_time: 32 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 24 - outputs: - Iron Bars: - material: IRON_FENCE - amount: 256 - Forge_Buckets: - name: Forge Buckets - production_time: 32 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 96 - outputs: - Bucket: - material: BUCKET - amount: 64 - Forge_Iron_Doors: - name: Forge Iron Doors - production_time: 16 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 18 - outputs: - Iron Door: - material: IRON_DOOR - amount: 18 - Forge_Iron_Trapdoors: - name: Forge Iron Trapdoors - production_time: 16 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 54 - outputs: - Iron Trapdoor: - material: IRON_TRAPDOOR - amount: 36 - Forge_Flint_And_Steel: - name: Forge Flint and Steel - production_time: 8 - inputs: - Iron Ingot: - material: IRON_INGOT - amount: 9 - outputs: - Flint and Steel: - material: FLINT_AND_STEEL - amount: 18 - Dye_White_Stained_Glass: - name: Dye White Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 0 - Dye_Orange_Stained_Glass: - name: Dye Orange Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 1 - Dye_Magenta_Stained_Glass: - name: Dye Magenta Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 2 - Dye_Light_Blue_Stained_Glass: - name: Dye Light Blue Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 3 - Dye_Yellow_Stained_Glass: - name: Dye Yellow Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 4 - Dye_Lime_Stained_Glass: - name: Dye Lime Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 5 - Dye_Pink_Stained_Glass: - name: Dye Pink Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 6 - Dye_Gray_Stained_Glass: - name: Dye Gray Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 7 - Dye_Light_Gray_Stained_Glass: - name: Dye Light Gray Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 8 - Dye_Cyan_Stained_Glass: - name: Dye Cyan Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 9 - Dye_Purple_Stained_Glass: - name: Dye Purple Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 10 - Dye_Blue_Stained_Glass: - name: Dye Blue Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 11 - Dye_Brown_Stained_Glass: - name: Dye Brown Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Coco Beans: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 12 - Dye_Green_Stained_Glass: - name: Dye Green Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 13 - Dye_Red_Stained_Glass: - name: Dye Red Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 14 - Dye_Black_Stained_Glass: - name: Dye Black Stained Glass - inputs: - Glass: - material: GLASS - amount: 64 - Ink Sack: - material: INK_SACK - amount: 4 - durability: 0 - outputs: - Black Stained Glass: - material: STAINED_GLASS - amount: 64 - durability: 15 - Dye_White_Stained_Glass_Pane: - name: Dye White Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 0 - Dye_Orange_Stained_Glass_Pane: - name: Dye Orange Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 1 - Dye_Magenta_Stained_Glass_Pane: - name: Dye Magenta Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Magenta Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 2 - Dye_Light_Blue_Stained_Glass_Pane: - name: Dye Light Blue Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 3 - Dye_Yellow_Stained_Glass_Pane: - name: Dye Yellow Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Yellow Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 4 - Dye_Lime_Stained_Glass_Pane: - name: Dye Lime Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Lime Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 5 - Dye_Pink_Stained_Glass_Pane: - name: Dye Pink Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 6 - Dye_Gray_Stained_Glass_Pane: - name: Dye Gray Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 7 - Dye_Light_Gray_Stained_Glass_Pane: - name: Dye Light Gray Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 8 - Dye_Cyan_Stained_Glass_Pane: - name: Dye Cyan Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 9 - Dye_Purple_Stained_Glass_Pane: - name: Dye Purple Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 10 - Dye_Blue_Stained_Glass_Pane: - name: Dye Blue Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 11 - Dye_Brown_Stained_Glass_Pane: - name: Dye Brown Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Coco Beans: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 12 - Dye_Green_Stained_Glass_Pane: - name: Dye Green Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 13 - Dye_Red_Stained_Glass_Pane: - name: Dye Red Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 14 - Dye_Black_Stained_Glass_Pane: - name: Dye Black Stained Glass Pane - inputs: - Glass Pane: - material: THIN_GLASS - amount: 64 - Ink Sack: - material: INK_SACK - amount: 4 - durability: 0 - outputs: - Black Stained Glass Pane: - material: STAINED_GLASS_PANE - amount: 64 - durability: 15 - Dye_White_Stained_Clay: - name: Dye White Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Bone Meal: - material: INK_SACK - amount: 4 - durability: 15 - outputs: - White Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 0 - Dye_Orange_Stained_Clay: - name: Dye Orange Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Orange Dye: - material: INK_SACK - amount: 4 - durability: 14 - outputs: - Orange Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 1 - Dye_Magenta_Stained_Clay: - name: Dye Magenta Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Magenta Dye: - material: INK_SACK - amount: 4 - durability: 13 - outputs: - Hardened Clay: - material: STAINED_CLAY - amount: 64 - durability: 2 - Dye_Light_Blue_Stained_Clay: - name: Dye Light Blue Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Light Blue Dye: - material: INK_SACK - amount: 4 - durability: 12 - outputs: - Light Blue Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 3 - Dye_Yellow_Stained_Clay: - name: Dye Yellow Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Dandelion Yellow: - material: INK_SACK - amount: 4 - durability: 11 - outputs: - Hardened Clay: - material: STAINED_CLAY - amount: 64 - durability: 4 - Dye_Lime_Stained_Clay: - name: Dye Lime Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Lime Dye: - material: INK_SACK - amount: 4 - durability: 10 - outputs: - Hardened Clay: - material: STAINED_CLAY - amount: 64 - durability: 5 - Dye_Pink_Stained_Clay: - name: Dye Pink Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Pink Dye: - material: INK_SACK - amount: 4 - durability: 9 - outputs: - Pink Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 6 - Dye_Gray_Stained_Clay: - name: Dye Gray Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Gray Dye: - material: INK_SACK - amount: 4 - durability: 8 - outputs: - Gray Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 7 - Dye_Light_Gray_Stained_Clay: - name: Dye Light Gray Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Light Gray Dye: - material: INK_SACK - amount: 4 - durability: 7 - outputs: - Light Gray Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 8 - Dye_Cyan_Stained_Clay: - name: Dye Cyan Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Cyan Dye: - material: INK_SACK - amount: 4 - durability: 6 - outputs: - Cyan Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 9 - Dye_Purple_Stained_Clay: - name: Dye Purple Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Purple Dye: - material: INK_SACK - amount: 4 - durability: 5 - outputs: - Purple Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 10 - Dye_Blue_Stained_Clay: - name: Dye Blue Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Lapis Lazuli: - material: INK_SACK - amount: 4 - durability: 4 - outputs: - Blue Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 11 - Dye_Brown_Stained_Clay: - name: Dye Brown Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Coco Beans: - material: INK_SACK - amount: 4 - durability: 3 - outputs: - Brown Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 12 - Dye_Green_Stained_Clay: - name: Dye Green Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Cactus Green: - material: INK_SACK - amount: 4 - durability: 2 - outputs: - Green Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 13 - Dye_Red_Stained_Clay: - name: Dye Red Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Rose Red: - material: INK_SACK - amount: 4 - durability: 1 - outputs: - Red Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 14 - Dye_Black_Stained_Clay: - name: Dye Black Stained Clay - inputs: - Hardened Clay: - material: HARD_CLAY - amount: 64 - Ink Sack: - material: INK_SACK - amount: 4 - durability: 0 - outputs: - Black Stained Clay: - material: STAINED_CLAY - amount: 64 - durability: 15 - Mutate_Spruce_Saplings: - name: Mutate Spruce Saplings - production_time: 16 - inputs: - Oak Sapling: - material: SAPLING - amount: 64 - outputs: - Spruce Sapling: - material: SAPLING - amount: 64 - durability: 1 - Mutate_Birch_Saplings: - name: Mutate Birch Saplings - production_time: 16 - inputs: - Oak Sapling: - material: SAPLING - amount: 64 - outputs: - Birch Sapling: - material: SAPLING - amount: 64 - durability: 2 - Mutate_Jungle_Saplings: - name: Mutate Jungle Saplings - production_time: 16 - inputs: - Oak Sapling: - material: SAPLING - amount: 64 - outputs: - Jungle Sapling: - material: SAPLING - amount: 64 - durability: 3 - Mutate_Acacia_Saplings: - name: Mutate Acacia Saplings - production_time: 16 - inputs: - Oak Sapling: - material: SAPLING - amount: 64 - outputs: - Acacia Sapling: - material: SAPLING - amount: 64 - durability: 4 - Mutate_Dark_Oak_Saplings: - name: Mutate Dark Oak Saplings - production_time: 16 - inputs: - Oak Sapling: - material: SAPLING - amount: 64 - outputs: - Dark Oak Sapling: - material: SAPLING - amount: 64 - durability: 5 - Mutate_Grassless_Dirt: - name: Mutate Grassless Dirt - production_time: 16 - inputs: - Grass: - material: GRASS - amount: 64 - outputs: - Grassless Dirt: - material: DIRT - amount: 64 - durability: 1 - Mutate_Podzol: - name: Mutate Podzol - production_time: 16 - inputs: - Grass: - material: GRASS - amount: 64 - outputs: - Podzol: - material: DIRT - amount: 64 - durability: 2 - Mutate_Pigmen: - name: Mutate Pigmen - production_time: 4 - inputs: - Pig eggs: - material: MONSTER_EGG - durability: 90 - amount: 16 - Villager eggs: - material: MONSTER_EGG - durability: 120 - amount: 16 - outputs: - Pigman eggs: - material: MONSTER_EGG - durability: 57 - amount: 16 - Infect_Zombies: - name: Infect Zombies - production_time: 4 - inputs: - Villager eggs: - material: MONSTER_EGG - durability: 120 - amount: 16 - Rotten flesh: - material: ROTTEN_FLESH - amount: 512 - outputs: - Zombie eggs: - material: MONSTER_EGG - durability: 54 - amount: 8 - Mutate_Skeletons: - name: Mutate Skeletons - production_time: 4 - inputs: - Zombie eggs: - material: MONSTER_EGG - durability: 54 - amount: 16 - Bones: - material: BONE - amount: 256 - Blaze powder: - material: BLAZE_POWDER - amount: 64 - outputs: - Skeleton eggs: - material: MONSTER_EGG - durability: 51 - amount: 8 - Mutate_Creepers: - name: Mutate Creepers - production_time: 4 - inputs: - Skeleton eggs: - material: MONSTER_EGG - durability: 51 - amount: 16 - Blaze powder: - material: BLAZE_POWDER - amount: 32 - TNT: - material: TNT - amount: 16 - Lime wool: - material: WOOL - durability: 5 - amount: 32 - outputs: - Creeper eggs: - material: MONSTER_EGG - durability: 50 - amount: 8 - Mutate_Witches: - name: Mutate Witches - production_time: 32 - inputs: - Villager eggs: - material: MONSTER_EGG - durability: 120 - amount: 16 - Ghast tears: - material: GHAST_TEAR - amount: 16 - outputs: - Witch eggs: - material: MONSTER_EGG - durability: 66 - amount: 4 - Mutate_Spiders: - name: Mutate Spiders - production_time: 16 - inputs: - Squid eggs: # For the legs - material: MONSTER_EGG - durability: 94 - amount: 16 - Cow eggs: # For food - material: MONSTER_EGG - durability: 92 - amount: 16 - Spider eyes: - material: SPIDER_EYE - amount: 256 - outputs: - Spider eggs: - material: MONSTER_EGG - durability: 52 - amount: 4 - Mutate_Cave_Spiders: - name: Mutate Cave Spiders - production_time: 16 - inputs: - Spider eggs: - material: MONSTER_EGG - durability: 52 - amount: 16 - Poison potatoes: - material: POISONOUS_POTATO - amount: 128 - Spider eyes: - material: SPIDER_EYE - amount: 256 - outputs: - Cave spider eggs: - material: MONSTER_EGG - durability: 59 - amount: 8 - Mutate_Ghasts: - name: Mutate Ghasts - production_time: 32 - inputs: - Ghast tears: - material: GHAST_TEAR - amount: 8 - Fire charges: # Ammunition - material: FIREBALL - amount: 64 - Dispensers: # Fire! - material: DISPENSER - amount: 4 - White carpets: # To make a balloon - material: CARPET - amount: 256 - Furnaces: # To heat air - material: FURNACE - amount: 4 - Charcoal: # To fuel the furnace - material: COAL - durability: 1 - amount: 256 - Villager eggs: # Operator - material: MONSTER_EGG - durability: 120 - amount: 4 - outputs: - Ghast eggs: - material: MONSTER_EGG - durability: 56 - amount: 4 - Smelt_Diorite: - name: Smelt Diorite - production_time: 32 - inputs: - Cobblestone: - material: COBBLESTONE - amount: 1728 - Quartz: - material: QUARTZ - amount: 32 - outputs: - Diorite: - material: STONE - amount: 576 - durability: 3 - Smelt_Granite: - name: Smelt Granite - production_time: 32 - inputs: - Cobblestone: - material: COBBLESTONE - amount: 1728 - Quartz: - material: QUARTZ - amount: 64 - outputs: - Granite: - material: STONE - amount: 512 - durability: 1 - Smelt_Andesite: - name: Smelt Andesite - production_time: 32 - inputs: - Cobblestone: - material: COBBLESTONE - amount: 1728 - Quartz: - material: QUARTZ - amount: 32 - outputs: - Andesite: - material: STONE - amount: 512 - durability: 5 - Compact_Ice: - name: Compact Ice - production_time: 32 - inputs: - Ice: - material: ICE - amount: 576 - outputs: - Packed_Ice: - material: PACKED_ICE - amount: 576 - Bastion_Walls: - name: Walls - production_time: 2 - inputs: - Lapis Ore: - material: LAPIS_ORE - amount: 8 - Cracked Stone Brick: - material: SMOOTH_BRICK - amount: 32 - durability: 2 - outputs: - Walls: - material: INK_SACK - amount: 4 - durablity: 4 - display_name: Walls - lore: An item used to create a Bastion Block - Bastion_Base: - name: Base - production_time: 2 - inputs: - Diamond Ore: - material: DIAMOND_ORE - amount: 16 - Redstone Ore: - material: REDSTONE_ORE - amount: 32 - outputs: - Base: - material: IRON_INGOT - amount: 1 - display_name: Base - lore: An item used to create a Bastion Block - Bastion_Gearbox: - name: Gearbox - production_time: 2 - inputs: - Iron Block: - material: IRON_BLOCK - amount: 4 - Gold Ore: - material: GOLD_ORE - amount: 8 - outputs: - Gearbox: - material: WATCH - amount: 1 - display_name: Gearbox - lore: An item used to create a Bastion Block - Bastion_Objet_Dart: - name: Objet d'art - production_time: 2 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 16 - durability: 4 - Gray Dye: - material: INK_SACK - amount: 16 - durability: 8 - Cocoa: - material: INK_SACK - amount: 16 - durability: 3 - Purple Dye: - material: INK_SACK - amount: 16 - durability: 5 - Dandelion Yellow: - material: INK_SACK - amount: 16 - durability: 11 - Ink Sack: - material: INK_SACK - amount: 16 - durability: 0 - Magenta Dye: - material: INK_SACK - amount: 16 - durability: 13 - Pink Dye: - material: INK_SACK - amount: 16 - durability: 9 - Cyan Dye: - material: INK_SACK - amount: 16 - durability: 6 - Orange Dye: - material: INK_SACK - amount: 16 - durability: 14 - Cactus Green: - material: INK_SACK - amount: 16 - durability: 2 - Bone Meal: - material: INK_SACK - amount: 16 - durability: 15 - Light Gray Dye: - material: INK_SACK - amount: 16 - durability: 7 - Light Blue Dye: - material: INK_SACK - amount: 16 - durability: 12 - Rose Red: - material: INK_SACK - amount: 16 - durability: 1 - Lime Dye: - material: INK_SACK - amount: 16 - durability: 10 - Red Sand: - material: SAND - amount: 256 - durability: 1 - outputs: - Objet d'art: - material: FLINT - amount: 1 - display_name: Objet d'art - lore: An item used to create a Bastion Block - Bastion_Framing: - name: Framing - inputs: - Chest: - material: CHEST - amount: 64 - Iron Block: - material: IRON_BLOCK - amount: 4 - outputs: - Framing: - material: STICK - amount: 1 - display_name: Framing - lore: An item used to create a Bastion Block - Bastion_Flooring: - name: Flooring - inputs: - Clay Block: - material: CLAY - amount: 8 - Nether Brick: - material: NETHER_BRICK - amount: 64 - outputs: - Flooring: - material: CLAY_BRICK - amount: 1 - display_name: Flooring - lore: An item used to create a Bastion Block - Bastion_Rations: - name: Rations - inputs: - Wheat: - material: WHEAT - amount: 256 - Bowl: - material: BOWL - amount: 32 - outputs: - Rations: - material: MUSHROOM_SOUP - amount: 32 - display_name: Rations - lore: An item used to create a Bastion Block - Bastion_Smaragdus_Polisher: - name: Smaragdus - production_time: 32 - inputs: - Emerald Block: - material: EMERALD_BLOCK - amount: 16 - outputs: - Smaragdus: - material: EMERALD - amount: 16 - display_name: Smaragdus - lore: An item used to create a Bastion Block - Bastion_Silicon_Tetranitratobihydrotrioxycarbon: - name: Silicon_Tetranitratobihydrotrioxycarbon - inputs: - Sulphur: - material: SULPHUR - amount: 8 - Quartz: - material: QUARTZ - amount: 32 - Podzol: - material: DIRT - amount: 32 - durability: 2 - Coal Block: - material: COAL_BLOCK - amount: 8 - Water Bucket: - material: WATER_BUCKET - amount: 2 - outputs: - Silicon Tetranitratobihydrotrioxycarbon: - material: FIREWORK_CHARGE - amount: 8 - display_name: Silicon Tetranitratobihydrotrioxycarbon - lore: An item used to create a Bastion Block - Bastion_Pure_Ice: - name: Pure Ice - inputs: - Compact Ice: - material: PACKED_ICE - amount: 512 - Leather: - material: LEATHER - amount: 32 - outputs: - Pure Ice: - material: QUARTZ - amount: 8 - display_name: Pure Ice - lore: An item used to repair the Bastion Factory - Bastion_Block: - name: Craft Bastions - inputs: - Silicon Tetranitratobihydrotrioxycarbon: - material: FIREWORK_CHARGE - amount: 16 - display_name: Silicon Tetranitratobihydrotrioxycarbon - lore: An item used to create a Bastion Block - Smaragdus: - material: EMERALD - amount: 2 - display_name: Smaragdus - lore: An item used to create a Bastion Block - Rations: - material: MUSHROOM_SOUP - amount: 16 - display_name: Rations - lore: An item used to create a Bastion Block - Flooring: - material: CLAY_BRICK - amount: 1 - display_name: Flooring - lore: An item used to create a Bastion Block - Framing: - material: STICK - amount: 1 - display_name: Framing - lore: An item used to create a Bastion Block - Objet d'art: - material: FLINT - amount: 1 - display_name: Objet d'art - lore: An item used to create a Bastion Block - Gearbox: - material: WATCH - amount: 1 - display_name: Gearbox - lore: An item used to create a Bastion Block - Base: - material: IRON_INGOT - amount: 1 - display_name: Base - lore: An item used to create a Bastion Block - Walls: - material: INK_SACK - amount: 4 - durability: 0 - display_name: Walls - lore: An item used to create a Bastion Block - outputs: - Bastion: - material: SPONGE - amount: 32 - display_name: Bastion - Sequencing_Allium: - name: Sequencing Allium - inputs: - Poppy: - material: RED_ROSE - amount: 8 - Blue Orchid: - material: RED_ROSE - amount: 8 - durability: 1 - outputs: - Allium: - material: RED_ROSE - amount: 4 - durability: 2 - Sequencing_Sunflower: - name: Sequencing Sunflower - inputs: - Dandelion: - material: YELLOW_FLOWER - amount: 8 - Sugar Cane: - material: SUGAR_CANE - amount: 8 - outputs: - Sunflower: - material: DOUBLE_PLANT - amount: 4 - durability: 0 - Sequencing_Lilac: - name: Sequencing Lilac - inputs: - Poppy: - material: RED_ROSE - amount: 8 - Oak Sapling: - material: SAPLING - amount: 8 - outputs: - Lilac: - material: DOUBLE_PLANT - amount: 4 - durability: 1 - Sequencing_Double_Tallgrass: - name: Sequencing Double Tallgrass - inputs: - Grass: - material: LONG_GRASS - amount: 16 - durability: 1 - outputs: - Double Tallgrass: - material: DOUBLE_PLANT - amount: 4 - durability: 2 - Sequencing_Large_Fern: - name: Sequencing Large Fern - inputs: - Grass: - material: LONG_GRASS - amount: 16 - durability: 1 - outputs: - Large Fern: - material: DOUBLE_PLANT - amount: 4 - durability: 3 - Sequencing_Rose_Bush: - name: Sequencing Rose Bush - inputs: - Poppy: - material: RED_ROSE - amount: 8 - Cactus: - material: CACTUS - amount: 8 - outputs: - Rose Bush: - material: DOUBLE_PLANT - amount: 4 - durability: 4 - Sequencing_Peony: - name: Sequencing Peony - inputs: - Poppy: - material: RED_ROSE - amount: 8 - Oak Leaves: - material: LEAVES - amount: 8 - outputs: - Peony: - material: DOUBLE_PLANT - amount: 4 - durability: 5 - Forge_Aspect_of_Terra: - name: Forge Aspect of Terra - production_time: 64 - inputs: - Emerald Block: - material: EMERALD_BLOCK - amount: 24 - Diamond Block: - material: DIAMOND_BLOCK - amount: 24 - Gold Ore: - material: GOLD_ORE - amount: 8 - Slime Ball: - material: SLIME_BALL - amount: 8 - Anvil: - material: ANVIL - amount: 8 - outputs: - Aspect of Terra: - material: DIAMOND - amount: 1 - display_name: Aspect of Terra - lore: A concentrated essence of Terra - Forge_Aspect_of_End: - name: Forge Aspect of End - production_time: 64 - inputs: - Ender Pearl: - material: ENDER_PEARL - amount: 256 - Ender Chest: - material: ENDER_CHEST - amount: 256 - Endstone: - material: ENDER_STONE - amount: 1024 - outputs: - Aspect of End: - material: FLINT - amount: 1 - display_name: Aspect of End - lore: A concentrated essence of the End - Forge_Aspect_of_Nether: - name: Forge Aspect of Nether - production_time: 64 - inputs: - Ghast Tears: - material: GHAST_TEAR - amount: 16 - Quartz Ore: - material: QUARTZ_ORE - amount: 512 - Glowstone: - material: GLOWSTONE - amount: 512 - outputs: - Aspect of Nether: - material: MAGMA_CREAM - amount: 1 - display_name: Aspect of Nether - lore: A concentrated essence of the Nether - Craft_Eye_of_Ender: - name: Craft Eye of Ender - production_time: 1 - inputs: - Blaze Powder: - material: BLAZE_POWDER - amount: 256 - Ender Pearl: - material: ENDER_PEARL - amount: 256 - outputs: - Eye of Ender: - material: EYE_OF_ENDER - amount: 256 - Smelt_Prismarine: - name: Smelt Prismarine - production_time: 16 - inputs: - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 128 - outputs: - Prismarine: - material: PRISMARINE - amount: 64 - durability: 0 - Smelt_Prismarine_Bricks: - name: Smelt Prismarine Bricks - production_time: 16 - inputs: - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 288 - outputs: - Prismarine: - material: PRISMARINE - amount: 64 - durability: 1 - Smelt_Dark_Prismarine: - name: Smelt Dark Prismarine - production_time: 16 - inputs: - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 256 - Ink Sack: - material: INK_SACK - amount: 32 - durability: 0 - outputs: - Prismarine: - material: PRISMARINE - amount: 64 - durability: 2 - Craft_Sea_Lanterns: - name: Craft Sea Lanterns - production_time: 8 - inputs: - Prismarine Shard: - material: PRISMARINE_SHARD - amount: 32 - Prismarine Crystals: - material: PRISMARINE_CRYSTALS - amount: 64 - outputs: - Sea Lantern: - material: SEA_LANTERN - amount: 16 - Craft_Crate: - name: Craft Compactor Crates - production_time: 4 - inputs: - Chest: - material: CHEST - amount: 39 - 'Iron Ingot': - material: IRON_INGOT - amount: 4 - outputs: - Crate: - material: CHEST - amount: 54 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Oak_Bulk: - name: Craft Compactor Crates from Oak Logs - production_time: 43 - inputs: - Chest: - material: LOG - amount: 1248 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Birch_Bulk: - name: Craft Compactor Crates from Birch Logs - production_time: 43 - inputs: - Chest: - material: LOG - amount: 1248 - durability: 2 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Spruce_Bulk: - name: Craft Compactor Crates from Spruce Logs - production_time: 43 - inputs: - Chest: - material: LOG - amount: 1248 - durability: 1 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Dark_Oak_Bulk: - name: Craft Compactor Crates from Dark Oak Logs - production_time: 43 - inputs: - Chest: - material: LOG_2 - amount: 1248 - durability: 1 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Jungle_Bulk: - name: Craft Compactor Crates from Jungle Logs - production_time: 43 - inputs: - Chest: - material: LOG - amount: 1248 - durability: 3 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Craft_Crate_Acacia_Bulk: - name: Craft Compactor Crates from Acacia Logs - production_time: 43 - inputs: - Chest: - material: LOG_2 - amount: 1248 - 'Iron Ingot': - material: IRON_INGOT - amount: 64 - outputs: - Crate: - material: CHEST - amount: 864 - display_name: Crate - lore: A crate for compacting items - Enchant_Sharpness: - name: Enchant With Sharpness 5. - production_time: 10 - inputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 45 - outputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - enchantments: - Sharpness: - type: DAMAGE_ALL - level: 5 - Enchant_Fire_Aspect: - name: Enchant With Fire Aspect 2. - production_time: 10 - inputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 27 - outputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - enchantments: - Fire Aspect: - type: FIRE_ASPECT - level: 2 - Enchant_Looting: - name: Enchant With Looting 3. - production_time: 10 - inputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 31 - outputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 5 - enchantments: - Looting: - type: LOOT_BONUS_MOBS - level: 3 - Enchant_P4_Chest: - name: Enchant Chest with Prot 4 - production_time: 40 - inputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 40 - outputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 5 - enchantments: - Protection: - type: PROTECTION_ENVIRONMENTAL - level: 4 - Enchant_P4_Legs: - name: Enchant Legs with Prot 4 - production_time: 40 - inputs: - Diamond Legs: - material: DIAMOND_LEGGINGS - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 38 - outputs: - Diamond Legs: - material: DIAMOND_LEGGINGS - amount: 5 - enchantments: - Protection: - type: PROTECTION_ENVIRONMENTAL - level: 4 - Enchant_P4_Boots: - name: Enchant Boots with Prot 4 - production_time: 40 - inputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 32 - outputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 5 - enchantments: - Protection: - type: PROTECTION_ENVIRONMENTAL - level: 4 - Enchant_P4_Helmet: - name: Enchant Helmet with Prot 4 - production_time: 40 - inputs: - Diamond Helmet: - material: DIAMOND_HELMET - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 29 - outputs: - Diamond Helemt: - material: DIAMOND_HELMET - amount: 5 - enchantments: - Protection: - type: PROTECTION_ENVIRONMENTAL - level: 4 - Enchant_U3_Chest: - name: Enchant Chest with Unbreaking 3 - production_time: 40 - inputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 40 - outputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 5 - enchantments: - Unbreaking: - type: DURABILITY - level: 3 - Enchant_U3_Legs: - name: Enchant Legs with Unbreaking 3 - production_time: 40 - inputs: - Diamond Legs: - material: DIAMOND_LEGGINGS - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 38 - outputs: - Diamond Legs: - material: DIAMOND_LEGGINGS - amount: 5 - enchantments: - Unbreaking: - type: DURABILITY - level: 3 - Enchant_U3_Boots: - name: Enchant Boots with Unbreaking 3 - production_time: 40 - inputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 33 - outputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 5 - enchantments: - Unbreaking: - type: DURABILITY - level: 3 - Enchant_U3_Helmet: - name: Enchant Helmet with Unbreaking 3 - production_time: 40 - inputs: - Diamond Helmet: - material: DIAMOND_HELMET - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 29 - outputs: - Diamond Helemt: - material: DIAMOND_HELMET - amount: 5 - enchantments: - Unbreaking: - type: DURABILITY - level: 3 - Enchant_Picks_E5: - name: Enchant Pick with Efficiency 5 - production_time: 10 - inputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 32 - outputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - enchantments: - Efficiency: - type: DIG_SPEED - level: 5 - Enchant_Spades_E5: - name: Enchant Spade with Efficiency 5 - production_time: 10 - inputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 32 - outputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - enchantments: - Efficiency: - type: DIG_SPEED - level: 5 - Enchant_Axes_E5: - name: Enchant Axe with Efficiency 5 - production_time: 10 - inputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 32 - outputs: - Diamond Pick: - material: DIAMOND_AXE - amount: 5 - enchantments: - Efficiency: - type: DIG_SPEED - level: 5 - Enchant_Picks_U3: - name: Enchant Pick with Unbreaking 3 - production_time: 10 - inputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 35 - outputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - enchantments: - Efficiency: - type: DURABILITY - level: 3 - Enchant_Spades_U3: - name: Enchant Spade with Unbreaking 3 - production_time: 10 - inputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 35 - outputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - enchantments: - Efficiency: - type: DURABILITY - level: 3 - Enchant_Axes_U3: - name: Enchant Axe with Unbreaking 3 - production_time: 10 - inputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 35 - outputs: - Diamond Pick: - material: DIAMOND_AXE - amount: 5 - enchantments: - Efficiency: - type: DURABILITY - level: 3 - Enchant_Picks_S1: - name: Enchant Pick with Silk Touch - production_time: 10 - inputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 63 - outputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - enchantments: - Silk Touch: - type: SILK_TOUCH - level: 1 - Enchant_Spades_S1: - name: Enchant Spade with Silk Touch - production_time: 10 - inputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 63 - outputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - enchantments: - Silk Touch: - type: SILK_TOUCH - level: 1 - Enchant_Axes_S1: - name: Enchant Axe with Silk Touch - production_time: 10 - inputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 63 - outputs: - Diamond Pick: - material: DIAMOND_AXE - amount: 5 - enchantments: - Silk Touch: - type: SILK_TOUCH - level: 1 - Enchant_Picks_F3: - name: Enchant Pick with Fortune 3 - production_time: 10 - inputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 36 - outputs: - Diamond Pick: - material: DIAMOND_PICKAXE - amount: 5 - enchantments: - Fortune: - type: LOOT_BONUS_BLOCKS - level: 3 - Enchant_Spades_F3: - name: Enchant Spade with Fortune 3 - production_time: 10 - inputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 36 - outputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 5 - enchantments: - Fortune: - type: LOOT_BONUS_BLOCKS - level: 3 - Enchant_Axes_F3: - name: Enchant Axe with Fortune 3 - production_time: 10 - inputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 5 - Emerald Block: - material: EMERALD_BLOCK - amount: 36 - outputs: - Diamond Pick: - material: DIAMOND_AXE - amount: 5 - enchantments: - Fortune: - type: LOOT_BONUS_BLOCKS - level: 3 - Nether_Craft_Crate_of_Melons: - name: Craft Crate of Melons - production_time: 4 - inputs: - Melon Blocks: - material: MELON_BLOCK - amount: 1024 - outputs: - Crate of Melons: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Melons - lore: Crate of Melons - Nether_Craft_Crate_of_Fish: - name: Craft Crate of Fish - production_time: 4 - inputs: - Cooked Fish: - material: COOKED_FISH - amount: 1024 - outputs: - Crate of Fish: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Fish - lore: Crate of Fish - Nether_Craft_Crate_of_Sugar_Cane: - name: Craft Crate of Sugar Cane - production_time: 4 - inputs: - Sugar Cane: - material: SUGAR_CANE - amount: 1024 - outputs: - Crate of Sugar Cane: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Sugar Cane - lore: Crate of Sugar Cane - Nether_Craft_Crate_of_Nether_Warts: - name: Craft Crate of Nether Warts - production_time: 4 - inputs: - Nether Wart: - material: NETHER_STALK - amount: 1024 - outputs: - Crate of Nether Warts: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Nether Warts - lore: Crate of Nether Warts - Nether_Craft_Crate_of_Cookies: - name: Craft Crate of Cookies - production_time: 4 - inputs: - Cookie: - material: COOKIE - amount: 1024 - outputs: - Crate of Cookies: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cookies - lore: Crate of Cookies - Nether_Craft_Crate_of_Baked_Potatoes: - name: Craft Crate of Baked Potatoes - production_time: 4 - inputs: - Baked Potato: - material: BAKED_POTATO - amount: 1024 - outputs: - Crate of Potatoes: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Potatoes - lore: Crate of Potatoes - Nether_Craft_Crate_of_Carrots: - name: Craft Crate of Carrots - production_time: 4 - inputs: - Carrot: - material: CARROT_ITEM - amount: 1024 - outputs: - Crate of Carrots: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Carrots - lore: Crate of Carrots - Nether_Craft_Crate_of_Cocoa: - name: Craft Crate of Cocoa - production_time: 4 - inputs: - Cocoa: - material: INK_SACK - durability: 3 - amount: 1024 - outputs: - Crate of Cocoa: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cocoa - lore: Crate of Cocoa - Nether_Craft_Crate_of_Pumpkins: - name: Craft Crate of Pumpkins - production_time: 4 - inputs: - Pumpkin: - material: PUMPKIN - amount: 1024 - outputs: - Crate of Pumpkins: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Pumpkins - lore: Crate of Pumpkins - Nether_Craft_Crate_of_Cacti: - name: Craft Crate of Cacti - production_time: 4 - inputs: - Cactus: - material: CACTUS - amount: 1024 - outputs: - Crate of Cacti: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cacti - lore: Crate of Cacti - Nether_Craft_Crate_of_Bread: - name: Craft Crate of Bread - production_time: 4 - inputs: - Bread: - material: BREAD - amount: 1024 - outputs: - Crate of Bread: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Bread - lore: Crate of Bread - Nether_Craft_Crate_of_Wheat: - name: Craft Crate of Wheat - production_time: 4 - inputs: - Wheat: - material: WHEAT - amount: 1024 - outputs: - Crate of Bread: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Wheat - lore: Crate of Wheat - Nether_Craft_Crate_of_Grass: - name: Craft Crate of Grass - production_time: 4 - inputs: - Grass: - material: LONG_GRASS - amount: 1024 - durability: 1 - outputs: - Crate of Grass: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Grass - lore: Crate of Grass - Nether_Craft_Crate_of_Red_Rose: - name: Craft Crate of Red Rose - production_time: 4 - inputs: - Red Roses: - material: RED_ROSE - amount: 1024 - outputs: - Crate of Red Rose: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Red Rose - lore: Crate of Red Rose - Nether_Craft_Crate_of_Vine: - name: Craft Crate of Vine - production_time: 4 - inputs: - Vine: - material: VINE - amount: 1024 - outputs: - Crate of Vine: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Vine - lore: Crate of Vine - Nether_Craft_Crate_of_Brown_Mushrooms: - name: Craft Crate of Brown Mushrooms - production_time: 4 - inputs: - Brown Mushroom: - material: BROWN_MUSHROOM - amount: 1024 - outputs: - Crate of Brown Mushrooms: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Brown Mushrooms - lore: Crate of Brown Mushrooms - Nether_Craft_Crate_of_Red_Mushrooms: - name: Craft Crate of Red Mushrooms - production_time: 4 - inputs: - Red Mushroom: - material: RED_MUSHROOM - amount: 1024 - outputs: - Crate of Red Mushrooms: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Red Mushrooms - lore: Crate of Red Mushrooms - Nether_Craft_Crate_of_Yellow_Flower: - name: Craft Crate of Yellow Flower - production_time: 4 - inputs: - Yellow Flower: - material: YELLOW_FLOWER - amount: 1024 - outputs: - Crate of Yellow Flower: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Yellow Flower - lore: Crate of Yellow Flower - Nether_Craft_Crate_of_Glass_Bottles: - name: Craft Crate of Glass Bottles - production_time: 64 - inputs: - Sand: - material: SAND - amount: 512 - outputs: - Crate of Glass Bottles: - material: WOOD - durability: 0 - amount: 8 - display_name: Crate of Glass Bottles - lore: Crate of Glass Bottles - Nether_Craft_Crate_of_Acacia_Sapling: - name: Craft Crate of Acacia Sapling - production_time: 4 - inputs: - Acacia Sapling: - material: SAPLING - durability: 4 - amount: 1024 - outputs: - Crate of Acacia Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Acacia Sapling - lore: Crate of Acacia Sapling - Nether_Craft_Crate_of_Birch_Sapling: - name: Craft Crate of Birch Sapling - production_time: 4 - inputs: - Birch Sapling: - material: SAPLING - durability: 2 - amount: 1024 - outputs: - Crate of Birch Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Birch Sapling - lore: Crate of Birch Sapling - Nether_Craft_Crate_of_Dark_Oak_Sapling: - name: Craft Crate of Dark Oak Sapling - production_time: 4 - inputs: - Dark Oak Sapling: - material: SAPLING - durability: 5 - amount: 1024 - outputs: - Crate of Dark Oak Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Dark Oak Sapling - lore: Crate of Dark Oak Sapling - Nether_Craft_Crate_of_Grass_Blocks: - name: Craft Crate of Grass Blocks - production_time: 4 - inputs: - Grass Blocks: - material: GRASS - amount: 1024 - outputs: - Crate of Grass Blocks: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Grass Blocks - lore: Crate of Grass Blocks - Nether_Craft_Crate_of_Jungle_Sapling: - name: Craft Crate of Jungle Sapling - production_time: 4 - inputs: - Jungle Sapling: - material: SAPLING - durability: 3 - amount: 1024 - outputs: - Crate of Jungle Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Jungle Sapling - lore: Crate of Jungle Sapling - Nether_Craft_Crate_of_Oak_Sapling: - name: Craft Crate of Oak Sapling - production_time: 4 - inputs: - Oak Sapling: - material: SAPLING - durability: 0 - amount: 1024 - outputs: - Crate of Oak Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Oak Sapling - lore: Crate of Oak Sapling - Nether_Craft_Crate_of_Salmon: - name: Craft Crate of Salmon - production_time: 4 - inputs: - Cooked Salmon: - material: COOKED_FISH - durability: 1 - amount: 1024 - outputs: - Crate of Salmon: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Salmon - lore: Crate of Salmon - Nether_Craft_Crate_of_Spruce_Sapling: - name: Craft Crate of Spruce Sapling - production_time: 4 - inputs: - Spruce Sapling: - material: SAPLING - durability: 1 - amount: 1024 - outputs: - Crate of Spruce Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Spruce Sapling - lore: Crate of Spruce Sapling - Nether_Decraft_Crate_of_Melons: - name: Decraft Crate of Melons - production_time: 4 - inputs: - Crate of Melons: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Melons - lore: Crate of Melons - outputs: - Melon Blocks: - material: MELON_BLOCK - amount: 1024 - Nether_Decraft_Crate_of_Fish: - name: Decraft Crate of Fish - production_time: 4 - inputs: - Crate of Fish: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Fish - lore: Crate of Fish - outputs: - Cooked Fish: - material: COOKED_FISH - amount: 1024 - Nether_Decraft_Crate_of_Sugar_Cane: - name: Decraft Crate of Sugar Cane - production_time: 4 - inputs: - Crate of Sugar Cane: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Sugar Cane - lore: Crate of Sugar Cane - outputs: - Sugar Cane: - material: SUGAR_CANE - amount: 1024 - Nether_Decraft_Crate_of_Nether_Warts: - name: Decraft Crate of Nether Warts - production_time: 4 - inputs: - Crate of Nether Warts: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Nether Warts - lore: Crate of Nether Warts - outputs: - Nether Wart: - material: NETHER_STALK - amount: 1024 - Nether_Decraft_Crate_of_Cookies: - name: Decraft Crate of Cookies - production_time: 4 - inputs: - Crate of Cookies: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cookies - lore: Crate of Cookies - outputs: - Cookie: - material: COOKIE - amount: 1024 - Nether_Decraft_Crate_of_Baked_Potatoes: - name: Decraft Crate of Baked Potatoes - production_time: 4 - inputs: - Crate of Potatoes: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Potatoes - lore: Crate of Potatoes - outputs: - Baked Potato: - material: BAKED_POTATO - amount: 1024 - Nether_Decraft_Crate_of_Carrots: - name: Decraft Crate of Carrots - production_time: 4 - inputs: - Crate of Carrots: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Carrots - lore: Crate of Carrots - outputs: - Carrot: - material: CARROT_ITEM - amount: 1024 - Nether_Decraft_Crate_of_Cocoa: - name: Decraft Crate of Cocoa - production_time: 4 - inputs: - Crate of Cocoa: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cocoa - lore: Crate of Cocoa - outputs: - Cocoa: - material: INK_SACK - durability: 3 - amount: 1024 - Nether_Decraft_Crate_of_Pumpkins: - name: Decraft Crate of Pumpkins - production_time: 4 - inputs: - Crate of Pumpkins: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Pumpkins - lore: Crate of Pumpkins - outputs: - Pumpkin: - material: PUMPKIN - amount: 1024 - Nether_Decraft_Crate_of_Cacti: - name: Decraft Crate of Cacti - production_time: 4 - inputs: - Crate of Cacti: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Cacti - lore: Crate of Cacti - outputs: - Cactus: - material: CACTUS - amount: 1024 - Nether_Decraft_Crate_of_Bread: - name: Decraft Crate of Bread - production_time: 4 - inputs: - Crate of Bread: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Bread - lore: Crate of Bread - outputs: - Bread: - material: BREAD - amount: 1024 - Nether_Decraft_Crate_of_Wheat: - name: Decraft Crate of Wheat - production_time: 4 - inputs: - Crate of Wheat: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Wheat - lore: Crate of Wheat - outputs: - Wheat: - material: WHEAT - amount: 1024 - Nether_Decraft_Crate_of_Grass: - name: Decraft Crate of Grass - production_time: 4 - inputs: - Crate of Grass: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Grass - lore: Crate of Grass - outputs: - Grass: - material: LONG_GRASS - amount: 1024 - durability: 1 - Nether_Decraft_Crate_of_Red_Rose: - name: Decraft Crate of Red Rose - production_time: 4 - inputs: - Crate of Red Rose: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Red Rose - lore: Crate of Red Rose - outputs: - Red Roses: - material: RED_ROSE - amount: 1024 - Nether_Decraft_Crate_of_Vine: - name: Decraft Crate of Vine - production_time: 4 - inputs: - Crate of Vine: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Vine - lore: Crate of Vine - outputs: - Vine: - material: VINE - amount: 1024 - Nether_Decraft_Crate_of_Brown_Mushrooms: - name: Decraft Crate of Brown Mushrooms - production_time: 4 - inputs: - Crate of Brown Mushrooms: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Brown Mushrooms - lore: Crate of Brown Mushrooms - outputs: - Brown Mushroom: - material: BROWN_MUSHROOM - amount: 1024 - Nether_Decraft_Crate_of_Red_Mushrooms: - name: Decraft Crate of Red Mushrooms - production_time: 4 - inputs: - Crate of Red Mushrooms: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Red Mushrooms - lore: Crate of Red Mushrooms - outputs: - Red Mushroom: - material: RED_MUSHROOM - amount: 1024 - Nether_Decraft_Crate_of_Yellow_Flower: - name: Decraft Crate of Yellow Flower - production_time: 4 - inputs: - Crate of Yellow Flower: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Yellow Flower - lore: Crate of Yellow Flower - outputs: - Yellow Flower: - material: YELLOW_FLOWER - amount: 1024 - Nether_Decraft_Crate_of_Glass_Bottles: - name: Decraft Crate of Glass Bottles - production_time: 64 - inputs: - Crate of Glass Bottles: - material: WOOD - durability: 0 - amount: 8 - display_name: Crate of Glass Bottles - lore: Crate of Glass Bottles - outputs: - Sand: - material: SAND - amount: 512 - Nether_Decraft_Crate_of_Acacia_Sapling: - name: Decraft Crate of Acacia Sapling - production_time: 4 - inputs: - Crate of Acacia Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Acacia Sapling - lore: Crate of Acacia Sapling - outputs: - Acacia Sapling: - material: SAPLING - durability: 4 - amount: 1024 - Nether_Decraft_Crate_of_Birch_Sapling: - name: Decraft Crate of Birch Sapling - production_time: 4 - inputs: - Crate of Birch Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Birch Sapling - lore: Crate of Birch Sapling - outputs: - Birch Sapling: - material: SAPLING - durability: 2 - amount: 1024 - Nether_Decraft_Crate_of_Dark_Oak_Sapling: - name: Decraft Crate of Dark Oak Sapling - production_time: 4 - inputs: - Crate of Dark Oak Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Dark Oak Sapling - lore: Crate of Dark Oak Sapling - outputs: - Dark Oak Sapling: - material: SAPLING - durability: 5 - amount: 1024 - Nether_Decraft_Crate_of_Grass_Blocks: - name: Decraft Crate of Grass Blocks - production_time: 4 - inputs: - Crate of Grass Blocks: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Grass Blocks - lore: Crate of Grass Blocks - outputs: - Grass Blocks: - material: GRASS - amount: 1024 - Nether_Decraft_Crate_of_Jungle_Sapling: - name: Decraft Crate of Jungle Sapling - production_time: 4 - inputs: - Crate of Jungle Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Jungle Sapling - lore: Crate of Jungle Sapling - outputs: - Jungle Sapling: - material: SAPLING - durability: 3 - amount: 1024 - Nether_Decraft_Crate_of_Oak_Sapling: - name: Decraft Crate of Oak Sapling - production_time: 4 - inputs: - Crate of Oak Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Oak Sapling - lore: Crate of Oak Sapling - outputs: - Oak Sapling: - material: SAPLING - durability: 0 - amount: 1024 - Nether_Decraft_Crate_of_Salmon: - name: Decraft Crate of Salmon - production_time: 4 - inputs: - Crate of Salmon: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Salmon - lore: Crate of Salmon - outputs: - Cooked Salmon: - material: COOKED_FISH - durability: 1 - amount: 1024 - Nether_Decraft_Crate_of_Spruce_Sapling: - name: Decraft Crate of Spruce Sapling - production_time: 4 - inputs: - Crate of Spruce Sapling: - material: WOOD - durability: 0 - amount: 16 - display_name: Crate of Spruce Sapling - lore: Crate of Spruce Sapling - outputs: - Spruce Sapling: - material: SAPLING - durability: 1 - amount: 1024 - Create_Diamond_Axe: - name: Create Diamond Axe - production_time: 40 - inputs: - Diamond Axe: - material: DIAMOND_AXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Diamond Axe: - material: DIAMOND_AXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Diamond_Pickaxe: - name: Create Diamond Pickaxe - production_time: 40 - inputs: - Diamond Pickaxe: - material: DIAMOND_PICKAXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Diamond Pickaxe: - material: DIAMOND_PICKAXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Diamond_Spade: - name: Create Diamond Spade - production_time: 40 - inputs: - Diamond Spade: - material: DIAMOND_SPADE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Diamond Spade: - material: DIAMOND_SPADE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Iron_Axe: - name: Create Iron Axe - production_time: 40 - inputs: - Iron Axe: - material: IRON_AXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Axe: - material: IRON_AXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Iron_Pickaxe: - name: Create Iron Pickaxe - production_time: 40 - inputs: - Iron Pickaxe: - material: IRON_PICKAXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Pickaxe: - material: IRON_PICKAXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Iron_Spade: - name: Create Iron Spade - production_time: 40 - inputs: - Iron Spade: - material: IRON_SPADE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Spade: - material: IRON_SPADE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Wooden_Pickaxe: - name: Create Wooden Pickaxe - production_time: 40 - inputs: - Wooden Pickaxe: - material: WOOD_PICKAXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Wooden Pickaxe: - material: WOOD_PICKAXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Wooden_Spade: - name: Create Wooden Spade - production_time: 40 - inputs: - Wooden Spade: - material: WOOD_SPADE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Wooden Spade: - material: WOOD_SPADE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Wooden_Axe: - name: Create Wooden Axe - production_time: 40 - inputs: - Wooden Axe: - material: WOOD_AXE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Wooden Axe: - material: WOOD_AXE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Efficiency 4: - type: DIG_SPEED - level: 4 - probability: 0.1 - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.08 - Fortune 3: - type: LOOT_BONUS_BLOCKS - level: 3 - probability: 0.42 - Silk Touch 1: - type: SILK_TOUCH - level: 1 - probability: 0.02 - Efficiency 3: - type: DIG_SPEED - level: 3 - probability: 0.02 - Fortune 2: - type: LOOT_BONUS_BLOCKS - level: 2 - probability: 0.36 - Create_Fishing_Rod: - name: Create Fishing Rod - production_time: 40 - inputs: - Fishing Rod: - material: FISHING_ROD - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 1 - outputs: - Enchanted Fishing Rod: - material: FISHING_ROD - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.57 - Lure 2: - type: LURE - level: 2 - probability: 0.16 - Luck of the Sea 2: - type: LUCK - level: 2 - probability: 0.16 - Lure 3: - type: LURE - level: 3 - probability: 0.06 - Luck of the Sea 3: - type: LUCK - level: 3 - probability: 0.05 - Create_Bow: - name: Create Bow - production_time: 40 - inputs: - Bow: - material: BOW - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Bow: - material: BOW - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.16 - Power 4: - type: ARROW_DAMAGE - level: 4 - probability: 0.26 - Power 3: - type: ARROW_DAMAGE - level: 3 - probability: 0.18 - Flame 1: - type: ARROW_FIRE - level: 1 - probability: 0.12 - Punch 1: - type: ARROW_KNOCKBACK - level: 1 - probability: 0.07 - Infinity 1: - type: ARROW_INFINITE - level: 1 - probability: 0.06 - Punch 2: - type: ARROW_KNOCKBACK - level: 2 - probability: 0.05 - Create_Diamond_Sword: - name: Create Diamond Sword - production_time: 40 - inputs: - Diamond Sword: - material: DIAMOND_SWORD - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Diamond Sword: - material: DIAMOND_SWORD - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.27 - Knockback 2: - type: KNOCKBACK - level: 2 - probability: 0.26 - Sharpness 3: - type: DAMAGE_ALL - level: 3 - probability: 0.04 - Smite 4: - type: DAMAGE_UNDEAD - level: 4 - probability: 0.17 - Bane of Arthropods 4: - type: DAMAGE_ARTHROPODS - level: 4 - probability: 0.16 - Sharpness 4: - type: DAMAGE_ALL - level: 4 - probability: 0.03 - Fire Aspect 2: - type: FIRE_ASPECT - level: 2 - probability: 0.02 - Looting 3: - type: LOOT_BONUS_MOBS - level: 3 - probability: 0.0115 - Looting 2: - type: LOOT_BONUS_MOBS - level: 2 - probability: 0.007 - Smite 5: - type: DAMAGE_UNDEAD - level: 5 - probability: 0.012 - Bane of Arthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 - probability: 0.0105 - Fire Aspect 1: - type: FIRE_ASPECT - level: 1 - probability: 0.0075 - Bane of Arthropods 3: - type: DAMAGE_ARTHROPODS - level: 3 - probability: 0.003 - Smite 3: - type: DAMAGE_UNDEAD - level: 3 - probability: 0.003 - Create_Diamond_Leggings: - name: Create Diamond Leggings - production_time: 40 - inputs: - Diamond Leggings: - material: DIAMOND_LEGGINGS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 3 - outputs: - Enchanted Diamond Leggings: - material: DIAMOND_LEGGINGS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.16 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.26 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.18 - ProjectileProtection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.12 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.07 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.06 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.05 - Create_Diamond_Boots: - name: Create Diamond Boots - production_time: 40 - inputs: - Diamond Boots: - material: DIAMOND_BOOTS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 3 - outputs: - Enchanted Diamond Boots: - material: DIAMOND_BOOTS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.07 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Feather Falling 4: - type: PROTECTION_FALL - level: 4 - probability: 0.20 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.24 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.14 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.13 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Depth Strider 3: - type: DEPTH_STRIDER - level: 3 - probability: 0.05 - - Create_Diamond_Chestplate: - name: Create Diamond Chestplate - production_time: 40 - inputs: - Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 3 - outputs: - Enchanted Diamond Chestplate: - material: DIAMOND_CHESTPLATE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.04 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.27 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Thorns 2: - type: THORNS - level: 2 - probability: 0.19 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.18 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.12 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.12 - Thorn 1: - type: THORNS - level: 1 - probability: 0.01 - Create_Diamond_Helmet: - name: Create Diamond Helmet - production_time: 40 - inputs: - Diamond Helmet: - material: DIAMOND_HELMET - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 3 - outputs: - Enchanted Diamond Helmet: - material: DIAMOND_HELMET - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.06 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.19 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Aqua Affinity 1: - type: WATER_WORKER - level: 1 - probability: 0.18 - Respiration 3: - type: OXYGEN - level: 3 - probability: 0.17 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.13 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.10 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Respiration 2: - type: OXYGEN - level: 2 - probability: 0.01 - Create_Iron_Sword: - name: Create Iron Sword - production_time: 40 - inputs: - Iron Sword: - material: IRON_SWORD - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Sword: - material: IRON_SWORD - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.27 - Knockback 2: - type: KNOCKBACK - level: 2 - probability: 0.26 - Sharpness 3: - type: DAMAGE_ALL - level: 3 - probability: 0.04 - Smite 4: - type: DAMAGE_UNDEAD - level: 4 - probability: 0.17 - Bane of Arthropods 4: - type: DAMAGE_ARTHROPODS - level: 4 - probability: 0.16 - Sharpness 4: - type: DAMAGE_ALL - level: 4 - probability: 0.03 - Fire Aspect 2: - type: FIRE_ASPECT - level: 2 - probability: 0.02 - Looting 3: - type: LOOT_BONUS_MOBS - level: 3 - probability: 0.0115 - Looting 2: - type: LOOT_BONUS_MOBS - level: 2 - probability: 0.007 - Smite 5: - type: DAMAGE_UNDEAD - level: 5 - probability: 0.012 - Bane of Arthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 - probability: 0.0105 - Fire Aspect 1: - type: FIRE_ASPECT - level: 1 - probability: 0.0075 - Bane of Arthropods 3: - type: DAMAGE_ARTHROPODS - level: 3 - probability: 0.003 - Smite 3: - type: DAMAGE_UNDEAD - level: 3 - probability: 0.003 - Create_Iron_Leggings: - name: Create Iron Leggings - production_time: 40 - inputs: - Iron Leggings: - material: IRON_LEGGINGS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Leggings: - material: IRON_LEGGINGS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.16 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.26 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.18 - ProjectileProtection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.12 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.07 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.06 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.05 - Create_Iron_Boots: - name: Create Iron Boots - production_time: 40 - inputs: - Iron Boots: - material: IRON_BOOTS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Boots: - material: IRON_BOOTS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.07 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Feather Falling 4: - type: PROTECTION_FALL - level: 4 - probability: 0.25 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.24 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.14 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.13 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Create_Iron_Chestplate: - name: Create Iron Chestplate - production_time: 40 - inputs: - Iron Chestplate: - material: IRON_CHESTPLATE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Chestplate: - material: IRON_CHESTPLATE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.04 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.27 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Thorns 2: - type: THORNS - level: 2 - probability: 0.19 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.18 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.12 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.12 - Thorn 1: - type: THORNS - level: 1 - probability: 0.01 - Create_Iron_Helmet: - name: Create Iron Helmet - production_time: 40 - inputs: - Iron Helmet: - material: IRON_HELMET - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Iron Helmet: - material: IRON_HELMET - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.06 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.19 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Aqua Affinity 1: - type: WATER_WORKER - level: 1 - probability: 0.18 - Respiration 3: - type: OXYGEN - level: 3 - probability: 0.17 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.13 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.10 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Respiration 2: - type: OXYGEN - level: 2 - probability: 0.01 - Create_Wooden_Sword: - name: Create Wooden Sword - production_time: 40 - inputs: - Wooden Sword: - material: WOOD_SWORD - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 2 - outputs: - Enchanted Wooden Sword: - material: WOOD_SWORD - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.27 - Knockback 2: - type: KNOCKBACK - level: 2 - probability: 0.26 - Sharpness 3: - type: DAMAGE_ALL - level: 3 - probability: 0.04 - Smite 4: - type: DAMAGE_UNDEAD - level: 4 - probability: 0.17 - Bane of Arthropods 4: - type: DAMAGE_ARTHROPODS - level: 4 - probability: 0.16 - Sharpness 4: - type: DAMAGE_ALL - level: 4 - probability: 0.03 - Fire Aspect 2: - type: FIRE_ASPECT - level: 2 - probability: 0.02 - Looting 3: - type: LOOT_BONUS_MOBS - level: 3 - probability: 0.0115 - Looting 2: - type: LOOT_BONUS_MOBS - level: 2 - probability: 0.007 - Smite 5: - type: DAMAGE_UNDEAD - level: 5 - probability: 0.012 - Bane of Arthropods 5: - type: DAMAGE_ARTHROPODS - level: 5 - probability: 0.0105 - Fire Aspect 1: - type: FIRE_ASPECT - level: 1 - probability: 0.0075 - Bane of Arthropods 3: - type: DAMAGE_ARTHROPODS - level: 3 - probability: 0.003 - Smite 3: - type: DAMAGE_UNDEAD - level: 3 - probability: 0.003 - Create_Leather_Leggings: - name: Create Leather Leggings - production_time: 40 - inputs: - Leather Leggings: - material: LEATHER_LEGGINGS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 1 - outputs: - Enchanted Leather Leggings: - material: LEATHER_LEGGINGS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.16 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.26 - Projectile Protection 3: - type: PROTECTION_PROJECTILE - level: 3 - probability: 0.18 - ProjectileProtection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.12 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.07 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.06 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.05 - Create_Leather_Boots: - name: Create Leather Boots - production_time: 40 - inputs: - Leather Boots: - material: LEATHER_BOOTS - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 1 - outputs: - Enchanted Leather Boots: - material: LEATHER_BOOTS - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.07 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Feather Falling 4: - type: PROTECTION_FALL - level: 4 - probability: 0.25 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.24 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.14 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.13 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Create_Leather_Chestplate: - name: Create Leather Chestplate - production_time: 40 - inputs: - Leather Chestplate: - material: LEATHER_CHESTPLATE - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 1 - outputs: - Enchanted Leather Chestplate: - material: LEATHER_CHESTPLATE - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.04 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.27 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Thorns 2: - type: THORNS - level: 2 - probability: 0.19 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.18 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.12 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.12 - Thorn 1: - type: THORNS - level: 1 - probability: 0.01 - Create_Leather_Helmet: - name: Create Leather Helmet - production_time: 40 - inputs: - Leather Helmet: - material: LEATHER_HELMET - amount: 1 - Emerald Blocks: - material: EMERALD_BLOCK - amount: 1 - outputs: - Enchanted Leather Helmet: - material: LEATHER_HELMET - amount: 1 - enchantment_options: - safe_only: true - ensure_one: true - enchantments: - Unbreaking 3: - type: DURABILITY - level: 3 - probability: 0.06 - Protection 3: - type: PROTECTION_ENVIRONMENTAL - level: 3 - probability: 0.04 - Projectile Protection 4: - type: PROTECTION_PROJECTILE - level: 4 - probability: 0.19 - Protection 4: - type: PROTECTION_ENVIRONMENTAL - level: 4 - probability: 0.03 - Aqua Affinity 1: - type: WATER_WORKER - level: 1 - probability: 0.18 - Respiration 3: - type: OXYGEN - level: 3 - probability: 0.17 - Fire Protection 3: - type: PROTECTION_FIRE - level: 3 - probability: 0.13 - Fire Protection 4: - type: PROTECTION_FIRE - level: 4 - probability: 0.10 - Blast Protection 4: - type: PROTECTION_EXPLOSIONS - level: 4 - probability: 0.10 - Respiration 2: - type: OXYGEN - level: 2 - probability: 0.01 - Wood_XP_0: - name: Wood XP Factory 1 - production_time: 80 - inputs: - Ender Pearls: - material: ENDER_PEARL - amount: 2 - Hay Bales: - material: HAY_BLOCK - amount: 3 - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 4 - Wood_XP_1: - name: Wood XP Factory 2 - production_time: 80 - inputs: - Endstone: - material: ENDER_STONE - amount: 16 - Nether Wart: - material: NETHER_STALK - amount: 25 - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 4 - Wood_XP_2: - name: Wood XP Factory 3 - production_time: 80 - inputs: - Carrot: - material: CARROT_ITEM - amount: 64 - Soul Sand: - material: SOUL_SAND - amount: 64 - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 4 - Wood_XP_3: - name: Wood XP Factory 4 - production_time: 80 - inputs: - Glowstone: - material: GLOWSTONE - amount: 16 - Potatoes: - material: POTATO_ITEM - amount: 64 - Glass Bottle: - material: GLASS_BOTTLE - amount: 4 - outputs: - XP Bottles: - material: EXP_BOTTLE - amount: 4 - Emerald_XP_0: - name: Emerald XP Block 1 - inputs: - Compacted Glass Bottles: - material: GLASS_BOTTLE - amount: 96 - lore: Compacted Item - Compacted Carrots: - material: CARROT_ITEM - amount: 256 - lore: Compacted Item - Compacted Sugar Cane: - material: SUGAR_CANE - amount: 16 - lore: Compacted Item - Compacted Bread: - material: BREAD - amount: 64 - lore: Compacted Item - Compacted Grass Blocks: - material: GRASS - amount: 64 - lore: Compacted Item - Compacted Brown Mushrooms: - material: BROWN_MUSHROOM - amount: 64 - lore: Compacted Item - Compacted Cocoa: - material: INK_SACK - durability: 3 - amount: 32 - lore: Compacted Item - Compacted Melons: - material: MELON_BLOCK - amount: 2 - lore: Compacted Item - Compacted Yellow Flowers: - material: YELLOW_FLOWER - amount: 16 - lore: Compacted Item - Compacted Oak Sapling: - material: SAPLING - amount: 4 - lore: Compacted Item - Compacted Jungle Sapling: - material: SAPLING - durability: 3 - amount: 3 - lore: Compacted Item - Compacted Acacia Sapling: - material: SAPLING - durability: 4 - amount: 6 - lore: Compacted Item - outputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 84 - Emerald_XP_1: - name: Emerald XP Block 2 - inputs: - Compacted Glass Bottles: - material: GLASS_BOTTLE - amount: 96 - lore: Compacted Item - Compacted Cacti: - material: CACTUS - amount: 16 - lore: Compacted Item - Compacted Wheat: - material: WHEAT - amount: 192 - lore: Compacted Item - Compacted Pumpkins: - material: PUMPKIN - amount: 8 - lore: Compacted Item - Compacted Grass: - material: LONG_GRASS - durability: 1 - amount: 64 - lore: Compacted Item - Compacted Cocoa: - material: INK_SACK - durability: 3 - amount: 32 - lore: Compacted Item - Compacted Red Mushrooms: - material: RED_MUSHROOM - amount: 64 - lore: Compacted Item - Compacted Cooked Fish: - material: COOKED_FISH - amount: 8 - lore: Compacted Item - Compacted Cooked Salmon: - material: COOKED_FISH - durability: 1 - amount: 4 - lore: Compacted Item - Compacted Red Rose: - material: RED_ROSE - amount: 8 - lore: Compacted Item - Compacted Spruce Sapling: - material: SAPLING - durability: 1 - amount: 5 - lore: Compacted Item - Compacted Dark Oak Sapling: - material: SAPLING - durability: 5 - amount: 2 - lore: Compacted Item - outputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 84 - Emerald_XP_2: - name: Emerald XP Block 3 - inputs: - Compacted Glass Bottles: - material: GLASS_BOTTLE - amount: 96 - lore: Compacted Item - Compacted Cookies: - material: COOKIE - amount: 384 - lore: Compacted Item - Compacted Baked Potatoes: - material: BAKED_POTATO - amount: 256 - lore: Compacted Item - Compacted Sugar Cane: - material: SUGAR_CANE - amount: 12 - lore: Compacted Item - Compacted Pumpkins: - material: PUMPKIN - amount: 8 - lore: Compacted Item - Compacted Nether Warts: - material: NETHER_STALK - amount: 64 - lore: Compacted Item - Compacted Vine: - material: VINE - amount: 64 - lore: Compacted Item - Compacted Melons: - material: MELON_BLOCK - amount: 2 - lore: Compacted Item - Compacted Red Mushrooms: - material: RED_MUSHROOM - amount: 64 - lore: Compacted Item - Compacted Yellow Flower: - material: YELLOW_FLOWER - amount: 16 - lore: Compacted Item - Compacted Grass Blocks: - material: GRASS - amount: 16 - lore: Compacted Item - Compacted Birch Sapling: - material: SAPLING - durability: 2 - amount: 4 - lore: Compacted Item - outputs: - Emerald Blocks: - material: EMERALD_BLOCK - amount: 84 - Refine_Diamond_Ore: - name: Refine Diamond Ore - production_time: 16 - inputs: - Diamond Ore: - material: DIAMOND_ORE - amount: 256 - outputs: - Diamond Block: - material: DIAMOND_BLOCK - amount: 100 - Refine_Coal_Ore: - name: Refine Coal Ore - production_time: 8 - inputs: - Coal Ore: - material: COAL_ORE - amount: 768 - outputs: - Coal Block: - material: COAL_BLOCK - amount: 336 - Refine_Iron_Ore: - name: Refine Iron Ore - production_time: 16 - inputs: - Iron Ore: - material: IRON_ORE - amount: 768 - outputs: - Iron Block: - material: IRON_BLOCK - amount: 234 - Refine_Gold_Ore: - name: Refine Gold Ore - production_time: 8 - inputs: - Gold Ore: - material: GOLD_ORE - amount: 128 - outputs: - Gold Block: - material: GOLD_BLOCK - amount: 228 - Refine_Lapis_Lazuli_Ore: - name: Refine Lapis Lazuli Ore - production_time: 8 - inputs: - Lapis Ore: - material: LAPIS_ORE - amount: 128 - outputs: - Lapis Lazuli: - material: LAPIS_BLOCK - amount: 420 - Refine_Redstone_Ore: - name: Refine Redstone Ore - production_time: 8 - inputs: - Redstone Ore: - material: REDSTONE_ORE - amount: 256 - outputs: - Redstone Block: - material: REDSTONE_BLOCK - amount: 400 - Refine_Netherquartz_Ore: - name: Refine Netherquartz ore - production_time: 8 - inputs: - Netherquartz ore: - material: QUARTZ_ORE - amount: 256 - outputs: - Quartz: - material: QUARTZ - amount: 1536 From f55b098f8d2fd2e9d37d820b6e052e33180cee3d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 11 Dec 2015 00:23:10 +0100 Subject: [PATCH 176/459] updating pom --- pom.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f729d94f..55318dac 100644 --- a/pom.xml +++ b/pom.xml @@ -40,13 +40,19 @@ vg.civcraft.mc.namelayer NameLayer - 2.1.1 + 2.5.13 provided vg.civcraft.mc.citadel Citadel - 3.0.12-40 + 3.3.9 + provided + + + vg.civcraft.mc.civmodcore + CivModCore + [1.0.8] provided @@ -61,4 +67,4 @@ http://build.civcraft.co:8080/plugin/repository/everything/ - + \ No newline at end of file From a037169bcfdb2b32f1adcacf59b95c48c87e2a65 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 11 Dec 2015 01:10:55 +0100 Subject: [PATCH 177/459] Complete config parsing --- .../igotyou/FactoryMod/ConfigParser.java | 115 ++++++++++++++++-- .../igotyou/FactoryMod/FactoryModManager.java | 2 +- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- 3 files changed, 110 insertions(+), 9 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 2e50424f..69fb501d 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -1,6 +1,7 @@ package com.github.igotyou.FactoryMod; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -15,12 +16,21 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; +import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; +import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; +import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.google.common.collect.Lists; public class ConfigParser { private FactoryModPlugin plugin; + private HashMap recipes; + private FactoryModManager manager; public ConfigParser(FactoryModPlugin plugin) { this.plugin = plugin; @@ -35,22 +45,71 @@ public FactoryModManager parse() { .getString("factory_interaction_material", "STICK")); boolean disableExperience = config.getBoolean("disable_experience", false); - //TODO disable experience + // TODO disable experience boolean disableNether = config.getBoolean("disable_nether"); if (disableNether) { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } int defaultUpdateTime = config.getInt("default_update_time"); - FactoryModManager manager = new FactoryModManager(plugin, - factoryInteractionMaterial, citadelEnabled); + manager = new FactoryModManager(plugin, factoryInteractionMaterial, + citadelEnabled); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); - + parseRecipes(config.getConfigurationSection("recipes")); + parseFactories(config.getConfigurationSection("factories"), + defaultUpdateTime); + plugin.info("Parsed complete config"); return manager; } - public void handleEnabledAndDisabledRecipes(ConfigurationSection config) { + private void parseRecipes(ConfigurationSection config) { + recipes = new HashMap(); + for (String key : config.getKeys(false)) { + IRecipe recipe = parseRecipe(config.getConfigurationSection(key)); + recipes.put(recipe.getRecipeName(), recipe); + } + } + + private void parseFactories(ConfigurationSection config, int defaultUpdate) { + for (String key : config.getKeys(false)) { + parseFactory(config.getConfigurationSection(key), defaultUpdate); + } + + } + + private void parseFactory(ConfigurationSection config, int defaultUpdate) { + String name = config.getString("name"); + // One implementation for each egg here + switch (config.getString("type")) { + case "FCC": // Furnace, chest, craftingtable + int update; + if (config.contains("updatetime")) { + update = config.getInt("updatetime"); + } else { + update = defaultUpdate; + } + List recipeList = new LinkedList(); + for (String recipe : config.getStringList("recipes")) { + recipeList.add(recipes.get(recipe)); + } + ItemMap fuel = parseItemMap(config.getConfigurationSection("fuel")); + int fuelIntervall = config.getInt("fuel_consumption_intervall"); + ItemMap setupCost = parseItemMap(config + .getConfigurationSection("setupcost")); + FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, + recipeList, fuel, fuelIntervall); + manager.addFactoryEgg(FurnCraftChestStructure.class, setupCost, egg); + break; + + default: + plugin.severe("Could not identify factory type " + + config.getString("type")); + } + + } + + private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { // Disabling recipes List toDisable = new ArrayList(); ItemMap disabledRecipes = parseItemMap(config @@ -80,10 +139,52 @@ public void handleEnabledAndDisabledRecipes(ConfigurationSection config) { } // TODO enable shaped and unshaped recipes here + } + private IRecipe parseRecipe(ConfigurationSection config) { + IRecipe result; + String name = config.getString("name"); + int productionTime = config.getInt("production_time"); + switch (config.getString("type")) { + case "PRODUCTION": + ItemMap input = parseItemMap(config + .getConfigurationSection("input")); + ItemMap output = parseItemMap(config + .getConfigurationSection("output")); + result = new ProductionRecipe(name, productionTime, input, output); + break; + case "COMPACT": + ItemMap extraMats = parseItemMap(config + .getConfigurationSection("input")); + String compactedLore = config.getString("compact_lore"); + List excluded = new LinkedList(); + for (String mat : config.getStringList("excluded_materials")) { + excluded.add(Material.valueOf(mat)); + } + result = new CompactingRecipe(extraMats, excluded, name, + productionTime, compactedLore); + break; + case "DECOMPACT": + ItemMap extraMate = parseItemMap(config + .getConfigurationSection("input")); + String decompactedLore = config.getString("compact_lore"); + result = new DecompactingRecipe(extraMate, name, productionTime, + decompactedLore); + break; + case "REPAIR": + ItemMap rep = parseItemMap(config.getConfigurationSection("input")); + int health = config.getInt("health_gained"); + result = new RepairRecipe(name, productionTime, rep, health); + break; + default: + plugin.severe("Could not identify type " + config.getString("type") + + " as a valid recipe identifier"); + result = null; + } + return result; } - public ItemMap parseItemMap(ConfigurationSection config) { + private static ItemMap parseItemMap(ConfigurationSection config) { ItemMap result = new ItemMap(); for (String key : config.getKeys(false)) { ConfigurationSection current = config.getConfigurationSection(key); @@ -120,7 +221,7 @@ public ItemMap parseItemMap(ConfigurationSection config) { return result; } - private List parsePotionEffects( + private static List parsePotionEffects( ConfigurationSection configurationSection) { List potionEffects = Lists.newArrayList(); if (configurationSection != null) { diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 1f971508..299cdc9b 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -121,7 +121,7 @@ public void attemptCreation(Block b, Player p) { } } - public void addFactoryEgg(Class blockStructureClass, + public void addFactoryEgg(Class blockStructureClass, ItemMap recipe, IFactoryEgg egg) { HashMap eggs = factoryCreationRecipes .get(blockStructureClass); diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 7c73b1ef..d506f124 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -18,7 +18,7 @@ public class FurnCraftChestEgg implements IFactoryEgg { private String name; private int updateTime; - protected List recipes; + private List recipes; private ItemMap fuel; private int fuelConsumptionIntervall; From 5d61a85c81520aa5b8d5c9da67425a78c56bb27e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 11 Dec 2015 01:53:52 +0100 Subject: [PATCH 178/459] Minor fixes and dummy config --- config.yml | 43 +++++++++++++++++++ .../igotyou/FactoryMod/ConfigParser.java | 8 +++- .../igotyou/FactoryMod/FactoryModManager.java | 1 + .../igotyou/FactoryMod/FactoryModPlugin.java | 3 ++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index e69de29b..a9ae89b5 100644 --- a/config.yml +++ b/config.yml @@ -0,0 +1,43 @@ +#FactoryMod configuration file + +citadel_enabled: true +factory_interaction_material: STICK +disable_nether: true +default_update_time: 4 + +crafting: + disabled: + dirt: + material: DIRT + + enabled: + + +recipes: + test1: + type: PRODUCTION + input: + stone: + material: STONE + amount: 64 + output: + cobble: + material: DIRT + amount: 43 + name: TestRecipe1 + production_time: 200 + +factories: + test2: + type: FCC + recipes: + - TestRecipe1 + fuel: + char: + material: COAL + durability: 1 + fuel_consumption_intervall: 10 + setupcost: + dirt: + material: DIRT + amount: 64 diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 69fb501d..2ff728e1 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -46,12 +46,12 @@ public FactoryModManager parse() { boolean disableExperience = config.getBoolean("disable_experience", false); // TODO disable experience - boolean disableNether = config.getBoolean("disable_nether"); + boolean disableNether = config.getBoolean("disable_nether", false); if (disableNether) { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } - int defaultUpdateTime = config.getInt("default_update_time"); + int defaultUpdateTime = config.getInt("default_update_time", 4); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled); handleEnabledAndDisabledRecipes(config @@ -106,6 +106,7 @@ private void parseFactory(ConfigurationSection config, int defaultUpdate) { plugin.severe("Could not identify factory type " + config.getString("type")); } + plugin.info("Parsed factory "+name); } @@ -181,6 +182,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { + " as a valid recipe identifier"); result = null; } + plugin.info("Parsed recipe "+name); return result; } @@ -190,6 +192,8 @@ private static ItemMap parseItemMap(ConfigurationSection config) { ConfigurationSection current = config.getConfigurationSection(key); Material m = Material.valueOf(current.getString("material")); ItemStack toAdd = new ItemStack(m); + int amount = current.getInt("amount"); + toAdd.setAmount(amount); int durability = current.getInt("durability", 0); toAdd.setDurability((short) durability); ItemMeta im = toAdd.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 299cdc9b..4dfb5480 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -113,6 +113,7 @@ public void attemptCreation(Block b, Player p) { Factory f = egg.hatch(fccs, p); if (f != null) { addFactory(f); + p.sendMessage("Successfully created "+f.getName()); } } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 3cacc6e4..9f5cb14d 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,5 +1,7 @@ package com.github.igotyou.FactoryMod; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; + import vg.civcraft.mc.civmodcore.ACivMod; public class FactoryModPlugin extends ACivMod { @@ -11,6 +13,7 @@ public void onEnable() { plugin = this; ConfigParser cp = new ConfigParser(this); manager = cp.parse(); + MultiBlockStructure.initiliazeBlockSides(); } public void onDisable() { From 34f4fe531037ba666881a447324b6df7d0c662cd Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 11 Dec 2015 18:08:02 +0100 Subject: [PATCH 179/459] Starting to fix tons of bugs --- config.yml | 1 + .../igotyou/FactoryMod/FactoryModManager.java | 21 +++++++++++++------ .../igotyou/FactoryMod/FactoryModPlugin.java | 2 ++ .../FactoryMod/eggs/FurnCraftChestEgg.java | 4 ++-- .../factories/FurnCraftChestFactory.java | 3 ++- .../FurnCraftChestInteractionManager.java | 6 ++++-- .../listeners/FactoryModListener.java | 3 ++- .../FurnCraftChestStructure.java | 6 ++++-- .../igotyou/FactoryMod/utility/ItemMap.java | 11 ++++++++++ 9 files changed, 43 insertions(+), 14 deletions(-) diff --git a/config.yml b/config.yml index a9ae89b5..29b6077d 100644 --- a/config.yml +++ b/config.yml @@ -30,6 +30,7 @@ recipes: factories: test2: type: FCC + name: smelter recipes: - TestRecipe1 fuel: diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 4dfb5480..b41399cf 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -3,9 +3,11 @@ import java.util.HashMap; import java.util.HashSet; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.Chest; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; @@ -96,7 +98,7 @@ public Factory getFactoryAt(Block b) { } public boolean factoryExistsAt(Location loc) { - return getFactoryAt(loc) == null; + return getFactoryAt(loc) != null; } public void attemptCreation(Block b, Player p) { @@ -107,27 +109,34 @@ public void attemptCreation(Block b, Player p) { HashMap eggs = factoryCreationRecipes .get(FurnCraftChestStructure.class); if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap((Inventory) (fccs - .getChest().getState()))); + IFactoryEgg egg = eggs.get(new ItemMap(((Chest) (fccs + .getChest().getState())).getBlockInventory())); if (egg != null) { Factory f = egg.hatch(fccs, p); if (f != null) { addFactory(f); - p.sendMessage("Successfully created "+f.getName()); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); } + } else { + p.sendMessage(ChatColor.RED + + "There is no factory with the given creation materials"); } } + } else { + p.sendMessage(ChatColor.RED + "This is no complete factory"); } } } - public void addFactoryEgg(Class blockStructureClass, - ItemMap recipe, IFactoryEgg egg) { + public void addFactoryEgg(Class blockStructureClass, ItemMap recipe, + IFactoryEgg egg) { HashMap eggs = factoryCreationRecipes .get(blockStructureClass); if (eggs == null) { eggs = new HashMap(); + this.factoryCreationRecipes.put(blockStructureClass, eggs); } eggs.put(recipe, egg); this.eggs.put(egg.getName(), egg); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index 9f5cb14d..d7699426 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -1,5 +1,6 @@ package com.github.igotyou.FactoryMod; +import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import vg.civcraft.mc.civmodcore.ACivMod; @@ -14,6 +15,7 @@ public void onEnable() { ConfigParser cp = new ConfigParser(this); manager = cp.parse(); MultiBlockStructure.initiliazeBlockSides(); + plugin.getServer().getPluginManager().registerEvents(new FactoryModListener(manager),plugin); } public void onDisable() { diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index d506f124..86082752 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -39,7 +39,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( 100); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, - fpm, fccs, updateTime, name); + fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); fpm.setFactory(fccf); if (recipes.size() != 0) { @@ -60,7 +60,7 @@ public Factory revive(List blocks, int health, String selectedRecipe) { PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( health); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, - fpm, fccs, updateTime, name); + fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); fpm.setFactory(fccf); for (IRecipe recipe : recipes) { diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 02aa015e..d05719d0 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -33,9 +33,10 @@ public class FurnCraftChestFactory extends Factory { public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, - String name) { + String name, List recipes) { super(im, rm, ipm, mbs, updateTime, name); this.active = false; + this.recipes = recipes; } /** diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 647011d0..bc74dccb 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -48,17 +48,19 @@ public void blockBreak(Player p, Block b) { public void leftClick(Player p, Block b) { if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getChest()) { // chest interaction + System.out.println("chest hit"); // TODO Display information return; } if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getCraftingTable()) { // crafting table interaction + System.out.println("craft hit"); ArrayList clickables = new ArrayList(); for (IRecipe rec : fccf.getRecipes()) { + System.out.println(rec.getRecipeName()); InputRecipe recipe = (InputRecipe) (rec); - Clickable c = new Clickable(recipe.getOutputRepresentation( - fccf.getInventory()).get(0)) { + Clickable c = new Clickable(recipe.getRecipeRepresentation()) { @Override public void clicked(Player p) { diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index b7122c0f..b8be04c0 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -94,10 +94,11 @@ public void burnListener(BlockBurnEvent e) { } } + @EventHandler public void playerInteract(PlayerInteractEvent e) { Block block = e.getClickedBlock(); Player player = e.getPlayer(); - if (manager.isPossibleInteractionBlock(block.getType()) + if (block != null && manager.isPossibleInteractionBlock(block.getType()) && player.getItemInHand().getType() == manager.getFactoryInteractionMaterial()) { Factory c = manager.getFactoryAt(block); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java index 8485bd58..07e537c4 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -24,9 +24,11 @@ public FurnCraftChestStructure(List blocks) { } public boolean isComplete() { - return CraftingTable.getType() == Material.WORKBENCH + return CraftingTable != null + && CraftingTable.getType() == Material.WORKBENCH + && Furnace != null && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) - && Chest.getType() == Material.CHEST; + && Chest != null && Chest.getType() == Material.CHEST; } public void initializeBlocks(Block center) { diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 46272b61..f024347d 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -44,6 +44,7 @@ public ItemMap(Inventory inv) { * ItemStack to start with */ public ItemMap(ItemStack is) { + items = new HashMap(); addItemStack(is); } @@ -54,6 +55,7 @@ public ItemMap(ItemStack is) { * Stacks to add to the map */ public ItemMap(Collection stacks) { + items = new HashMap(); addAll(stacks); } @@ -126,6 +128,15 @@ public void removeAll(Collection stacks, boolean safe) { removeItemStack(stack, safe); } } + + + public int hashCode() { + int res = 0; + for(Entry entry:items.entrySet()) { + res += entry.hashCode(); + } + return res; + } /** * Adds all the stacks given in the collection to this map From 8e16ff162a39ef78967b8eedf42d739ad4a0c301 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 12 Dec 2015 02:43:03 +0100 Subject: [PATCH 180/459] More bugfixes, slowly getting there --- .../igotyou/FactoryMod/ConfigParser.java | 2 +- .../igotyou/FactoryMod/FactoryModManager.java | 2 +- .../factories/FurnCraftChestFactory.java | 30 +++++++++---------- .../FurnCraftChestInteractionManager.java | 25 +++++++++------- .../MultiBlockStructure.java | 2 +- .../igotyou/FactoryMod/utility/ItemMap.java | 17 +++++++---- 6 files changed, 44 insertions(+), 34 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 2ff728e1..8d29ac5e 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -192,7 +192,7 @@ private static ItemMap parseItemMap(ConfigurationSection config) { ConfigurationSection current = config.getConfigurationSection(key); Material m = Material.valueOf(current.getString("material")); ItemStack toAdd = new ItemStack(m); - int amount = current.getInt("amount"); + int amount = current.getInt("amount", 1); toAdd.setAmount(amount); int durability = current.getInt("durability", 0); toAdd.setDurability((short) durability); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index b41399cf..115c242e 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -110,7 +110,7 @@ public void attemptCreation(Block b, Player p) { .get(FurnCraftChestStructure.class); if (eggs != null) { IFactoryEgg egg = eggs.get(new ItemMap(((Chest) (fccs - .getChest().getState())).getBlockInventory())); + .getChest().getState())).getInventory())); if (egg != null) { Factory f = egg.hatch(fccs, p); if (f != null) { diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index d05719d0..f484a1a9 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -2,6 +2,7 @@ import java.util.List; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Chest; @@ -44,7 +45,7 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, * should be */ public Inventory getInventory() { - if (!(getFurnace().getType() == Material.CHEST)) { + if (!(getChest().getType() == Material.CHEST)) { return null; } Chest chestBlock = (Chest) (getChest().getState()); @@ -72,24 +73,30 @@ public void attemptToActivate(Player p) { if (rm.inDisrepair() && !(currentRecipe instanceof RepairRecipe)) { if (p != null) { - p.sendMessage("This factory is in disrepair, you have to repair it before using it"); + p.sendMessage(ChatColor.RED + + "This factory is in disrepair, you have to repair it before using it"); } return; } if (p != null) { - p.sendMessage("Activated " + name + " with recipe: " + p.sendMessage(ChatColor.GREEN + "Activated " + name + + " with recipe: " + currentRecipe.getRecipeName()); } activate(); run(); } else { if (p != null) { - p.sendMessage("Failed to activate factory, there is no fuel in the furnace"); + p.sendMessage(ChatColor.RED + + "Failed to activate factory, there is no fuel in the furnace"); } } - } - else { - p.sendMessage("Not enough materials available"); //TODO how much is needed + } else { + p.sendMessage(ChatColor.RED + "Not enough materials available"); // TODO + // how + // much + // is + // needed } } } @@ -147,13 +154,6 @@ public Block getChest() { return ((FurnCraftChestStructure) mbs).getChest(); } - /** - * @return Whether the factory is currently on or not - */ - public boolean getActive() { - return active; - } - /** * @return How long the factory has been running in ticks */ @@ -177,7 +177,7 @@ public void run() { if (pm.powerAvailable()) { // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed - if (pm.getPowerCounter() == pm + if (pm.getPowerCounter() >= pm .getPowerConsumptionIntervall() - 1) { // remove one fuel. pm.consumePower(); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index bc74dccb..c0df9133 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -32,9 +32,9 @@ public FurnCraftChestInteractionManager() { public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } - + public void redStoneEvent(BlockRedstoneEvent e) { - //TODO + // TODO } public void blockBreak(Player p, Block b) { @@ -43,22 +43,22 @@ public void blockBreak(Player p, Block b) { p.sendMessage(ChatColor.DARK_RED + "You broke the factory, it is in disrepair now"); } + if (fccf.isActive()) { + fccf.deactivate(); + } } public void leftClick(Player p, Block b) { - if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getChest()) { // chest interaction - System.out.println("chest hit"); + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getChest())) { // chest interaction // TODO Display information return; } - if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getCraftingTable()) { // crafting table interaction - System.out.println("craft hit"); + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getCraftingTable())) { // crafting table interaction ArrayList clickables = new ArrayList(); for (IRecipe rec : fccf.getRecipes()) { - System.out.println(rec.getRecipeName()); InputRecipe recipe = (InputRecipe) (rec); Clickable c = new Clickable(recipe.getRecipeRepresentation()) { @@ -69,6 +69,9 @@ public void clicked(Player p) { + "You can't switch recipes while the factory is running"); } else { fccf.setRecipe(recipes.get(this)); + p.sendMessage(ChatColor.GREEN + + "Switched recipe to " + + recipes.get(this).getRecipeName()); } } @@ -81,8 +84,8 @@ public void clicked(Player p) { ci.showInventory(p); return; } - if (b == ((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getFurnace()) { // furnace interaction + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getFurnace())) { // furnace interaction if (fccf.isActive()) { fccf.deactivate(); } else { diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java index 8384f79e..1cb21a54 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -24,7 +24,7 @@ public static void initiliazeBlockSides() { } - protected static List searchForBlockOnSides(Block b, Material m) { + public static List searchForBlockOnSides(Block b, Material m) { LinkedList result = new LinkedList(); for (BlockFace face : northEastWestSouthSides) { Block side = b.getRelative(face); diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index f024347d..aec73a16 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -128,15 +128,14 @@ public void removeAll(Collection stacks, boolean safe) { removeItemStack(stack, safe); } } - - + public int hashCode() { int res = 0; - for(Entry entry:items.entrySet()) { + for (Entry entry : items.entrySet()) { res += entry.hashCode(); } - return res; - } + return res; + } /** * Adds all the stacks given in the collection to this map @@ -409,6 +408,14 @@ public boolean isContainedIn(ItemMap im) { return true; } + public String toString() { + String res = ""; + for (ItemStack is : getItemStackRepresentation()) { + res += is.toString() + ";"; + } + return res; + } + /** * Checks how often this ItemMap is contained in the given ItemMap or how * often this ItemMap could be removed from the given one before creating From 694ffa0c448d01f364d797603cf5ab6f5f1cd5d5 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 14 Dec 2015 01:47:36 +0100 Subject: [PATCH 181/459] Last bug fixes and starting to document everything --- .../igotyou/FactoryMod/ConfigParser.java | 74 +++++++++- .../igotyou/FactoryMod/FactoryModManager.java | 139 +++++++++++++++--- .../factories/FurnCraftChestFactory.java | 58 ++++++-- .../FurnCraftChestInteractionManager.java | 80 +++++++++- .../FactoryMod/recipes/CompactingRecipe.java | 13 +- .../recipes/DecompactingRecipe.java | 17 +-- .../igotyou/FactoryMod/recipes/IRecipe.java | 47 ++++-- .../FactoryMod/recipes/InputRecipe.java | 52 ++++++- .../FactoryMod/recipes/ProductionRecipe.java | 21 ++- .../FactoryMod/recipes/RepairRecipe.java | 18 +-- .../repairManager/IRepairManager.java | 25 +++- .../igotyou/FactoryMod/utility/ItemMap.java | 28 +++- 12 files changed, 481 insertions(+), 91 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 8d29ac5e..1eb6d8c1 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -36,6 +36,12 @@ public ConfigParser(FactoryModPlugin plugin) { this.plugin = plugin; } + /** + * Parses the whole config and creates a manager containing everything that + * was parsed from the config + * + * @return manager with everything contained in the config + */ public FactoryModManager parse() { plugin.saveDefaultConfig(); plugin.reloadConfig(); @@ -63,6 +69,13 @@ public FactoryModManager parse() { return manager; } + /** + * Parses all recipes and sorts them into a hashmap by their name so they + * are ready to assign them to factories + * + * @param config + * ConfigurationSection containing the recipe configurations + */ private void parseRecipes(ConfigurationSection config) { recipes = new HashMap(); for (String key : config.getKeys(false)) { @@ -71,6 +84,16 @@ private void parseRecipes(ConfigurationSection config) { } } + /** + * Parses all factories + * + * @param config + * ConfigurationSection to parse the factories from + * @param defaultUpdate + * default intervall in ticks how often factories update, each + * factory can choose to define an own value or to use the + * default instead + */ private void parseFactories(ConfigurationSection config, int defaultUpdate) { for (String key : config.getKeys(false)) { parseFactory(config.getConfigurationSection(key), defaultUpdate); @@ -78,6 +101,17 @@ private void parseFactories(ConfigurationSection config, int defaultUpdate) { } + /** + * Parses a single factory and turns it into a factory egg which is add to + * the manager + * + * @param config + * ConfigurationSection to parse the factory from + * @param defaultUpdate + * default intervall in ticks how often factories update, each + * factory can choose to define an own value or to use the + * default instead + */ private void parseFactory(ConfigurationSection config, int defaultUpdate) { String name = config.getString("name"); // One implementation for each egg here @@ -106,10 +140,16 @@ private void parseFactory(ConfigurationSection config, int defaultUpdate) { plugin.severe("Could not identify factory type " + config.getString("type")); } - plugin.info("Parsed factory "+name); + plugin.info("Parsed factory " + name); } + /** + * Disables and enables crafting recipes as specified in the config + * + * @param config + * ConfigurationSection to parse from + */ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { // Disabling recipes List toDisable = new ArrayList(); @@ -142,6 +182,13 @@ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { // TODO enable shaped and unshaped recipes here } + /** + * Parses a single recipe + * + * @param config + * ConfigurationSection to parse the recipe from + * @return The recipe created based on the data parse + */ private IRecipe parseRecipe(ConfigurationSection config) { IRecipe result; String name = config.getString("name"); @@ -158,6 +205,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { ItemMap extraMats = parseItemMap(config .getConfigurationSection("input")); String compactedLore = config.getString("compact_lore"); + manager.setCompactLore(compactedLore); List excluded = new LinkedList(); for (String mat : config.getStringList("excluded_materials")) { excluded.add(Material.valueOf(mat)); @@ -182,12 +230,23 @@ private IRecipe parseRecipe(ConfigurationSection config) { + " as a valid recipe identifier"); result = null; } - plugin.info("Parsed recipe "+name); + plugin.info("Parsed recipe " + name); return result; } + /** + * Creates an itemmap containing all the items listed in the given config + * section + * + * @param config + * ConfigurationSection to parse the items from + * @return The item map created + */ private static ItemMap parseItemMap(ConfigurationSection config) { ItemMap result = new ItemMap(); + if (config == null) { + return result; + } for (String key : config.getKeys(false)) { ConfigurationSection current = config.getConfigurationSection(key); Material m = Material.valueOf(current.getString("material")); @@ -207,7 +266,7 @@ private static ItemMap parseItemMap(ConfigurationSection config) { loreList.add(lore); im.setLore(loreList); } - if (config.contains("enchants")) { + if (current.contains("enchants")) { for (String enchantKey : current.getConfigurationSection( "enchants").getKeys(false)) { ConfigurationSection enchantConfig = current @@ -215,7 +274,7 @@ private static ItemMap parseItemMap(ConfigurationSection config) { .getConfigurationSection(enchantKey); Enchantment enchant = Enchantment.getByName(enchantConfig .getString("enchant")); - int level = enchantConfig.getInt("level"); + int level = enchantConfig.getInt("level", 1); im.addEnchant(enchant, level, true); } } @@ -225,6 +284,13 @@ private static ItemMap parseItemMap(ConfigurationSection config) { return result; } + /** + * Parses a potion effect + * + * @param configurationSection + * ConfigurationSection to parse the effect from + * @return The potion effect parsed + */ private static List parsePotionEffects( ConfigurationSection configurationSection) { List potionEffects = Lists.newArrayList(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 115c242e..d5c3ef25 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -9,19 +9,22 @@ import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Manager class which handles all factories, their locations and their creation + * + */ public class FactoryModManager { - protected FactoryModPlugin plugin; private HashMap, HashMap> factoryCreationRecipes; - private HashMap> locations; + private HashMap locations; private HashMap eggs; + private HashSet factories; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; @@ -35,10 +38,11 @@ public FactoryModManager(FactoryModPlugin plugin, this.citadelEnabled = citadelEnabled; factoryCreationRecipes = new HashMap, HashMap>(); - locations = new HashMap>(); + locations = new HashMap(); eggs = new HashMap(); possibleCenterBlocks = new HashSet(); possibleInteractionBlock = new HashSet(); + factories = new HashSet(); // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); @@ -48,59 +52,111 @@ public FactoryModManager(FactoryModPlugin plugin, possibleInteractionBlock.add(Material.CHEST); } + /** + * Sets the lore used for compacting recipes. This is needed for the compact + * item listeners + * + * @param lore + * Lore used for compacting items + */ public void setCompactLore(String lore) { compactLore = lore; } + /** + * @return Lore given to compacted items + */ public String getCompactLore() { return compactLore; } + /** + * Adds a factory and the locations of its blocks to the manager + * + * @param f + * Factory to add + */ public void addFactory(Factory f) { + factories.add(f); for (Block b : f.getMultiBlockStructure().getAllBlocks()) { - HashMap forThatMaterial = locations.get(b - .getType()); - if (forThatMaterial == null) { - forThatMaterial = new HashMap(); - locations.put(b.getType(), forThatMaterial); - } - forThatMaterial.put(b.getLocation(), f); + locations.put(b.getLocation(), f); } } + /** + * @return Whether citadel is enabled on the server + */ public boolean isCitadelEnabled() { return citadelEnabled; } + /** + * @return Which material is used to interact with factories, stick by + * default + */ public Material getFactoryInteractionMaterial() { return factoryInteractionMaterial; } + /** + * Removes a factory from the manager + * + * @param f + * Factory to remove + */ public void removeFactory(Factory f) { + factories.remove(f); for (Block b : f.getMultiBlockStructure().getAllBlocks()) { - HashMap forThatMaterial = locations.get(b - .getType()); - forThatMaterial.remove(b.getLocation()); + locations.remove(b.getLocation()); } } + /** + * Tries to get the factory which has a part at the given location + * + * @param loc + * Location which is supposed to be part of a factory + * @return The factory which had a block at the given location or null if + * there was no factory + */ public Factory getFactoryAt(Location loc) { return getFactoryAt(loc.getBlock()); } + /** + * Tries to get the factory which has a part at the given block + * + * @param b + * Block which is supposed to be part of a factory + * @return The factory which had a block at the given location or null if + * there was no factory + */ public Factory getFactoryAt(Block b) { - HashMap forThisType = locations.get(b.getType()); - if (forThisType == null) { - return null; - } else { - return forThisType.get(b.getLocation()); - } + return locations.get(b.getLocation()); } + /** + * Checks whether a part of a factory is at the given location + * + * @param loc + * Location to check + * @return True if there is a factory block, false if not + */ public boolean factoryExistsAt(Location loc) { return getFactoryAt(loc) != null; } + /** + * Attempts to create a factory with the given block as new center block. If + * all blocks for a specific structure are there and other conditions needed + * for the factory type are fullfilled, the factory is created and added to + * the manager + * + * @param b + * Center block + * @param p + * Player attempting to create the factory + */ public void attemptCreation(Block b, Player p) { if (!factoryExistsAt(b.getLocation())) { // Cycle through possible structures here @@ -114,6 +170,8 @@ public void attemptCreation(Block b, Player p) { if (egg != null) { Factory f = egg.hatch(fccs, p); if (f != null) { + ((Chest) (fccs.getChest().getState())) + .getInventory().clear(); addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); @@ -130,6 +188,20 @@ public void attemptCreation(Block b, Player p) { } } + /** + * Adds a factory egg to the manager and associates it with a specific setup + * cost in items and a specific MultiBlockStructure which is the physical + * representation of the factory created by the egg. See the docu for the + * eggs for more info on those + * + * @param blockStructureClass + * Class inheriting from MultiBlockStructure, which physically + * represents the factories created by the egg + * @param recipe + * Item cost to create the factory + * @param egg + * Encapsulates the factory itself + */ public void addFactoryEgg(Class blockStructureClass, ItemMap recipe, IFactoryEgg egg) { HashMap eggs = factoryCreationRecipes @@ -142,14 +214,41 @@ public void addFactoryEgg(Class blockStructureClass, ItemMap recipe, this.eggs.put(egg.getName(), egg); } + /** + * Checks whether a specific material is a possible center block for a + * factory and whether a factory could potentionally created from a block + * with this material + * + * @param m + * Material to check + * @return true if the material could be the one of a possible center block, + * false if not + */ public boolean isPossibleCenterBlock(Material m) { return possibleCenterBlocks.contains(m); } + /** + * Checks whether the given material is an interaction material and whether + * a reaction should be tried to get when one of those blocks is part of a + * factory and interacted with + * + * @param m + * Material to check + * @return True if the material is a possible interaction material, false if + * not + */ public boolean isPossibleInteractionBlock(Material m) { return possibleInteractionBlock.contains(m); } + /** + * Gets a specific factory egg based on it's name + * + * @param name + * Name of the egg + * @return The egg with the given name or null if no such egg exists + */ public IFactoryEgg getEgg(String name) { return eggs.get(name); } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index f484a1a9..5b9cfc6a 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -65,6 +65,10 @@ public FurnaceInventory getFurnaceInventory() { return furnaceBlock.getInventory(); } + /** + * Attempts to turn the factory on and does all the checks needed to ensure + * that the factory is allowed to turn on + */ public void attemptToActivate(Player p) { // TODO Citadel stuff if (mbs.isComplete()) { @@ -78,6 +82,13 @@ public void attemptToActivate(Player p) { } return; } + if (currentRecipe instanceof RepairRecipe + && rm.atFullHealth()) { + if (p != null) { + p.sendMessage("This factory is already at full health!"); + return; + } + } if (p != null) { p.sendMessage(ChatColor.GREEN + "Activated " + name + " with recipe: " @@ -92,17 +103,18 @@ public void attemptToActivate(Player p) { } } } else { - p.sendMessage(ChatColor.RED + "Not enough materials available"); // TODO - // how - // much - // is - // needed + if (p != null) { + p.sendMessage(ChatColor.RED + + "Not enough materials available"); + } } } } /** - * Turns the factory on + * Actually turns the factory on, never use this directly unless you know + * what you are doing, use attemptToActivate() instead to ensure the factory + * is allowed to turn on */ public void activate() { // lots of code to make the furnace light up, without loosing contents. @@ -146,10 +158,16 @@ public void deactivate() { } } + /** + * @return The furnace of this factory + */ public Block getFurnace() { return ((FurnCraftChestStructure) mbs).getFurnace(); } + /** + * @return The chest of this factory + */ public Block getChest() { return ((FurnCraftChestStructure) mbs).getChest(); } @@ -162,7 +180,7 @@ public int getRunningTime() { } /** - * called by the manager each update cycle + * Called by the manager each update cycle */ public void run() { if (active && mbs.isComplete()) { @@ -184,12 +202,12 @@ public void run() { // 0 seconds since last fuel consumption pm.setPowerCounter(0); } - // if we don't need to consume fuel, just increment the + // if we don't need to consume fuel, just increase the // energy timer else { pm.increasePowerCounter(updateTime); } - // increment the production timer + // increase the production timer currentProductionTimer += updateTime; // schedule next update FactoryModPlugin @@ -210,7 +228,7 @@ public void run() { // time remove input from chest, and add output material else if (currentProductionTimer >= currentRecipe .getProductionTime()) { - applyRecipeEffect(); + currentRecipe.applyEffect(getInventory(), this); currentProductionTimer = 0; if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); @@ -232,26 +250,38 @@ else if (currentProductionTimer >= currentRecipe } } + /** + * @return All the recipes which are available for this instance + */ public List getRecipes() { return recipes; } + /** + * @return The recipe currently selected in this instance + */ public IRecipe getCurrentRecipe() { return currentRecipe; } + /** + * Changes the current recipe for this factory to the given one + * + * @param pr + * Recipe to switch to + */ public void setRecipe(IRecipe pr) { if (recipes.contains(pr)) { currentRecipe = pr; } } + /** + * @return Whether enough materials are available to run the currently + * selected recipe at least once + */ public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } - public void applyRecipeEffect() { - currentRecipe.applyEffect(getInventory()); - } - } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index c0df9133..df569c94 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -8,6 +8,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.ItemStack; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; @@ -19,7 +20,6 @@ public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; - private ClickableInventory ci; private HashMap recipes = new HashMap(); public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { @@ -51,7 +51,79 @@ public void blockBreak(Player p, Block b) { public void leftClick(Player p, Block b) { if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getChest())) { // chest interaction - // TODO Display information + if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff + ClickableInventory ci = new ClickableInventory( + new ArrayList(), 54, fccf.getCurrentRecipe() + .getRecipeName()); + int index = 4; + for (ItemStack is : ((InputRecipe) fccf.getCurrentRecipe()) + .getInputRepresentation(fccf.getInventory())) { + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + // nothing, just supposed to look nice + } + }; + ci.setSlot(c, index); + // weird math to fill up the gui nicely + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index += 9; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } + + } + index = 49; + for (ItemStack is : ((InputRecipe) fccf.getCurrentRecipe()) + .getOutputRepresentation(fccf.getInventory())) { + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + // nothing, just supposed to look nice + } + }; + ci.setSlot(c, index); + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index -= 9; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } + + } + ci.showInventory(p); + + } else { // not sneaking, so just a short sumup + p.sendMessage(ChatColor.GOLD + fccf.getName() + + " currently turned " + + (fccf.isActive() ? "on" : "off")); + if (fccf.isActive()) { + p.sendMessage(ChatColor.GOLD + + String.valueOf((fccf.getCurrentRecipe() + .getProductionTime() - fccf + .getRunningTime()) / 20) + + " seconds remaining until current run is complete"); + } + p.sendMessage(ChatColor.GOLD + "Currently selected recipe: " + + fccf.getCurrentRecipe().getRecipeName()); + p.sendMessage(ChatColor.GOLD + "Currently at " + + fccf.getRepairManager().getHealth() + " health"); + } return; } @@ -79,8 +151,8 @@ public void clicked(Player p) { recipes.put(c, recipe); clickables.add(c); } - ci = new ClickableInventory(clickables, InventoryType.CHEST, - "Select a recipe"); + ClickableInventory ci = new ClickableInventory(clickables, + InventoryType.CHEST, "Select a recipe"); ci.showInventory(p); return; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index d9f571b5..3bc587b0 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -8,8 +8,16 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Used to "compact" itemstack, which means complete stacks are reduced to a + * single lored item, which can be stacked. This makes the transportation of + * those items much easier. Additionally there can be a cost for each + * compaction. + * + */ public class CompactingRecipe extends InputRecipe { private List excludedMaterials; private String compactedLore; @@ -43,7 +51,7 @@ public String getRecipeName() { return name; } - public void applyEffect(Inventory i) { + public void applyEffect(Inventory i, Factory f) { if (input.isContainedIn(new ItemMap(i))) { for (ItemStack is : i.getContents()) { if (is != null) { @@ -126,7 +134,8 @@ private void compact(ItemStack is) { * @return True if compacting the stack is allowed, false if not */ private boolean compactable(ItemStack is) { - return !excludedMaterials.contains(is.getType()) + return is.getMaxStackSize() != 1 + && !excludedMaterials.contains(is.getType()) && is.getAmount() == is.getMaxStackSize() && !is.hasItemMeta(); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index bc451d59..1a170c8c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -8,8 +8,15 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Used to decompact itemstacks, which means a single item with compacted lore + * is turned into a whole stack without lore. This reverses the functionality of + * the CompactingRecipe + * + */ public class DecompactingRecipe extends InputRecipe { private String compactedLore; @@ -34,15 +41,7 @@ public boolean enoughMaterialAvailable(Inventory i) { return false; } - public int getProductionTime() { - return productionTime; - } - - public String getRecipeName() { - return name; - } - - public void applyEffect(Inventory i) { + public void applyEffect(Inventory i, Factory f) { if (input.isContainedIn(new ItemMap(i))) { for (ItemStack is : i.getContents()) { if (is != null) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index 6f0a5a22..cd82ed2c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -1,17 +1,44 @@ package com.github.igotyou.FactoryMod.recipes; -import java.util.List; - import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -public interface IRecipe -{ +import com.github.igotyou.FactoryMod.Factory; + +/** + * Encapsulates a specific functionality for a FurnCraftChest factory. Each + * factory of this type can have of many different recipes and what the recipe + * actually does is completly kept inside the recipe's class + * + */ +public interface IRecipe { + /** + * @return The identifier for this recipe, which is used both internally and + * to display the recipe to a player + */ public String getRecipeName(); - - public int getProductionTime(); - + + /** + * @return How long this recipe takes for one run in ticks + */ + public int getProductionTime(); + + /** + * Checks whether enough material is available in the given inventory to run + * this recipe at least once + * + * @param i + * Inventory to check + * @return true if the recipe could be run at least once, false if not + */ public boolean enoughMaterialAvailable(Inventory i); - - public void applyEffect(Inventory i); + + /** + * Applies whatever the recipe actually does, it's main functionality + * + * @param i + * Inventory which contains the materials to work with + * @param f + * Factory which is run + */ + public void applyEffect(Inventory i, Factory f); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 7e29a2a9..5ceae6d5 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -2,6 +2,7 @@ import java.util.LinkedList; import java.util.List; +import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.inventory.Inventory; @@ -10,6 +11,10 @@ import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * A recipe with any form of item input to run it + * + */ public abstract class InputRecipe implements IRecipe { protected String name; protected int productionTime; @@ -21,8 +26,32 @@ public InputRecipe(String name, int productionTime, ItemMap input) { this.input = input; } + /** + * Used to get a representation of a recipes input materials, which is + * displayed in an item gui to illustrate the recipe and to give additional + * information + * + * @param i + * Inventory for which the recipe would be run, this is used to + * add lore to the items, which tells how often the recipe could + * be run + * @return List of itemstacks which represent the input required to run this + * recipe + */ public abstract List getInputRepresentation(Inventory i); + /** + * Used to get a representation of a recipes output materials, which is + * displayed in an item gui to illustrate the recipe and to give additional + * information + * + * @param i + * Inventory for which the recipe would be run, this is used to + * add lore to the items, which tells how often the recipe could + * be run + * @return List of itemstacks which represent the output returned when + * running this recipe + */ public abstract List getOutputRepresentation(Inventory i); public String getRecipeName() { @@ -40,7 +69,11 @@ public ItemMap getInput() { public boolean enoughMaterialAvailable(Inventory i) { return input.isContainedIn(new ItemMap(i)); } - + + /** + * @return A single itemstack which is used to represent this recipe as a + * whole in an item gui + */ public abstract ItemStack getRecipeRepresentation(); /** @@ -57,9 +90,20 @@ public boolean enoughMaterialAvailable(Inventory i) { protected List createLoredStacksForInfo(Inventory i) { LinkedList result = new LinkedList(); ItemMap inventoryMap = new ItemMap(i); + ItemMap possibleRuns = new ItemMap(); + for (Entry entry : input.getEntrySet()) { + if (inventoryMap.getAmount(entry.getKey()) != null) { + possibleRuns.addItemAmount( + entry.getKey(), + inventoryMap.getAmount(entry.getKey()) + / entry.getValue()); + } else { + possibleRuns.addItemAmount(entry.getKey(), 0); + + } + } + for (ItemStack is : input.getItemStackRepresentation()) { - int possibleRuns = new ItemMap(is) - .getMultiplesContainedIn(inventoryMap); ItemMeta im = is.getItemMeta(); List lore; if (im.hasLore()) { @@ -68,7 +112,7 @@ protected List createLoredStacksForInfo(Inventory i) { lore = new LinkedList(); } lore.add(ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns) + " runs"); + + String.valueOf(possibleRuns.getAmount(is)) + " runs"); im.setLore(lore); is.setItemMeta(im); result.add(is); diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index cd83048e..993fd018 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -9,8 +9,14 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Consumes a set of materials from a container and outputs another set of + * materials to the same container + * + */ public class ProductionRecipe extends InputRecipe { private ItemMap output; @@ -36,9 +42,9 @@ public ItemMap getCurrentOutput(Inventory i) { } public List getOutputRepresentation(Inventory i) { - List stacks = output.getItemStackRepresentation(); - int possibleRuns = input.getMultiplesContainedIn(new ItemMap (i)); - for(ItemStack is: stacks) { + List stacks = output.getItemStackRepresentation(); + int possibleRuns = input.getMultiplesContainedIn(new ItemMap(i)); + for (ItemStack is : stacks) { ItemMeta im = is.getItemMeta(); List lore; if (im.hasLore()) { @@ -58,7 +64,7 @@ public List getInputRepresentation(Inventory i) { return createLoredStacksForInfo(i); } - public void applyEffect(Inventory i) { + public void applyEffect(Inventory i, Factory f) { ItemMap toRemove = input.clone(); ItemMap toAdd = output.clone(); if (new ItemMap(i).contains(toRemove)) @@ -69,14 +75,13 @@ public void applyEffect(Inventory i) { i.addItem(is); } } - + public ItemStack getRecipeRepresentation() { - List out = output.getItemStackRepresentation(); + List out = output.getItemStackRepresentation(); ItemStack res; if (out.size() == 0) { res = new ItemStack(Material.STONE); - } - else { + } else { res = out.get(0); } ItemMeta im = res.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 8b4dff5e..34fe3cf4 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -4,15 +4,18 @@ import java.util.List; import org.bukkit.Material; -import org.bukkit.block.BlockState; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.Factory; -import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Used to repair FurnCraftChest factories. Once one of those factories is in + * disrepair the only recipe that can be run is one of this kind + * + */ public class RepairRecipe extends InputRecipe { private int healthPerRun; @@ -26,8 +29,8 @@ public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); ItemMeta im = furn.getItemMeta(); - List lore = new LinkedList(); - lore.add("+"+String.valueOf(healthPerRun)+" health"); + List lore = new LinkedList(); + lore.add("+" + String.valueOf(healthPerRun) + " health"); im.setLore(lore); furn.setItemMeta(im); result.add(furn); @@ -38,18 +41,15 @@ public List getInputRepresentation(Inventory i) { return createLoredStacksForInfo(i); } - public void applyEffect(Inventory i) { + public void applyEffect(Inventory i, Factory f) { if (enoughMaterialAvailable(i)) { for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } - BlockState bs = (BlockState) i.getHolder(); - Factory f = FactoryModPlugin.getManager().getFactoryAt( - bs.getLocation()); f.getRepairManager().repair(healthPerRun); } } - + public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.FURNACE); ItemMeta im = res.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java index 89fbc62e..40dbd7a3 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -1,14 +1,37 @@ package com.github.igotyou.FactoryMod.repairManager; +/** + * Used to manager the health of a factory and to handle repairs for it. + * + */ public interface IRepairManager { + /** + * Sets the health to 0 and makes the factory unusable + */ public void breakIt(); - + + /** + * @return How much factory the factory represented currently has + */ public String getHealth(); + /** + * @return Whether the factory represented is currently at full health + */ public boolean atFullHealth(); + /** + * Repairs the factory by the given amount, which means the health is + * increased + * + * @param amount + * Health to restore + */ public void repair(int amount); + /** + * @return Whether the factory is in disrepair currently + */ public boolean inDisrepair(); } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index aec73a16..af15e308 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -111,6 +111,17 @@ public void removeItemStack(ItemStack input, boolean safe) { } } + /** + * Completly removes the given itemstack of this item map, completly + * independent of its amount + * + * @param input + * ItemStack to remove + */ + public void removeItemStackCompletly(ItemStack input) { + items.remove(input); + } + /** * Removes all the given ItemStacks from this map. Only the amount of the * given ItemStack will be removed, not the complete instance from the map. @@ -357,7 +368,7 @@ public Set> getEntrySet() { public ItemMap getDifference(ItemMap im) { ItemMap result = new ItemMap(); Set> firstSet = getEntrySet(); - Set> secondSet = im.getEntrySet(); + Set> secondSet = im.getActualEntrySet(); for (Entry entry : firstSet) { Integer pulled = im.getAmount(entry.getKey()); if (pulled != null) { @@ -365,16 +376,21 @@ public ItemMap getDifference(ItemMap im) { result.addItemAmount(entry.getKey(), pulled - entry.getValue()); } - clearEntrySetFromStack(secondSet, entry.getKey()); + im.removeItemStackCompletly(entry.getKey()); } else { result.addItemAmount(entry.getKey(), entry.getValue() * -1); } - clearEntrySetFromStack(firstSet, entry.getKey()); - } result.addEntrySet(secondSet); return result; } + + /** + * @return An entry set of the hashmap in this itemmap and not just a copy + */ + private Set > getActualEntrySet() { + return items.entrySet(); + } /** * Checks whether an inventory contains exactly what's described in this @@ -429,8 +445,8 @@ public String toString() { public int getMultiplesContainedIn(ItemMap im) { int res = Integer.MAX_VALUE; for (Entry entry : getEntrySet()) { - int pulledAmount = im.getAmount(entry.getKey()) != null ? im - .getAmount(entry.getKey()) : 0; + int pulledAmount = im.getAmount(entry.getKey()) != null ? (im + .getAmount(entry.getKey()) / getAmount(entry.getKey())) : 0; res = Math.min(res, pulledAmount); } return res; From fe78a9c03a9335fea7327b9b0542ce5bdcb5fad1 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 11 Dec 2015 21:28:35 -0500 Subject: [PATCH 182/459] First draft of redstone interaction. Just need to add citadel check. --- .../FurnCraftChestInteractionManager.java | 77 ++++++++++++++++++- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index df569c94..abb71c8f 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -2,8 +2,10 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import org.bukkit.ChatColor; +import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; @@ -34,7 +36,77 @@ public void setFactory(FurnCraftChestFactory fccf) { } public void redStoneEvent(BlockRedstoneEvent e) { - // TODO + if (e.getNewCurrent() == e.getOldCurrent()) { + return; + } + int threshold = 1; + int rThreshold = 1; + boolean newState = false; + if (e.getBlock().getLocation().equals(fccf.getFurnace().getLocation())) { + if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { + // Falling Edge (turn off) + newState = false; + } else if (e.getOldCurrent() < threshold && e.getNewCurrent() >= threshold && !fccf.isActive()) { + // Rising Edge (turn on) + newState = true; + } else { + return; + } + + // TODO: Check citadel here + if (checkCitadelAround(e.getBlock().getLocation(), e.getNewCurrent())) { + if (newState) { + fccf.activate(); + } else { + fccf.deactivate(); + } + } + } else if (!fccf.isActive() && e.getBlock().getLocation().equals( + ((FurnCraftChestStructure) fccf.getMultiBlockStructure()).getCraftingTable())) { + // Can't change recipe while active. + int change = e.getOldCurrent() - e.getNewCurrent(); + if (Math.abs(change) >= rThreshold) { + List currentRecipes = fccf.getRecipes(); + if (currentRecipes.size() == 0 || !checkCitadelAround(e.getBlock().getLocation(), e.getNewCurrent())) { + return; + } + IRecipe current = fccf.getCurrentRecipe(); + int idx = 0; + // edge case? + if (current != null) { + idx = currentRecipes.indexOf(current); + if (change > 0) { // next + if (idx >= currentRecipes.size() - 1) { + idx = 0; + } else { + idx ++; + } + } else if (change < 0) { // prev + if (idx == 0) { + idx = currentRecipes.size() - 1; + } else { + idx --; + } + } + } + fccf.setRecipe(currentRecipes.get(idx)); + } + } + } + + /** + * Utility method to check Citadel properties of potential power-giving blocks + * surrounding the location passed, but skipping any locations owned by the Factory. + * + * In other words, the factory won't transmit power to other blocks within its multiblock + * structure. + * + * @param here The Location (part of the factory) to check around + * @param level The power level to compare against + * @return True if something found that is powered at the level indicated and on a compatible group + */ + private boolean checkCitadelAround(Location here, int level) { + return true; } public void blockBreak(Player p, Block b) { @@ -156,8 +228,7 @@ public void clicked(Player p) { ci.showInventory(p); return; } - if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getFurnace())) { // furnace interaction + if (b.equals(fccf.getFurnace()) { // furnace interaction if (fccf.isActive()) { fccf.deactivate(); } else { From 6df0de0b7456da809212fb8c7b89e38c4cd36c02 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 13 Dec 2015 20:43:20 -0500 Subject: [PATCH 183/459] Layering in Citadel checks. Basically just checks surroundings for power and determines max citadel-allowed incoming power level, then uses that or fails fast. TODO: float up configuration params for redstone level checks. --- .../FurnCraftChestInteractionManager.java | 89 +++++++++++++++---- 1 file changed, 71 insertions(+), 18 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index abb71c8f..fb3589e0 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -7,6 +7,7 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.inventory.InventoryType; @@ -15,6 +16,11 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; + +import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.IRecipe; @@ -23,19 +29,43 @@ public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); + private ReinforcementManager rm; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { this.fccf = fccf; + prepCitadel(); } public FurnCraftChestInteractionManager() { + prepCitadel(); } public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } + + private void prepCitadel() { + if (FactoryModPlugin.getManager().isCitadelEnabled()) { + rm = Citadel.getReinforcementManager(); + } else { + rm = null; + } + } public void redStoneEvent(BlockRedstoneEvent e) { + if (rm != null) { + // Note this also accomplishes all the Citadel checking we need. + BlockFace powerFace = findPoweringFace(e.getBlock(), fccf.getMultiBlockStructure().getAllBlocks()); + if (powerFace != null) { + int trueNewCurrent = e.getBlock().getBlockPower(powerFace); + if (trueNewCurrent != e.getNewCurrent()) { + e.setNewCurrent(trueNewCurrent); + } + } else { // null means citadel is enabled but no valid redstone power was found. + return; + } + } + if (e.getNewCurrent() == e.getOldCurrent()) { return; } @@ -53,13 +83,10 @@ public void redStoneEvent(BlockRedstoneEvent e) { return; } - // TODO: Check citadel here - if (checkCitadelAround(e.getBlock().getLocation(), e.getNewCurrent())) { - if (newState) { - fccf.activate(); - } else { - fccf.deactivate(); - } + if (newState) { + fccf.activate(); + } else { + fccf.deactivate(); } } else if (!fccf.isActive() && e.getBlock().getLocation().equals( ((FurnCraftChestStructure) fccf.getMultiBlockStructure()).getCraftingTable())) { @@ -67,7 +94,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { int change = e.getOldCurrent() - e.getNewCurrent(); if (Math.abs(change) >= rThreshold) { List currentRecipes = fccf.getRecipes(); - if (currentRecipes.size() == 0 || !checkCitadelAround(e.getBlock().getLocation(), e.getNewCurrent())) { + if (currentRecipes.size() == 0) { return; } IRecipe current = fccf.getCurrentRecipe(); @@ -95,19 +122,45 @@ public void redStoneEvent(BlockRedstoneEvent e) { } /** - * Utility method to check Citadel properties of potential power-giving blocks - * surrounding the location passed, but skipping any locations owned by the Factory. - * - * In other words, the factory won't transmit power to other blocks within its multiblock - * structure. + * Only deals with directly powered redstone interactions, not indirect power + * Finds the block face giving the highest power that is also on a compatible Citadel group. * - * @param here The Location (part of the factory) to check around - * @param level The power level to compare against - * @return True if something found that is powered at the level indicated and on a compatible group + * @param here The block to check around. + * @param exclude The blocks to exclude from checks. + * @return The Face of the highest compatible power level. */ - private boolean checkCitadelAround(Location here, int level) { - return true; + private BlockFace findPoweringFace(Block here, List exclude) { + if (here.isBlockPowered()) { + PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm.getReinforcement(here) : null; + int prGID = (pr != null) ? pr.getGroup().getGroupId() : -1; + boolean checkCitadel = pr != null; + if (checkCitadel) { + checkCitadel = !pr.isInsecure(); // don't check citadel if insecure; any input is good then + } + BlockFace max = null; + int maxP = -1; + for (BlockFace face : adjacentFaces) { + Block rel = here.getRelative(face); + if (!exclude.contains(rel) && here.isBlockFacePowered(face)) { + int curP = here.getBlockPower(face); + if (curP > maxP) { + if (!checkCitadel || prGID == + ((PlayerReinforcement) rm.getReinforcement(rel)).getGroup().getGroupId()) { + max = face; + maxP = curP; + // TODO: consider shortcut of iff max == 15 return; + } + } + } + } + return max; + } else { + return null; + } } + + protected static BlockFace[] adjacentFaces = new BlockFace[] {BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, + BlockFace.SOUTH, BlockFace.DOWN, BlockFace.UP}; public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); From 22ee858df9bc05ada82efc97e8084f3e5aaebb51 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 14 Dec 2015 00:44:02 -0500 Subject: [PATCH 184/459] Added configuration options for Redstone control. --- config.yml | 2 ++ .../igotyou/FactoryMod/ConfigParser.java | 4 ++- .../igotyou/FactoryMod/FactoryModManager.java | 27 ++++++++++++++++++- .../FurnCraftChestInteractionManager.java | 5 ++-- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 29b6077d..69e30e53 100644 --- a/config.yml +++ b/config.yml @@ -4,6 +4,8 @@ citadel_enabled: true factory_interaction_material: STICK disable_nether: true default_update_time: 4 +redstone_power_on: 7 +redstone_recipe_change: 2 crafting: disabled: diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 1eb6d8c1..aee6574b 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -58,8 +58,10 @@ public FactoryModManager parse() { .registerEvents(new NetherPortalListener(), plugin); } int defaultUpdateTime = config.getInt("default_update_time", 4); + int redstonePowerOn = config.getInt("redstone_power_on", 7); + int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); manager = new FactoryModManager(plugin, factoryInteractionMaterial, - citadelEnabled); + citadelEnabled, redstonePowerOn, redstoneRecipeChange); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); parseRecipes(config.getConfigurationSection("recipes")); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index d5c3ef25..d198297f 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -29,13 +29,17 @@ public class FactoryModManager { private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; private boolean citadelEnabled; + private int redstonePowerOn; + private int redstoneRecipeChange; private String compactLore; public FactoryModManager(FactoryModPlugin plugin, - Material factoryInteractionMaterial, boolean citadelEnabled) { + Material factoryInteractionMaterial, boolean citadelEnabled, int redstonePowerOn, int redstoneRecipeChange) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; + this.redstonePowerOn = redstonePowerOn; + this.redstoneRecipeChange = redstoneRecipeChange; factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); @@ -252,4 +256,25 @@ public boolean isPossibleInteractionBlock(Material m) { public IFactoryEgg getEgg(String name) { return eggs.get(name); } + + /** + * Gets the Redstone power level necessary to active a factory. + * Fall below this level and the factory will deactivate. + * + * @return The power level on which factory activation or de-activation hinges + */ + public int getRedstonePowerOn() { + return this.redstonePowerOn; + } + + /** + * Gets the Redstone power change necessary to alter the recipe setting of a factory. + * Any change >= this level, either positive or negative, will attempt to alter the recipe + * (implementation depending). + * + * @return The amount of Redstone power change necessary to alter recipe setting of a factory. + */ + public int getRedstoneRecipeChange() { + return this.redstoneRecipeChange; + } } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index fb3589e0..fa8930cf 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -69,8 +69,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { if (e.getNewCurrent() == e.getOldCurrent()) { return; } - int threshold = 1; - int rThreshold = 1; + int threshold = FactoryModPlugin.getManager().getRedstonePowerOn(); boolean newState = false; if (e.getBlock().getLocation().equals(fccf.getFurnace().getLocation())) { if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { @@ -92,7 +91,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { ((FurnCraftChestStructure) fccf.getMultiBlockStructure()).getCraftingTable())) { // Can't change recipe while active. int change = e.getOldCurrent() - e.getNewCurrent(); - if (Math.abs(change) >= rThreshold) { + if (Math.abs(change) >= FactoryModPlugin.getManager().getRedstoneRecipeChange()) { List currentRecipes = fccf.getRecipes(); if (currentRecipes.size() == 0) { return; From a31c4893783a653604f7b1167ca798abd329b8ad Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 14 Dec 2015 13:16:31 +0100 Subject: [PATCH 185/459] Addings tons of documentation --- .../github/igotyou/FactoryMod/Factory.java | 55 ++++++++++++++++-- .../igotyou/FactoryMod/FactoryModPlugin.java | 1 - .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 43 +++++++++++++- .../IInteractionManager.java | 41 +++++++++++++- .../listeners/CompactItemListener.java | 32 +++++++---- .../listeners/NetherPortalListener.java | 3 +- .../FurnCraftChestStructure.java | 49 ++++++++++------ .../MultiBlockStructure.java | 56 +++++++++++++------ .../powerManager/FurnacePowerManager.java | 11 +++- .../powerManager/IPowerManager.java | 38 ++++++++++++- .../igotyou/FactoryMod/utility/ItemMap.java | 24 ++++---- 11 files changed, 280 insertions(+), 73 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/Factory.java b/src/com/github/igotyou/FactoryMod/Factory.java index 279db211..e02e4898 100644 --- a/src/com/github/igotyou/FactoryMod/Factory.java +++ b/src/com/github/igotyou/FactoryMod/Factory.java @@ -7,7 +7,11 @@ import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -public abstract class Factory implements Runnable{ +/** + * Super class for any sort of factory created by this plugin + * + */ +public abstract class Factory implements Runnable { protected IInteractionManager im; protected IRepairManager rm; protected IPowerManager pm; @@ -16,8 +20,8 @@ public abstract class Factory implements Runnable{ protected int updateTime; protected String name; - public Factory(IInteractionManager im, IRepairManager rm, - IPowerManager pm, MultiBlockStructure mbs, int updateTime, String name) { + public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, + MultiBlockStructure mbs, int updateTime, String name) { this.im = im; this.rm = rm; this.mbs = mbs; @@ -26,38 +30,81 @@ public Factory(IInteractionManager im, IRepairManager rm, this.name = name; } + /** + * @return The manager which handles health, repairs and decay of the + * factory + */ public IRepairManager getRepairManager() { return rm; } + /** + * @return The manager which handles any sort of player interaction with the + * factory + */ public IInteractionManager getInteractionManager() { return im; } + /** + * @return The manager which handles power and it's consumption for this + * factory + */ public IPowerManager getPowerManager() { return pm; } + /** + * @return Whether this factory is currently turned on + */ public boolean isActive() { return active; } + /** + * @return The physical structure representing this factory + */ public MultiBlockStructure getMultiBlockStructure() { return mbs; } + /** + * @return How often this factory is updated when it's turned on, measured + * in ticks + */ public int getUpdateTime() { return updateTime; } - + + /** + * Names are not unique for factory instances, but simply describe a broader + * functionality group. Factories implemented by the same class can have + * different names, but factories with the same name should have the exact + * same functionality + * + * @return name of this factory + */ public String getName() { return name; } + /** + * Activates this factory + */ public abstract void activate(); + /** + * Deactivates this factory + */ public abstract void deactivate(); + /** + * Attempts to turn this factory on and does any checks needed + * + * @param p + * Player turning the factory on or null if something other than + * a player is attempting to turn it on + */ public abstract void attemptToActivate(Player p); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java index d7699426..62070225 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java @@ -14,7 +14,6 @@ public void onEnable() { plugin = this; ConfigParser cp = new ConfigParser(this); manager = cp.parse(); - MultiBlockStructure.initiliazeBlockSides(); plugin.getServer().getPluginManager().registerEvents(new FactoryModListener(manager),plugin); } diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index 9dd12f18..3620c02a 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -5,8 +5,47 @@ import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +/** + * This represents the design pattern "Factory", but because that word was + * already taken in the context of this plugin I had to come up with another + * analogy instead, I decided to go with eggs, dont blame me. Any class + * implementing this interface should be representing a specific combination of + * managers and MultiBlockStructures and contain any information needed to + * create a new factory object of the type which the egg is representing. + * + */ public interface IFactoryEgg { - public Factory hatch(MultiBlockStructure mbs,Player p); - + /** + * Called whenever a factory is supposed to be created after all the + * required checks are already done. + * + * @param mbs + * Physical representation of the factory which should be created + * @param p + * Player creating the factory + * @return The created factory object + */ + public Factory hatch(MultiBlockStructure mbs, Player p); + + /** + * Each egg has a name which is also carried over to identify the type of + * the factory at a later point. There can be many instances of the same egg + * with different names, but there should never be multiple instances with + * the same name + * + * @return name of this egg and the factory it is creating + */ public String getName(); + + /** + * Java wont let me specify a method here without specifying its parameters + * so it's commented out, because parameters may vary for each + * implementation, but this is needed to make the whole thing work. This + * method is called when reconstructing an factory object with data provided + * from the database, so this method should provide the possibility to + * create a factory in the same specific state which is represented by the + * data pulled from the database, for example in terms of selected recipe + * and repair value + */ + // public Factory revive(); } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index d0405963..752ca920 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -4,13 +4,52 @@ import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; +/** + * Handles any interaction with the factory it's associated with + * + */ public interface IInteractionManager { + /** + * Called if a player right clicks a block, which is part of the factory of + * this manager + * + * @param p + * Player who clicked + * @param b + * Block which was clicked + */ public void rightClick(Player p, Block b); + /** + * Called if a player left clicks a block, which is part of the factory of + * this manager + * + * @param p + * Player who clicked + * @param b + * Block which was clicked + */ public void leftClick(Player p, Block b); + /** + * Called if a block, which is part of the factory of this manager is + * broken, this can have various causes such as players, fire or explosions + * + * @param p + * Player who broke the block or null if no player was the direct + * cause + * @param b + * Block which was broken + */ public void blockBreak(Player p, Block b); - + + /** + * Called if a redstone event occurs for any block which is part of the + * factory of this manager + * + * @param e + * Event which occured + */ public void redStoneEvent(BlockRedstoneEvent e); } diff --git a/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java b/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java index 2c6031e2..be34a21a 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java @@ -9,13 +9,20 @@ import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.ItemStack; -public class CompactItemListener implements Listener{ - private String compactLore; - +/** + * Used to handle events related to items with compacted lore + * + */ +public class CompactItemListener implements Listener { + private String compactLore; + public CompactItemListener(String compactLore) { this.compactLore = compactLore; } - + + /** + * Prevents players from placing compacted blocks + */ @EventHandler public void blockPlaceEvent(BlockPlaceEvent e) { if (!e.getItemInHand().hasItemMeta()) { @@ -24,20 +31,24 @@ public void blockPlaceEvent(BlockPlaceEvent e) { if (!e.getItemInHand().getItemMeta().hasLore()) { return; } - if (e.getItemInHand().getItemMeta().getLore().get(0).equals(compactLore)) { + if (e.getItemInHand().getItemMeta().getLore().get(0) + .equals(compactLore)) { e.setCancelled(true); Player p = e.getPlayer(); if (p != null) { - p.sendMessage("You can not place compacted blocks"); + p.sendMessage("You can not place compacted blocks"); } } - + } - + + /** + * Prevents players from crafting with compacted materials + */ @EventHandler public void craftingEvent(CraftItemEvent e) { CraftingInventory ci = e.getInventory(); - for(ItemStack is:ci.getMatrix()) { + for (ItemStack is : ci.getMatrix()) { if (is == null) { continue; } @@ -51,7 +62,8 @@ public void craftingEvent(CraftItemEvent e) { e.setCancelled(true); HumanEntity h = e.getWhoClicked(); if (h instanceof Player && h != null) { - ((Player)h).sendMessage("You can not craft with compacted items"); + ((Player) h) + .sendMessage("You can not craft with compacted items"); } break; } diff --git a/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java b/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java index 45dc6cf5..178aa11a 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java @@ -9,7 +9,8 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; /** - * This will only be registered as a listener if we want to disable portals + * Used to disables vanilla nether portals. This will only be registered as a + * listener if we want to disable portals. * */ public class NetherPortalListener implements Listener { diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java index 07e537c4..d14ec91b 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java @@ -8,30 +8,19 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +/** + * Physical representation of a factory consisting of a chest, a crafting table + * and a furnace. The crafting table has to be inbetween the furnace and chest. + * The chest may be a double chest, but the part of the double chest not + * adjacent to the crafting table is ignored when doing any checks + * + */ public class FurnCraftChestStructure extends MultiBlockStructure { private Block CraftingTable; private Block Furnace; private Block Chest; public FurnCraftChestStructure(Block center) { - initializeBlocks(center); - } - - public FurnCraftChestStructure(List blocks) { - CraftingTable = blocks.get(0); - Furnace = blocks.get(1); - Chest = blocks.get(2); - } - - public boolean isComplete() { - return CraftingTable != null - && CraftingTable.getType() == Material.WORKBENCH - && Furnace != null - && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) - && Chest != null && Chest.getType() == Material.CHEST; - } - - public void initializeBlocks(Block center) { if (center.getType() == Material.WORKBENCH) { CraftingTable = center; for (Block b : searchForBlockOnSides(center, Material.CHEST)) { @@ -56,12 +45,36 @@ public void initializeBlocks(Block center) { Chest = b; Furnace = center.getRelative(BlockFace.WEST); } + case UP: + if (center.getRelative(BlockFace.DOWN).getType() == Material.FURNACE) { + Chest = b; + Furnace = center.getRelative(BlockFace.DOWN); + } + case DOWN: + if (center.getRelative(BlockFace.UP).getType() == Material.FURNACE) { + Chest = b; + Furnace = center.getRelative(BlockFace.UP); + } } } } } + public FurnCraftChestStructure(List blocks) { + CraftingTable = blocks.get(0); + Furnace = blocks.get(1); + Chest = blocks.get(2); + } + + public boolean isComplete() { + return CraftingTable != null + && CraftingTable.getType() == Material.WORKBENCH + && Furnace != null + && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) + && Chest != null && Chest.getType() == Material.CHEST; + } + public Block getCraftingTable() { return CraftingTable; } diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java index 1cb21a54..8612318e 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java @@ -8,25 +8,32 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +/** + * Physical representation of a factory. This may be any shape as long as the + * required methods can be applied on the shape. + * + */ public abstract class MultiBlockStructure { - protected static LinkedList allBlockSides; - protected static LinkedList northEastWestSouthSides; - - public static void initiliazeBlockSides() { - northEastWestSouthSides = new LinkedList(); - northEastWestSouthSides.add(BlockFace.EAST); - northEastWestSouthSides.add(BlockFace.NORTH); - northEastWestSouthSides.add(BlockFace.SOUTH); - northEastWestSouthSides.add(BlockFace.WEST); - allBlockSides = new LinkedList(northEastWestSouthSides); - allBlockSides.add(BlockFace.DOWN); - allBlockSides.add(BlockFace.UP); - - } + protected static BlockFace[] allBlockSides = new BlockFace[] { + BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, + BlockFace.SOUTH, BlockFace.NORTH }; + protected static BlockFace[] northEastWestSouthSides = new BlockFace[] { + BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; + /** + * Checks east,west,north and south of the given block for other blocks with + * the given material and returns all the blocks which fulfill that criteria + * + * @param b + * Block to check around + * @param m + * Material which the adjacent block should be + * @return All the blocks adjacent (not above or below) to the given block + * and of the given material type + */ public static List searchForBlockOnSides(Block b, Material m) { LinkedList result = new LinkedList(); - for (BlockFace face : northEastWestSouthSides) { + for (BlockFace face : allBlockSides) { Block side = b.getRelative(face); if (side.getType() == m) { result.add(side); @@ -35,12 +42,25 @@ public static List searchForBlockOnSides(Block b, Material m) { return result; } + /** + * @return Whether all parts of this factory are where they should be and no + * block is broken + */ public abstract boolean isComplete(); - public abstract void initializeBlocks(Block start); - + /** + * Gets all parts of this factory. It is very important to let this have the + * same order as a constructor to create a factory based on the given list + * of blocks, so this method can be used to dump block locations into the + * db, while the constructor can recreate the same factory at a later point + * + * @return All blocks which are part of this factory + */ public abstract List getAllBlocks(); + /** + * @return center block of the factory which it was created from + */ public abstract Location getCenter(); - + } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index ae989266..1c22ea37 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -6,6 +6,11 @@ import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.utility.ItemMap; +/** + * Power manager for a FurnCraftChest factory, which uses a specific item in the + * furnace of the factory as fuel + * + */ public class FurnacePowerManager implements IPowerManager { private ItemMap fuel; private FurnCraftChestFactory fccf; @@ -18,12 +23,12 @@ public FurnacePowerManager(FurnCraftChestFactory fccf, ItemMap fuel, this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; } - - public FurnacePowerManager(ItemMap fuel,int fuelConsumptionIntervall) { + + public FurnacePowerManager(ItemMap fuel, int fuelConsumptionIntervall) { this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; } - + public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java index d21f8134..dcf781f9 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java @@ -1,17 +1,49 @@ package com.github.igotyou.FactoryMod.powerManager; +/** + * Manager to handle power availability and power consumption for a specific + * factory + * + */ public interface IPowerManager { + /** + * Consumes one unit of power, what that means is up to the concrete + * implementation + */ public void consumePower(); + /** + * @return Whether power for at least one further tick cycle is available + */ public boolean powerAvailable(); + /** + * @return How often power should be consumed when running the factory this + * manager is associated with, measure in ticks + */ public int getPowerConsumptionIntervall(); + /** + * @return Internal counter to count up until power needs to be consumed + * while a factory is running. Should be in ticks + */ public int getPowerCounter(); - + + /** + * Increases the internal power counter by the given amount + * + * @param amount + * Amount to increase by + */ public void increasePowerCounter(int amount); - + + /** + * Sets the internal power counter to the given value. Use this method with + * great care and try to use increasePowerCounter() instead if possible + * + * @param value + * New power counter value + */ public void setPowerCounter(int value); - } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index af15e308..2533d891 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -13,6 +13,16 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +/** + * Allows the storage and comparison of itemstacks while ignoring their maximum + * possible stack sizes. This offers various tools to compare inventories, to + * store recipe costs or to specify setupcosts. Take great care when dealing + * with itemstacks with negative amounnts, while this implementation should be + * consistent even with negative values, they create possibly unexpected + * results. For example an empty inventory/itemmap will seem to contain items + * when compared to a map containing negative values + * + */ public class ItemMap { private HashMap items; private int totalItems; @@ -384,11 +394,11 @@ public ItemMap getDifference(ItemMap im) { result.addEntrySet(secondSet); return result; } - + /** * @return An entry set of the hashmap in this itemmap and not just a copy */ - private Set > getActualEntrySet() { + private Set> getActualEntrySet() { return items.entrySet(); } @@ -554,14 +564,4 @@ private static ItemStack createMapConformCopy(ItemStack is) { copy.setAmount(1); return copy; } - - private Set> clearEntrySetFromStack( - Set> set, ItemStack is) { - for (Entry entry : set) { - if (entry.getKey().equals(is)) { - set.remove(entry); - } - } - return set; - } } From 5b38900d2ca502eb513eccb8cb42e964157bdfdf Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 14 Dec 2015 14:11:17 +0100 Subject: [PATCH 186/459] Update version in pom.xml to 2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55318dac..62e529ff 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.igotyou FactoryMod jar - 1.4.2 + 2.0.0 FactoryMod https://github.com/Civcraft/FactoryMod From 6470addb9af425cd482278a8d79681d2157f6bcf Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 14 Dec 2015 21:21:49 -0500 Subject: [PATCH 187/459] Addresses activation use and one code error. --- .../interactionManager/FurnCraftChestInteractionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index fa8930cf..ff612467 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -83,7 +83,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { } if (newState) { - fccf.activate(); + fccf.attemptToActivate(null); } else { fccf.deactivate(); } @@ -280,7 +280,7 @@ public void clicked(Player p) { ci.showInventory(p); return; } - if (b.equals(fccf.getFurnace()) { // furnace interaction + if (b.equals(fccf.getFurnace())) { // furnace interaction if (fccf.isActive()) { fccf.deactivate(); } else { From 30a9a87e56c8cfce36b38f003102b4c03a6977ed Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Dec 2015 14:22:22 +0100 Subject: [PATCH 188/459] Add option to upgrade factories --- .../igotyou/FactoryMod/ConfigParser.java | 52 ++++++++--- .../igotyou/FactoryMod/FactoryModManager.java | 20 +++- .../FactoryMod/eggs/FurnCraftChestEgg.java | 16 ++++ .../factories/FurnCraftChestFactory.java | 28 +++++- .../FactoryMod/recipes/CompactingRecipe.java | 7 +- .../FactoryMod/recipes/InputRecipe.java | 18 ++-- .../FactoryMod/recipes/ProductionRecipe.java | 20 +--- .../FactoryMod/recipes/RepairRecipe.java | 12 +-- .../FactoryMod/recipes/Upgraderecipe.java | 92 +++++++++++++++++++ .../FactoryMod/utility/ItemStackUtils.java | 44 +++++++++ 10 files changed, 249 insertions(+), 60 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java create mode 100644 src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 1eb6d8c1..a6292240 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffectType; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; @@ -24,6 +25,7 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; +import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.google.common.collect.Lists; @@ -31,6 +33,7 @@ public class ConfigParser { private FactoryModPlugin plugin; private HashMap recipes; private FactoryModManager manager; + private int defaultUpdateTime; public ConfigParser(FactoryModPlugin plugin) { this.plugin = plugin; @@ -57,14 +60,13 @@ public FactoryModManager parse() { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } - int defaultUpdateTime = config.getInt("default_update_time", 4); + defaultUpdateTime = config.getInt("default_update_time", 4); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); parseRecipes(config.getConfigurationSection("recipes")); - parseFactories(config.getConfigurationSection("factories"), - defaultUpdateTime); + parseFactories(config.getConfigurationSection("factories")); plugin.info("Parsed complete config"); return manager; } @@ -94,9 +96,9 @@ private void parseRecipes(ConfigurationSection config) { * factory can choose to define an own value or to use the * default instead */ - private void parseFactories(ConfigurationSection config, int defaultUpdate) { + private void parseFactories(ConfigurationSection config) { for (String key : config.getKeys(false)) { - parseFactory(config.getConfigurationSection(key), defaultUpdate); + parseFactory(config.getConfigurationSection(key)); } } @@ -112,16 +114,34 @@ private void parseFactories(ConfigurationSection config, int defaultUpdate) { * factory can choose to define an own value or to use the * default instead */ - private void parseFactory(ConfigurationSection config, int defaultUpdate) { + private void parseFactory(ConfigurationSection config) { + IFactoryEgg egg = null; + switch (config.getString("type")) { + case "FCC": // Furnace, chest, craftingtable + egg = parseFactoryEgg(config); + ItemMap setupCost = parseItemMap(config + .getConfigurationSection("setupcost")); + manager.addFactoryCreationEgg(FurnCraftChestStructure.class, + setupCost, egg); + break; + + default: + plugin.severe("Could not identify factory type " + + config.getString("type")); + } + plugin.info("Parsed factory " + egg.getName()); + + } + + public IFactoryEgg parseFactoryEgg(ConfigurationSection config) { String name = config.getString("name"); - // One implementation for each egg here switch (config.getString("type")) { case "FCC": // Furnace, chest, craftingtable int update; if (config.contains("updatetime")) { update = config.getInt("updatetime"); } else { - update = defaultUpdate; + update = defaultUpdateTime; } List recipeList = new LinkedList(); for (String recipe : config.getStringList("recipes")) { @@ -129,19 +149,14 @@ private void parseFactory(ConfigurationSection config, int defaultUpdate) { } ItemMap fuel = parseItemMap(config.getConfigurationSection("fuel")); int fuelIntervall = config.getInt("fuel_consumption_intervall"); - ItemMap setupCost = parseItemMap(config - .getConfigurationSection("setupcost")); FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, recipeList, fuel, fuelIntervall); - manager.addFactoryEgg(FurnCraftChestStructure.class, setupCost, egg); - break; - + return egg; default: plugin.severe("Could not identify factory type " + config.getString("type")); + return null; } - plugin.info("Parsed factory " + name); - } /** @@ -225,6 +240,13 @@ private IRecipe parseRecipe(ConfigurationSection config) { int health = config.getInt("health_gained"); result = new RepairRecipe(name, productionTime, rep, health); break; + case "UPGRADE": + ItemMap upgradeCost = parseItemMap(config + .getConfigurationSection("input")); + IFactoryEgg egg = parseFactoryEgg(config + .getConfigurationSection("factory")); + result = new Upgraderecipe(name, productionTime, upgradeCost, egg); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index d5c3ef25..31972b1c 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -24,6 +24,7 @@ public class FactoryModManager { private HashMap, HashMap> factoryCreationRecipes; private HashMap locations; private HashMap eggs; + private HashMap> upgradeRecipes; private HashSet factories; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; @@ -40,6 +41,7 @@ public FactoryModManager(FactoryModPlugin plugin, factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); eggs = new HashMap(); + upgradeRecipes = new HashMap>(); possibleCenterBlocks = new HashSet(); possibleInteractionBlock = new HashSet(); factories = new HashSet(); @@ -202,18 +204,30 @@ public void attemptCreation(Block b, Player p) { * @param egg * Encapsulates the factory itself */ - public void addFactoryEgg(Class blockStructureClass, ItemMap recipe, - IFactoryEgg egg) { + public void addFactoryCreationEgg(Class blockStructureClass, + ItemMap recipe, IFactoryEgg egg) { HashMap eggs = factoryCreationRecipes .get(blockStructureClass); if (eggs == null) { eggs = new HashMap(); - this.factoryCreationRecipes.put(blockStructureClass, eggs); + factoryCreationRecipes.put(blockStructureClass, eggs); } eggs.put(recipe, egg); this.eggs.put(egg.getName(), egg); } + public void addFactoryUpgradeEgg(String factoryUpgradingFrom, ItemMap cost, + IFactoryEgg egg) { + HashMap eggs = upgradeRecipes + .get(factoryUpgradingFrom); + if (eggs == null) { + eggs = new HashMap(); + upgradeRecipes.put(factoryUpgradingFrom, eggs); + } + eggs.put(cost, egg); + this.eggs.put(egg.getName(), egg); + } + /** * Checks whether a specific material is a possible center block for a * factory and whether a factory could potentionally created from a block diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 86082752..dbec4d80 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -52,6 +52,22 @@ public String getName() { return name; } + public int getUpdateTime() { + return updateTime; + } + + public ItemMap getFuel() { + return fuel; + } + + public List getRecipes() { + return recipes; + } + + public int getFuelConsumptionIntervall() { + return fuelConsumptionIntervall; + } + public Factory revive(List blocks, int health, String selectedRecipe) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); FurnacePowerManager fpm = new FurnacePowerManager(fuel, diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 5b9cfc6a..02aad9af 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -16,10 +16,13 @@ import com.github.igotyou.FactoryMod.FactoryModPlugin; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; +import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.utility.ItemMap; /** * Represents a "classic" factory, which consists of a furnace as powersource, a @@ -228,7 +231,16 @@ public void run() { // time remove input from chest, and add output material else if (currentProductionTimer >= currentRecipe .getProductionTime()) { - currentRecipe.applyEffect(getInventory(), this); + if (currentRecipe instanceof Upgraderecipe) { + // this if else might look a bit weird, but because + // upgrading changes the current recipe and a lot of + // other stuff, this is needed + currentRecipe.applyEffect(getInventory(), this); + deactivate(); + return; + } else { + currentRecipe.applyEffect(getInventory(), this); + } currentProductionTimer = 0; if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); @@ -284,4 +296,18 @@ public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } + public void upgrade(String name, List recipes, ItemMap fuel, + int fuelConsumptionIntervall, int updateTime) { + this.name = name; + this.recipes = recipes; + this.updateTime = updateTime; + this.pm = new FurnacePowerManager(this, fuel, fuelConsumptionIntervall); + this.rm.repair(100); + if (recipes.size() != 0) { + setRecipe(recipes.get(0)); + } else { + currentRecipe = null; + } + } + } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 3bc587b0..600aa172 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -10,6 +10,7 @@ import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Used to "compact" itemstack, which means complete stacks are reduced to a @@ -116,12 +117,8 @@ public ItemStack getRecipeRepresentation() { * @param is */ private void compact(ItemStack is) { - List loreList = new LinkedList(); - loreList.add(compactedLore); + ItemStackUtils.addLore(is, compactedLore); is.setAmount(1); - ItemMeta im = is.getItemMeta(); - im.setLore(loreList); - is.setItemMeta(im); } /** diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 5ceae6d5..5cd43340 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -7,9 +7,9 @@ import org.bukkit.ChatColor; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * A recipe with any form of item input to run it @@ -104,17 +104,11 @@ protected List createLoredStacksForInfo(Inventory i) { } for (ItemStack is : input.getItemStackRepresentation()) { - ItemMeta im = is.getItemMeta(); - List lore; - if (im.hasLore()) { - lore = im.getLore(); - } else { - lore = new LinkedList(); - } - lore.add(ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns.getAmount(is)) + " runs"); - im.setLore(lore); - is.setItemMeta(im); + ItemStackUtils.addLore( + is, + ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns.getAmount(is)) + + " runs"); result.add(is); } return result; diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 993fd018..9c46678e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.recipes; -import java.util.LinkedList; import java.util.List; import org.bukkit.ChatColor; @@ -11,6 +10,7 @@ import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Consumes a set of materials from a container and outputs another set of @@ -45,17 +45,9 @@ public List getOutputRepresentation(Inventory i) { List stacks = output.getItemStackRepresentation(); int possibleRuns = input.getMultiplesContainedIn(new ItemMap(i)); for (ItemStack is : stacks) { - ItemMeta im = is.getItemMeta(); - List lore; - if (im.hasLore()) { - lore = im.getLore(); - } else { - lore = new LinkedList(); - } - lore.add(ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns) + " runs"); - im.setLore(lore); - is.setItemMeta(im); + ItemStackUtils.addLore(is, ChatColor.GREEN + + "Enough materials for " + String.valueOf(possibleRuns) + + " runs"); } return stacks; } @@ -84,9 +76,7 @@ public ItemStack getRecipeRepresentation() { } else { res = out.get(0); } - ItemMeta im = res.getItemMeta(); - im.setDisplayName(getRecipeName()); - res.setItemMeta(im); + ItemStackUtils.setName(res, getRecipeName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 34fe3cf4..4e7c44e7 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -6,10 +6,10 @@ import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Used to repair FurnCraftChest factories. Once one of those factories is in @@ -28,11 +28,7 @@ public RepairRecipe(String name, int productionTime, ItemMap input, public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); - ItemMeta im = furn.getItemMeta(); - List lore = new LinkedList(); - lore.add("+" + String.valueOf(healthPerRun) + " health"); - im.setLore(lore); - furn.setItemMeta(im); + ItemStackUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); result.add(furn); return result; } @@ -52,9 +48,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.FURNACE); - ItemMeta im = res.getItemMeta(); - im.setDisplayName(getRecipeName()); - res.setItemMeta(im); + ItemStackUtils.setName(res, getRecipeName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java new file mode 100644 index 00000000..37e06dc7 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -0,0 +1,92 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; + +public class Upgraderecipe extends InputRecipe { + private IFactoryEgg egg; + + public Upgraderecipe(String name, int productionTime, ItemMap input, IFactoryEgg egg) { + super(name, productionTime, input); + this.egg = egg; + } + + public void applyEffect(Inventory i, Factory f) { + ItemMap invMap = new ItemMap(i); + if (invMap.contains(input) && f instanceof FurnCraftChestFactory) { + for (ItemStack is : input.getItemStackRepresentation()) { + i.removeItem(is); + } + FurnCraftChestEgg e = (FurnCraftChestEgg) egg; + ((FurnCraftChestFactory) f).upgrade(e.getName(), e.getRecipes(), + e.getFuel(), e.getFuelConsumptionIntervall(), + e.getUpdateTime()); + } + + } + + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.WORKBENCH); + ItemStackUtils.setName(res, "Upgrade to " + egg.getName()); + return res; + } + + public List getInputRepresentation(Inventory i) { + LinkedList result = new LinkedList(); + ItemMap inventoryMap = new ItemMap(i); + ItemMap possibleRuns = new ItemMap(); + for (Entry entry : input.getEntrySet()) { + if (inventoryMap.getAmount(entry.getKey()) != null) { + possibleRuns.addItemAmount( + entry.getKey(), + inventoryMap.getAmount(entry.getKey()) + / entry.getValue()); + } else { + possibleRuns.addItemAmount(entry.getKey(), 0); + } + } + for (ItemStack is : input.getItemStackRepresentation()) { + if (possibleRuns.getAmount(is) != 0) { + ItemStackUtils.addLore(is, ChatColor.GREEN + + "Enough of this material available to upgrade"); + } else { + ItemStackUtils.addLore(is, ChatColor.RED + + "Not enough of this materials available to upgrade"); + } + result.add(is); + } + return result; + } + + public List getOutputRepresentation(Inventory i) { + List res = new LinkedList(); + ItemStack cr = new ItemStack(Material.WORKBENCH); + ItemStackUtils.setName(cr, egg.getName()); + res.add(cr); + ItemStack fur = new ItemStack(Material.FURNACE); + ItemStackUtils.setName(fur, egg.getName()); + res.add(fur); + ItemStack che = new ItemStack(Material.CHEST); + ItemStackUtils.setName(che, egg.getName()); + res.add(che); + return res; + } + + public IFactoryEgg getEgg() { + return egg; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java b/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java new file mode 100644 index 00000000..a1f72bc3 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java @@ -0,0 +1,44 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +public class ItemStackUtils { + public static void addLore(ItemStack is, String... lore) { + ItemMeta im = is.getItemMeta(); + List loreList = im.getLore(); + if (loreList == null) { + loreList = new LinkedList(); + } + for (String currLore : lore) { + loreList.add(currLore); + } + im.setLore(loreList); + is.setItemMeta(im); + + } + + public static void setLore(ItemStack is, String... lore) { + ItemMeta im = is.getItemMeta(); + List loreList = new LinkedList(); + for (String currLore : lore) { + loreList.add(currLore); + } + im.setLore(loreList); + is.setItemMeta(im); + } + + public static void setName(ItemStack is, String name) { + ItemMeta im = is.getItemMeta(); + im.setDisplayName(name); + is.setItemMeta(im); + } + + public static String getName(ItemStack is) { + return is.getItemMeta().getDisplayName(); + } + +} From e841def0b2f350803550aa89f4c88ffe96df7a6a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Dec 2015 16:50:21 +0100 Subject: [PATCH 189/459] Second Half of doublechest can be used for interaction --- .../listeners/FactoryModListener.java | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index b8be04c0..2cb6bf99 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -21,6 +21,7 @@ import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; public class FactoryModListener implements Listener { private FactoryModManager manager; @@ -68,8 +69,8 @@ public void explosionListener(EntityExplodeEvent e) { List blocks = e.blockList(); for (Block block : blocks) { if (manager.isPossibleInteractionBlock(block.getType()) - && ((manager.isCitadelEnabled() && !rm - .isReinforced(block)) || !manager.isCitadelEnabled())) { + && ((manager.isCitadelEnabled() && !rm.isReinforced(block)) || !manager + .isCitadelEnabled())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(null, block); @@ -85,8 +86,8 @@ public void explosionListener(EntityExplodeEvent e) { public void burnListener(BlockBurnEvent e) { Block block = e.getBlock(); if (manager.isPossibleInteractionBlock(block.getType()) - && ((manager.isCitadelEnabled() && !rm - .isReinforced(block)) || !manager.isCitadelEnabled())) { + && ((manager.isCitadelEnabled() && !rm.isReinforced(block)) || !manager + .isCitadelEnabled())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(null, block); @@ -98,18 +99,42 @@ public void burnListener(BlockBurnEvent e) { public void playerInteract(PlayerInteractEvent e) { Block block = e.getClickedBlock(); Player player = e.getPlayer(); - if (block != null && manager.isPossibleInteractionBlock(block.getType()) - && player.getItemInHand().getType() == manager.getFactoryInteractionMaterial()) { + if (block != null + && manager.isPossibleInteractionBlock(block.getType()) + && player.getItemInHand().getType() == manager + .getFactoryInteractionMaterial()) { Factory c = manager.getFactoryAt(block); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (c != null) { c.getInteractionManager().rightClick(player, block); + } else { + if (block.getType() == Material.CHEST) { + for (Block b : MultiBlockStructure + .searchForBlockOnSides(block, Material.CHEST)) { + Factory f = manager.getFactoryAt(b); + if (f != null) { + f.getInteractionManager().rightClick(player, b); + } + } + } } } if (e.getAction() == Action.LEFT_CLICK_BLOCK) { if (c == null) { if (manager.isPossibleCenterBlock(block.getType())) { manager.attemptCreation(block, player); + } else { + if (block.getType() == Material.CHEST) { + for (Block b : MultiBlockStructure + .searchForBlockOnSides(block, + Material.CHEST)) { + Factory f = manager.getFactoryAt(b); + if (f != null) { + f.getInteractionManager().leftClick( + player, b); + } + } + } } } else { c.getInteractionManager().leftClick(player, block); From 680a5d827b1c9716cf00c7e392095af9450996a5 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Dec 2015 17:23:31 +0100 Subject: [PATCH 190/459] Add default fuel and default fuel consumption intervall --- .../igotyou/FactoryMod/ConfigParser.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 28d659e5..fc2c53e3 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -34,6 +34,8 @@ public class ConfigParser { private HashMap recipes; private FactoryModManager manager; private int defaultUpdateTime; + private ItemMap defaultFuel; + private int defaultFuelConsumptionTime; public ConfigParser(FactoryModPlugin plugin) { this.plugin = plugin; @@ -60,7 +62,11 @@ public FactoryModManager parse() { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } - defaultUpdateTime = config.getInt("default_update_time", 4); + defaultUpdateTime = config.getInt("default_update_time", 5); + defaultFuel = parseItemMap(config + .getConfigurationSection("default_fuel")); + defaultFuelConsumptionTime = config.getInt( + "default_fuel_consumption_intervall", 20); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); manager = new FactoryModManager(plugin, factoryInteractionMaterial, @@ -149,8 +155,18 @@ public IFactoryEgg parseFactoryEgg(ConfigurationSection config) { for (String recipe : config.getStringList("recipes")) { recipeList.add(recipes.get(recipe)); } - ItemMap fuel = parseItemMap(config.getConfigurationSection("fuel")); - int fuelIntervall = config.getInt("fuel_consumption_intervall"); + ItemMap fuel; + if (config.contains("fuel")) { + fuel = parseItemMap(config.getConfigurationSection("fuel")); + } else { + fuel = defaultFuel; + } + int fuelIntervall; + if (config.contains("fuel_consumption_intervall")) { + fuelIntervall = config.getInt("fuel_consumption_intervall"); + } else { + fuelIntervall = defaultFuelConsumptionTime; + } FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, recipeList, fuel, fuelIntervall); return egg; From 0982cd64f4776201094cd7601721139dd47004cc Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Dec 2015 17:31:57 +0100 Subject: [PATCH 191/459] Adding nice config time parsing --- .../igotyou/FactoryMod/ConfigParser.java | 74 +++++++++++++++++-- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index fc2c53e3..755d22d4 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -54,19 +54,18 @@ public FactoryModManager parse() { boolean citadelEnabled = config.getBoolean("citadel_enabled", true); Material factoryInteractionMaterial = Material.getMaterial(config .getString("factory_interaction_material", "STICK")); - boolean disableExperience = config.getBoolean("disable_experience", - false); // TODO disable experience boolean disableNether = config.getBoolean("disable_nether", false); if (disableNether) { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } - defaultUpdateTime = config.getInt("default_update_time", 5); + defaultUpdateTime = (int) parseTime(config.getString( + "default_update_time", "5")); defaultFuel = parseItemMap(config .getConfigurationSection("default_fuel")); - defaultFuelConsumptionTime = config.getInt( - "default_fuel_consumption_intervall", 20); + defaultFuelConsumptionTime = (int) parseTime(config.getString( + "default_fuel_consumption_intervall", "20")); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); manager = new FactoryModManager(plugin, factoryInteractionMaterial, @@ -147,7 +146,7 @@ public IFactoryEgg parseFactoryEgg(ConfigurationSection config) { case "FCC": // Furnace, chest, craftingtable int update; if (config.contains("updatetime")) { - update = config.getInt("updatetime"); + update = (int)parseTime(config.getString("updatetime")); } else { update = defaultUpdateTime; } @@ -163,7 +162,7 @@ public IFactoryEgg parseFactoryEgg(ConfigurationSection config) { } int fuelIntervall; if (config.contains("fuel_consumption_intervall")) { - fuelIntervall = config.getInt("fuel_consumption_intervall"); + fuelIntervall = (int)parseTime(config.getString("fuel_consumption_intervall")); } else { fuelIntervall = defaultFuelConsumptionTime; } @@ -225,7 +224,7 @@ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { private IRecipe parseRecipe(ConfigurationSection config) { IRecipe result; String name = config.getString("name"); - int productionTime = config.getInt("production_time"); + int productionTime = (int)parseTime(config.getString("production_time")); switch (config.getString("type")) { case "PRODUCTION": ItemMap input = parseItemMap(config @@ -349,4 +348,63 @@ private static List parsePotionEffects( return potionEffects; } + private long parseTime(String arg) { + long result = 0; + boolean set = true; + try { + result += Long.parseLong(arg); + } catch (NumberFormatException e) { + set = false; + } + if (set) { + return result; + } + while (!arg.equals("")) { + int length = 0; + switch (arg.charAt(arg.length() - 1)) { + case 't': // ticks + long ticks = getLastNumber(arg); + result += ticks; + length = String.valueOf(ticks).length() + 1; + break; + case 's': // seconds + long seconds = getLastNumber(arg); + result += 20 * seconds; // 20 ticks in a second + length = String.valueOf(seconds).length() + 1; + break; + case 'm': // minutes + long minutes = getLastNumber(arg); + result += 20 * 60 * minutes; + length = String.valueOf(minutes).length() + 1; + break; + case 'h': // hours + long hours = getLastNumber(arg); + result += 20 * 3600 * hours; + length = String.valueOf(hours).length() + 1; + break; + case 'd': // days, mostly here to define a 'never' + long days = getLastNumber(arg); + result += 20 * 3600 * 24 * days; + length = String.valueOf(days).length() + 1; + default: + plugin.severe("Invalid time value in config:" + arg); + } + arg = arg.substring(0, arg.length() - length); + } + return result; + } + + private long getLastNumber(String arg) { + StringBuilder number = new StringBuilder(); + for (int i = arg.length() - 2; i >= 0; i--) { + if (Character.isDigit(arg.charAt(i))) { + number.insert(0, arg.substring(i, i + 1)); + } else { + break; + } + } + long result = Long.parseLong(number.toString()); + return result; + } + } From 73d2a626faa333f1cb1dcc10f770fdcc444a2b7c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 28 Dec 2015 05:32:43 +0100 Subject: [PATCH 192/459] First persistence implementation and some config parsing fixes --- .../igotyou/FactoryMod/ConfigParser.java | 113 ++++++----- .../github/igotyou/FactoryMod/Factory.java | 9 + .../github/igotyou/FactoryMod/FactoryMod.java | 47 +++++ .../igotyou/FactoryMod/FactoryModManager.java | 45 +++-- .../igotyou/FactoryMod/FactoryModPlugin.java | 34 ---- .../FactoryMod/eggs/FurnCraftChestEgg.java | 20 +- .../factories/FurnCraftChestFactory.java | 48 ++++- .../FurnCraftChestInteractionManager.java | 8 +- .../persistence/FactoryFileHandler.java | 109 +++++++++++ .../powerManager/FurnacePowerManager.java | 12 +- .../FactoryMod/recipes/CompactingRecipe.java | 4 +- .../recipes/DecompactingRecipe.java | 4 +- .../FactoryMod/recipes/InputRecipe.java | 4 +- .../FactoryMod/recipes/ProductionRecipe.java | 12 +- .../FactoryMod/recipes/Upgraderecipe.java | 5 +- .../repairManager/IRepairManager.java | 12 +- .../PercentageHealthRepairManager.java | 8 + .../igotyou/FactoryMod/utility/ItemMap.java | 179 ++++++------------ 18 files changed, 422 insertions(+), 251 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/FactoryMod.java delete mode 100644 src/com/github/igotyou/FactoryMod/FactoryModPlugin.java create mode 100644 src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 755d22d4..ec3167ef 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -5,6 +5,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map.Entry; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; @@ -30,14 +31,16 @@ import com.google.common.collect.Lists; public class ConfigParser { - private FactoryModPlugin plugin; + private FactoryMod plugin; private HashMap recipes; private FactoryModManager manager; private int defaultUpdateTime; - private ItemMap defaultFuel; + private ItemStack defaultFuel; private int defaultFuelConsumptionTime; + private HashMap upgradeEggs; + private HashMap> recipeLists; - public ConfigParser(FactoryModPlugin plugin) { + public ConfigParser(FactoryMod plugin) { this.plugin = plugin; } @@ -51,10 +54,10 @@ public FactoryModManager parse() { plugin.saveDefaultConfig(); plugin.reloadConfig(); FileConfiguration config = plugin.getConfig(); - boolean citadelEnabled = config.getBoolean("citadel_enabled", true); + boolean citadelEnabled = plugin.getServer().getPluginManager() + .isPluginEnabled("Citadel"); Material factoryInteractionMaterial = Material.getMaterial(config .getString("factory_interaction_material", "STICK")); - // TODO disable experience boolean disableNether = config.getBoolean("disable_nether", false); if (disableNether) { plugin.getServer().getPluginManager() @@ -62,8 +65,9 @@ public FactoryModManager parse() { } defaultUpdateTime = (int) parseTime(config.getString( "default_update_time", "5")); - defaultFuel = parseItemMap(config - .getConfigurationSection("default_fuel")); + defaultFuel = parseItemMap( + config.getConfigurationSection("default_fuel")) + .getItemStackRepresentation().get(0); defaultFuelConsumptionTime = (int) parseTime(config.getString( "default_fuel_consumption_intervall", "20")); int redstonePowerOn = config.getInt("redstone_power_on", 7); @@ -72,8 +76,16 @@ public FactoryModManager parse() { citadelEnabled, redstonePowerOn, redstoneRecipeChange); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); - parseRecipes(config.getConfigurationSection("recipes")); + upgradeEggs = new HashMap(); + recipeLists = new HashMap>(); parseFactories(config.getConfigurationSection("factories")); + parseRecipes(config.getConfigurationSection("recipes")); + assignRecipesToFactories(); + // Some recipes need references to factories and all factories need + // references to recipes, so we parse all factories first, set their + // recipes to null, store the names of the recipes in a map here, parse + // the recipes which can already get the references to the factories and + // then fix the recipe references for the factories plugin.info("Parsed complete config"); return manager; } @@ -125,13 +137,15 @@ private void parseFactory(ConfigurationSection config) { IFactoryEgg egg = null; switch (config.getString("type")) { case "FCC": // Furnace, chest, craftingtable - egg = parseFactoryEgg(config); + egg = parseFCCFactory(config); ItemMap setupCost = parseItemMap(config .getConfigurationSection("setupcost")); manager.addFactoryCreationEgg(FurnCraftChestStructure.class, setupCost, egg); break; - + case "FCCUPGRADE": + egg = parseFCCFactory(config); + upgradeEggs.put(egg.getName(), egg); default: plugin.severe("Could not identify factory type " + config.getString("type")); @@ -140,40 +154,32 @@ private void parseFactory(ConfigurationSection config) { } - public IFactoryEgg parseFactoryEgg(ConfigurationSection config) { + public IFactoryEgg parseFCCFactory(ConfigurationSection config) { String name = config.getString("name"); - switch (config.getString("type")) { - case "FCC": // Furnace, chest, craftingtable - int update; - if (config.contains("updatetime")) { - update = (int)parseTime(config.getString("updatetime")); - } else { - update = defaultUpdateTime; - } - List recipeList = new LinkedList(); - for (String recipe : config.getStringList("recipes")) { - recipeList.add(recipes.get(recipe)); - } - ItemMap fuel; - if (config.contains("fuel")) { - fuel = parseItemMap(config.getConfigurationSection("fuel")); - } else { - fuel = defaultFuel; - } - int fuelIntervall; - if (config.contains("fuel_consumption_intervall")) { - fuelIntervall = (int)parseTime(config.getString("fuel_consumption_intervall")); - } else { - fuelIntervall = defaultFuelConsumptionTime; - } - FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, - recipeList, fuel, fuelIntervall); - return egg; - default: - plugin.severe("Could not identify factory type " - + config.getString("type")); - return null; + int update; + if (config.contains("updatetime")) { + update = (int) parseTime(config.getString("updatetime")); + } else { + update = defaultUpdateTime; } + ItemStack fuel; + if (config.contains("fuel")) { + fuel = parseItemMap(config.getConfigurationSection("fuel")) + .getItemStackRepresentation().get(0); + } else { + fuel = defaultFuel; + } + int fuelIntervall; + if (config.contains("fuel_consumption_intervall")) { + fuelIntervall = (int) parseTime(config + .getString("fuel_consumption_intervall")); + } else { + fuelIntervall = defaultFuelConsumptionTime; + } + FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, null, fuel, + fuelIntervall); + recipeLists.put(egg, config.getStringList("recipes")); + return egg; } /** @@ -224,7 +230,8 @@ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { private IRecipe parseRecipe(ConfigurationSection config) { IRecipe result; String name = config.getString("name"); - int productionTime = (int)parseTime(config.getString("production_time")); + int productionTime = (int) parseTime(config + .getString("production_time")); switch (config.getString("type")) { case "PRODUCTION": ItemMap input = parseItemMap(config @@ -260,8 +267,12 @@ private IRecipe parseRecipe(ConfigurationSection config) { case "UPGRADE": ItemMap upgradeCost = parseItemMap(config .getConfigurationSection("input")); - IFactoryEgg egg = parseFactoryEgg(config - .getConfigurationSection("factory")); + String upgradeName = config.getString("factoryname"); + IFactoryEgg egg = upgradeEggs.get(upgradeName); + if (egg == null) { + plugin.severe("Could not find factory " + upgradeName + + " for upgrade recipe " + name); + } result = new Upgraderecipe(name, productionTime, upgradeCost, egg); break; default: @@ -273,6 +284,18 @@ private IRecipe parseRecipe(ConfigurationSection config) { return result; } + public void assignRecipesToFactories() { + for (Entry> entry : recipeLists.entrySet()) { + if (entry.getKey() instanceof FurnCraftChestEgg) { + List recipeList = new LinkedList(); + for (String recipeName : entry.getValue()) { + recipeList.add(recipes.get(recipeName)); + } + ((FurnCraftChestEgg) entry.getKey()).setRecipes(recipeList); + } + } + } + /** * Creates an itemmap containing all the items listed in the given config * section diff --git a/src/com/github/igotyou/FactoryMod/Factory.java b/src/com/github/igotyou/FactoryMod/Factory.java index e02e4898..eccf4c97 100644 --- a/src/com/github/igotyou/FactoryMod/Factory.java +++ b/src/com/github/igotyou/FactoryMod/Factory.java @@ -107,4 +107,13 @@ public String getName() { */ public abstract void attemptToActivate(Player p); + /** + * Gets all the information needed to recreate this factory at a later + * point. The implementation of this method should be in line with the egg + * of the factory type to ensure persistence past restarts without problems + * + * @return Everything needed to recreate this factory + */ + public abstract String serialize(); + } diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java new file mode 100644 index 00000000..1e41c4f4 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -0,0 +1,47 @@ +package com.github.igotyou.FactoryMod; + +import com.github.igotyou.FactoryMod.listeners.CompactItemListener; +import com.github.igotyou.FactoryMod.listeners.FactoryModListener; + +import vg.civcraft.mc.civmodcore.ACivMod; + +public class FactoryMod extends ACivMod { + private static FactoryModManager manager; + private static FactoryMod plugin; + + public void onEnable() { + super.onEnable(); + plugin = this; + ConfigParser cp = new ConfigParser(this); + manager = cp.parse(); + manager.loadFactories(); + registerListeners(); + } + + public void onDisable() { + manager.saveFactories(); + plugin.info("Shutting down"); + } + + public static FactoryModManager getManager() { + return manager; + } + + public String getPluginName() { + return "FactoryMod"; + } + + public static FactoryMod getPlugin() { + return plugin; + } + + private void registerListeners() { + plugin.getServer().getPluginManager() + .registerEvents(new FactoryModListener(manager), plugin); + plugin.getServer() + .getPluginManager() + .registerEvents( + new CompactItemListener(manager.getCompactLore()), + plugin); + } +} diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index ce0eafae..d34d6410 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -13,6 +13,7 @@ import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.persistence.FactoryFileHandler; import com.github.igotyou.FactoryMod.utility.ItemMap; /** @@ -20,7 +21,8 @@ * */ public class FactoryModManager { - protected FactoryModPlugin plugin; + protected FactoryMod plugin; + private FactoryFileHandler fileHandler; private HashMap, HashMap> factoryCreationRecipes; private HashMap locations; private HashMap eggs; @@ -34,14 +36,17 @@ public class FactoryModManager { private int redstoneRecipeChange; private String compactLore; - public FactoryModManager(FactoryModPlugin plugin, - Material factoryInteractionMaterial, boolean citadelEnabled, int redstonePowerOn, int redstoneRecipeChange) { + public FactoryModManager(FactoryMod plugin, + Material factoryInteractionMaterial, boolean citadelEnabled, + int redstonePowerOn, int redstoneRecipeChange) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; + fileHandler = new FactoryFileHandler(this); + factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); eggs = new HashMap(); @@ -232,6 +237,16 @@ public void addFactoryUpgradeEgg(String factoryUpgradingFrom, ItemMap cost, this.eggs.put(egg.getName(), egg); } + public void saveFactories() { + plugin.info("Attempting to save factory data"); + fileHandler.save(factories); + } + + public void loadFactories() { + plugin.info("Attempting to load factory data"); + fileHandler.load(eggs); + } + /** * Checks whether a specific material is a possible center block for a * factory and whether a factory could potentionally created from a block @@ -270,23 +285,25 @@ public boolean isPossibleInteractionBlock(Material m) { public IFactoryEgg getEgg(String name) { return eggs.get(name); } - + /** - * Gets the Redstone power level necessary to active a factory. - * Fall below this level and the factory will deactivate. - * - * @return The power level on which factory activation or de-activation hinges + * Gets the Redstone power level necessary to active a factory. Fall below + * this level and the factory will deactivate. + * + * @return The power level on which factory activation or de-activation + * hinges */ public int getRedstonePowerOn() { return this.redstonePowerOn; } - + /** - * Gets the Redstone power change necessary to alter the recipe setting of a factory. - * Any change >= this level, either positive or negative, will attempt to alter the recipe - * (implementation depending). - * - * @return The amount of Redstone power change necessary to alter recipe setting of a factory. + * Gets the Redstone power change necessary to alter the recipe setting of a + * factory. Any change >= this level, either positive or negative, will + * attempt to alter the recipe (implementation depending). + * + * @return The amount of Redstone power change necessary to alter recipe + * setting of a factory. */ public int getRedstoneRecipeChange() { return this.redstoneRecipeChange; diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java deleted file mode 100644 index 62070225..00000000 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.igotyou.FactoryMod; - -import com.github.igotyou.FactoryMod.listeners.FactoryModListener; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; - -import vg.civcraft.mc.civmodcore.ACivMod; - -public class FactoryModPlugin extends ACivMod { - private static FactoryModManager manager; - private static FactoryModPlugin plugin; - - public void onEnable() { - super.onEnable(); - plugin = this; - ConfigParser cp = new ConfigParser(this); - manager = cp.parse(); - plugin.getServer().getPluginManager().registerEvents(new FactoryModListener(manager),plugin); - } - - public void onDisable() { - } - - public static FactoryModManager getManager() { - return manager; - } - - public String getPluginName() { - return "FactoryMod"; - } - - public static FactoryModPlugin getPlugin() { - return plugin; - } -} diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index dbec4d80..6b45fdc0 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -4,6 +4,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; @@ -13,17 +14,16 @@ import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; -import com.github.igotyou.FactoryMod.utility.ItemMap; public class FurnCraftChestEgg implements IFactoryEgg { private String name; private int updateTime; private List recipes; - private ItemMap fuel; + private ItemStack fuel; private int fuelConsumptionIntervall; public FurnCraftChestEgg(String name, int updateTime, - List recipes, ItemMap fuel, int fuelConsumptionIntervall) { + List recipes, ItemStack fuel, int fuelConsumptionIntervall) { this.name = name; this.updateTime = updateTime; this.recipes = recipes; @@ -56,19 +56,23 @@ public int getUpdateTime() { return updateTime; } - public ItemMap getFuel() { + public ItemStack getFuel() { return fuel; } public List getRecipes() { return recipes; } + + public void setRecipes(List recipes) { + this.recipes = recipes; + } public int getFuelConsumptionIntervall() { return fuelConsumptionIntervall; } - public Factory revive(List blocks, int health, String selectedRecipe) { + public Factory revive(List blocks, int health, String selectedRecipe, int productionTimer) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); FurnacePowerManager fpm = new FurnacePowerManager(fuel, fuelConsumptionIntervall); @@ -87,6 +91,12 @@ public Factory revive(List blocks, int health, String selectedRecipe) { if (fccf.getCurrentRecipe() == null && recipes.size() != 0) { fccf.setRecipe(recipes.get(0)); } + if (productionTimer != 0) { + fccf.attemptToActivate(null); + if (fccf.isActive()) { + fccf.setProductionTimer(productionTimer); + } + } return fccf; } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 02aad9af..f25268a5 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.Factory; -import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; @@ -22,7 +22,6 @@ import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; -import com.github.igotyou.FactoryMod.utility.ItemMap; /** * Represents a "classic" factory, which consists of a furnace as powersource, a @@ -213,12 +212,12 @@ public void run() { // increase the production timer currentProductionTimer += updateTime; // schedule next update - FactoryModPlugin + FactoryMod .getPlugin() .getServer() .getScheduler() .scheduleSyncDelayedTask( - FactoryModPlugin.getPlugin(), this, + FactoryMod.getPlugin(), this, (long) updateTime); } // if there is no fuel Available turn off the factory @@ -244,12 +243,12 @@ else if (currentProductionTimer >= currentRecipe currentProductionTimer = 0; if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); - FactoryModPlugin + FactoryMod .getPlugin() .getServer() .getScheduler() .scheduleSyncDelayedTask( - FactoryModPlugin.getPlugin(), this, + FactoryMod.getPlugin(), this, (long) updateTime); // keep going } else { @@ -288,6 +287,16 @@ public void setRecipe(IRecipe pr) { } } + /** + * Sets the internal production timer + * + * @param timer + * New timer + */ + public void setProductionTimer(int timer) { + this.currentProductionTimer = timer; + } + /** * @return Whether enough materials are available to run the currently * selected recipe at least once @@ -296,7 +305,7 @@ public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } - public void upgrade(String name, List recipes, ItemMap fuel, + public void upgrade(String name, List recipes, ItemStack fuel, int fuelConsumptionIntervall, int updateTime) { this.name = name; this.recipes = recipes; @@ -310,4 +319,29 @@ public void upgrade(String name, List recipes, ItemMap fuel, } } + public String serialize() { + StringBuilder sb = new StringBuilder(); + String separator = "#"; + sb.append("FCC"); + sb.append(separator); + sb.append(getName()); + sb.append(separator); + sb.append(rm.getHealth()); + sb.append(separator); + sb.append(currentProductionTimer); + sb.append(separator); + sb.append(currentRecipe); + sb.append(separator); + for (Block b : mbs.getAllBlocks()) { + sb.append(b.getWorld().getName()); + sb.append(separator); + sb.append(b.getX()); + sb.append(separator); + sb.append(b.getY()); + sb.append(separator); + sb.append(b.getZ()); + } + return sb.toString(); + } + } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index ff612467..678dfc4b 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -20,7 +20,7 @@ import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; -import com.github.igotyou.FactoryMod.FactoryModPlugin; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.IRecipe; @@ -45,7 +45,7 @@ public void setFactory(FurnCraftChestFactory fccf) { } private void prepCitadel() { - if (FactoryModPlugin.getManager().isCitadelEnabled()) { + if (FactoryMod.getManager().isCitadelEnabled()) { rm = Citadel.getReinforcementManager(); } else { rm = null; @@ -69,7 +69,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { if (e.getNewCurrent() == e.getOldCurrent()) { return; } - int threshold = FactoryModPlugin.getManager().getRedstonePowerOn(); + int threshold = FactoryMod.getManager().getRedstonePowerOn(); boolean newState = false; if (e.getBlock().getLocation().equals(fccf.getFurnace().getLocation())) { if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { @@ -91,7 +91,7 @@ public void redStoneEvent(BlockRedstoneEvent e) { ((FurnCraftChestStructure) fccf.getMultiBlockStructure()).getCraftingTable())) { // Can't change recipe while active. int change = e.getOldCurrent() - e.getNewCurrent(); - if (Math.abs(change) >= FactoryModPlugin.getManager().getRedstoneRecipeChange()) { + if (Math.abs(change) >= FactoryMod.getManager().getRedstoneRecipeChange()) { List currentRecipes = fccf.getRecipes(); if (currentRecipes.size() == 0) { return; diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java new file mode 100644 index 00000000..565ec71d --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java @@ -0,0 +1,109 @@ +package com.github.igotyou.FactoryMod.persistence; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.bukkit.World; +import org.bukkit.block.Block; + +import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.recipes.IRecipe; + +public class FactoryFileHandler { + private FactoryMod plugin; + private FactoryModManager manager; + File saveFile; + File backup; + + public FactoryFileHandler(FactoryModManager manager) { + plugin = FactoryMod.getPlugin(); + this.manager = manager; + saveFile = new File(plugin.getDataFolder().getAbsolutePath() + + File.separator + "factoryData"); + backup = new File(plugin.getDataFolder().getAbsolutePath() + + File.separator + "factoryDataPreviousSave"); + } + + public void save(Collection factories) { + if (saveFile.exists()) { + // old save file exists, so it is our new backup now + if (backup.exists()) { + backup.delete(); + } + saveFile.renameTo(backup); + } + try { + saveFile.createNewFile(); + FileWriter fw = new FileWriter(saveFile); + BufferedWriter buff = new BufferedWriter(fw); + for (Factory f : factories) { + buff.write(f.serialize()); + buff.newLine(); + } + buff.flush(); + buff.close(); + } catch (Exception e) { + // In case anything goes wrong while saving we always keep the + // latest valid backup + plugin.severe("Fatal error while trying to save factory data"); + e.printStackTrace(); + saveFile.delete(); + } + } + + public void load(Map eggs) { + if (saveFile.exists()) { + loadFromFile(saveFile, eggs); + } else { + plugin.warning("No default save file found"); + if (backup.exists()) { + plugin.info("Backup file found, loading backup"); + loadFromFile(backup, eggs); + } else { + plugin.warning("No backup save file found. If you are not starting this plugin for the first time you should be worried now"); + } + } + } + + private void loadFromFile(File f, Map eggs) { + try { + FileReader fr = new FileReader(f); + BufferedReader reader = new BufferedReader(fr); + String line = reader.readLine(); + while (line != null) { + String[] content = line.split("#"); + switch (content[0]) { + case "FCC": + FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs + .get(content[1]); + int health = Integer.parseInt(content[2]); + int productionTimer = Integer.parseInt(content[3]); + String selectedRecipe = content[4]; + List blocks = new LinkedList(); + for (int i = 5; i < 17; i += 4) { + World w = plugin.getServer().getWorld(content[i]); + int x = Integer.parseInt(content[i + 1]); + int y = Integer.parseInt(content[i + 2]); + int z = Integer.parseInt(content[i + 3]); + } + egg.revive(blocks, health, selectedRecipe, productionTimer); + } + } + reader.close(); + } catch (Exception e) { + plugin.severe("Fatal error while loading factory data"); + e.printStackTrace(); + } + } +} diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index 1c22ea37..fcdd8e17 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -12,19 +12,19 @@ * */ public class FurnacePowerManager implements IPowerManager { - private ItemMap fuel; + private ItemStack fuel; private FurnCraftChestFactory fccf; private int powerCounter; private int fuelConsumptionIntervall; - public FurnacePowerManager(FurnCraftChestFactory fccf, ItemMap fuel, + public FurnacePowerManager(FurnCraftChestFactory fccf, ItemStack fuel, int fuelConsumptionIntervall) { this.fccf = fccf; this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; } - public FurnacePowerManager(ItemMap fuel, int fuelConsumptionIntervall) { + public FurnacePowerManager(ItemStack fuel, int fuelConsumptionIntervall) { this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; } @@ -42,7 +42,7 @@ public boolean powerAvailable() { ItemMap im = new ItemMap(); im.addItemStack(fi.getFuel()); im.addItemStack(fi.getSmelting()); - return im.contains(fuel); + return im.getAmount(fuel) != 0; } public int getPowerConsumptionIntervall() { @@ -59,9 +59,7 @@ public void setPowerCounter(int amount) { public void consumePower() { FurnaceInventory fi = fccf.getFurnaceInventory(); - for (ItemStack is : fuel.getItemStackRepresentation()) { - fi.removeItem(is); - } + fi.removeItem(fuel); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 600aa172..2826db78 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -31,7 +31,7 @@ public CompactingRecipe(ItemMap input, List excludedMaterial, } public boolean enoughMaterialAvailable(Inventory i) { - if (!input.isContainedIn(new ItemMap(i))) { + if (!input.isContainedIn(i)) { return false; } for (ItemStack is : i.getContents()) { @@ -53,7 +53,7 @@ public String getRecipeName() { } public void applyEffect(Inventory i, Factory f) { - if (input.isContainedIn(new ItemMap(i))) { + if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { if (compactable(is)) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 1a170c8c..ca0aab97 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -27,7 +27,7 @@ public DecompactingRecipe(ItemMap input, String name, int productionTime, } public boolean enoughMaterialAvailable(Inventory i) { - if (!input.isContainedIn(new ItemMap(i))) { + if (!input.isContainedIn(i)) { return false; } for (ItemStack is : i.getContents()) { @@ -42,7 +42,7 @@ public boolean enoughMaterialAvailable(Inventory i) { } public void applyEffect(Inventory i, Factory f) { - if (input.isContainedIn(new ItemMap(i))) { + if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { ItemMeta im = is.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 5cd43340..1eb018bb 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -67,7 +67,7 @@ public ItemMap getInput() { } public boolean enoughMaterialAvailable(Inventory i) { - return input.isContainedIn(new ItemMap(i)); + return input.isContainedIn(i); } /** @@ -92,7 +92,7 @@ protected List createLoredStacksForInfo(Inventory i) { ItemMap inventoryMap = new ItemMap(i); ItemMap possibleRuns = new ItemMap(); for (Entry entry : input.getEntrySet()) { - if (inventoryMap.getAmount(entry.getKey()) != null) { + if (inventoryMap.getAmount(entry.getKey()) != 0) { possibleRuns.addItemAmount( entry.getKey(), inventoryMap.getAmount(entry.getKey()) diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 9c46678e..f45d5b00 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -31,8 +31,7 @@ public ItemMap getOutput() { } public int getCurrentMultiplier(Inventory i) { - ItemMap im = new ItemMap(i); - return input.getMultiplesContainedIn(im); + return input.getMultiplesContainedIn(i); } public ItemMap getCurrentOutput(Inventory i) { @@ -43,7 +42,7 @@ public ItemMap getCurrentOutput(Inventory i) { public List getOutputRepresentation(Inventory i) { List stacks = output.getItemStackRepresentation(); - int possibleRuns = input.getMultiplesContainedIn(new ItemMap(i)); + int possibleRuns = input.getMultiplesContainedIn(i); for (ItemStack is : stacks) { ItemStackUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + String.valueOf(possibleRuns) @@ -59,12 +58,13 @@ public List getInputRepresentation(Inventory i) { public void applyEffect(Inventory i, Factory f) { ItemMap toRemove = input.clone(); ItemMap toAdd = output.clone(); - if (new ItemMap(i).contains(toRemove)) + if (toRemove.isContainedIn(i)) { for (ItemStack is : toRemove.getItemStackRepresentation()) { i.removeItem(is); } - for (ItemStack is : toAdd.getItemStackRepresentation()) { - i.addItem(is); + for (ItemStack is : toAdd.getItemStackRepresentation()) { + i.addItem(is); + } } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 37e06dc7..6685cb5d 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -25,8 +25,7 @@ public Upgraderecipe(String name, int productionTime, ItemMap input, IFactoryEgg } public void applyEffect(Inventory i, Factory f) { - ItemMap invMap = new ItemMap(i); - if (invMap.contains(input) && f instanceof FurnCraftChestFactory) { + if (input.isContainedIn(i) && f instanceof FurnCraftChestFactory) { for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } @@ -49,7 +48,7 @@ public List getInputRepresentation(Inventory i) { ItemMap inventoryMap = new ItemMap(i); ItemMap possibleRuns = new ItemMap(); for (Entry entry : input.getEntrySet()) { - if (inventoryMap.getAmount(entry.getKey()) != null) { + if (inventoryMap.getAmount(entry.getKey()) != 0) { possibleRuns.addItemAmount( entry.getKey(), inventoryMap.getAmount(entry.getKey()) diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java index 40dbd7a3..5c41bffb 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -11,9 +11,14 @@ public interface IRepairManager { public void breakIt(); /** - * @return How much factory the factory represented currently has + * @return How much health the factory represented currently has as a nice string for output messages */ public String getHealth(); + + /** + * @return How much health the factory represented currently has + */ + public int getRawHealth(); /** * @return Whether the factory represented is currently at full health @@ -33,5 +38,10 @@ public interface IRepairManager { * @return Whether the factory is in disrepair currently */ public boolean inDisrepair(); + + /** + * Set this factorys health + */ + public void setHealth(int health); } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index f35fe09e..5b22bbb3 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -26,4 +26,12 @@ public void repair(int amount) { public void breakIt() { health = 0; } + + public int getRawHealth() { + return health; + } + + public void setHealth(int health) { + this.health = health; + } } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 2533d891..9929406b 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -94,29 +94,22 @@ public void addItemStack(ItemStack input) { /** * Removes the given ItemStack from this map. Only the amount of the given - * ItemStack will be removed, not all of them. Use the safe parameter to - * specify whether stacks with negative amounts as a result in the map - * should be allowed or not. + * ItemStack will be removed, not all of them. If the amount of the given + * itemstack is bigger than the existing ones in this map, not more than the + * amount in this map will be removed * * @param input * ItemStack to remove - * @param safe - * true to forbid stacks with negative amounts, false to allow - * them */ - public void removeItemStack(ItemStack input, boolean safe) { + public void removeItemStack(ItemStack input) { ItemStack is = createMapConformCopy(input); - Integer i; - if ((i = items.get(is)) != null) { - int newSum = i - input.getAmount(); - if ((safe && newSum > 0) || !safe) { - items.put(is, i - input.getAmount()); - totalItems -= input.getAmount(); - } - } else { - if (!safe) { - items.put(is, -1 * input.getAmount()); - totalItems -= input.getAmount(); + Integer value = items.get(is); + if (value != null) { + int newVal = value - input.getAmount(); + if (newVal > 0) { + items.put(is, newVal); + } else { + items.remove(is); } } } @@ -132,24 +125,6 @@ public void removeItemStackCompletly(ItemStack input) { items.remove(input); } - /** - * Removes all the given ItemStacks from this map. Only the amount of the - * given ItemStack will be removed, not the complete instance from the map. - * Use the safe parameter to specify whether stacks with negative amounts as - * a result in the map should be allowed or not. - * - * @param stacks - * ItemStacks to remove - * @param safe - * true to forbid stacks with negative amounts, false to allow - * them - */ - public void removeAll(Collection stacks, boolean safe) { - for (ItemStack stack : stacks) { - removeItemStack(stack, safe); - } - } - public int hashCode() { int res = 0; for (Entry entry : items.entrySet()) { @@ -195,16 +170,6 @@ public void update(Inventory inv) { } } - /** - * Merges an existing item map into this instance - * - * @param im - * Map to merge - */ - public void addItemMap(ItemMap im) { - addEntrySet(im.getEntrySet()); - } - public void addEntrySet(Set> entries) { for (Entry entry : entries) { addItemAmount(entry.getKey(), entry.getValue()); @@ -340,8 +305,21 @@ public ItemMap getStacksByLore(List lore) { * Exact ItemStack to search for * @return amount of items like the given stack in this map */ - public Integer getAmount(ItemStack is) { - return items.get(createMapConformCopy(is)); + public int getAmount(ItemStack is) { + ItemMap matSubMap = getStacksByMaterial(is); + int amount = 0; + for (Entry entry : matSubMap.getEntrySet()) { + ItemStack current = entry.getKey(); + if ((is.getDurability() == -1 || is.getDurability() == current + .getDurability()) + && is.getEnchantments().equals(current.getEnchantments()) + && (current.getItemMeta().getLore() == null || current + .getItemMeta().getLore() + .equals(is.getItemMeta().getLore()))) { + amount += entry.getValue(); + } + } + return amount; } /** @@ -362,45 +340,17 @@ public Set> getEntrySet() { return ((HashMap) items.clone()).entrySet(); } - /** - * Compares this ItemMap to a given one and returns a map containing the - * exact differences. For example if this instance has 5 stone and the given - * ItemMap has 10 stone, then the result will contain 5 stone. If instance - * and argument were switched around, the result would contain -5 stone, - * which expresses that the given ItemMap has 5 stone less than this - * instance. If an amount is identical it wont be added to the diff map - * - * @param im - * ItemMap to compare to - * @return ItemMap containing the exact differences between this instance - * and a given map + // autoformatting messed this up a bit, this method isnt needed anymore, but + // shouldnt be removed yet + /* + * public ItemMap getDifference(Inventory inv) { ItemMap res = new + * ItemMap(); ItemMap invMap = new ItemMap(inv); for (Entry entry : getEntrySet()) { int amount = entry.getValue(); int + * invAmount = invMap.getAmount(entry.getKey()); if (amount != invAmount) { + * res.addItemAmount(entry.getKey(), invAmount - amount); } + * invMap.removeItemStackCompletly(entry.getKey()); } res.merge(invMap); + * return res; } */ - public ItemMap getDifference(ItemMap im) { - ItemMap result = new ItemMap(); - Set> firstSet = getEntrySet(); - Set> secondSet = im.getActualEntrySet(); - for (Entry entry : firstSet) { - Integer pulled = im.getAmount(entry.getKey()); - if (pulled != null) { - if ((pulled - entry.getValue()) != 0) { - result.addItemAmount(entry.getKey(), - pulled - entry.getValue()); - } - im.removeItemStackCompletly(entry.getKey()); - } else { - result.addItemAmount(entry.getKey(), entry.getValue() * -1); - } - } - result.addEntrySet(secondSet); - return result; - } - - /** - * @return An entry set of the hashmap in this itemmap and not just a copy - */ - private Set> getActualEntrySet() { - return items.entrySet(); - } /** * Checks whether an inventory contains exactly what's described in this @@ -412,22 +362,30 @@ private Set> getActualEntrySet() { * not */ public boolean containedExactlyIn(Inventory i) { - return getDifference(new ItemMap(i)).getTotalItemAmount() == 0; + ItemMap invMap = new ItemMap(i); + for (Entry entry : getEntrySet()) { + if (!entry.getValue().equals(invMap.getAmount(entry.getKey()))) { + return false; + } + } + return true; } /** - * Checks whether this instance is completly contained in the given ItemMap, - * which means every stack in this instance is also in the given map and the - * amount in the given map is either the same or bigger as in this instance + * Checks whether this instance is completly contained in the given + * inventory, which means every stack in this instance is also in the given + * inventory and the amount in the given inventory is either the same or + * bigger as in this instance * * @param im - * ItemStack to check - * @return true if this instance is completly contained in the given stack, - * false if not + * inventory to check + * @return true if this instance is completly contained in the given + * inventory, false if not */ - public boolean isContainedIn(ItemMap im) { - for (Entry entry : getDifference(im).getEntrySet()) { - if (entry.getValue() < 0) { + public boolean isContainedIn(Inventory i) { + ItemMap invMap = new ItemMap(i); + for (Entry entry : getEntrySet()) { + if (entry.getValue() < invMap.getAmount(entry.getKey())) { return false; } } @@ -452,12 +410,13 @@ public String toString() { * @return How often this map is contained in the given one or * Integer.MAX_VALUE if this instance is empty */ - public int getMultiplesContainedIn(ItemMap im) { + public int getMultiplesContainedIn(Inventory i) { + ItemMap invMap = new ItemMap(i); int res = Integer.MAX_VALUE; for (Entry entry : getEntrySet()) { - int pulledAmount = im.getAmount(entry.getKey()) != null ? (im - .getAmount(entry.getKey()) / getAmount(entry.getKey())) : 0; - res = Math.min(res, pulledAmount); + int pulledAmount = invMap.getAmount(entry.getKey()); + int multiples = pulledAmount/entry.getValue(); + res = Math.min(res, multiples); } return res; } @@ -476,21 +435,6 @@ public void multiplyContent(double multiplier) { } } - /** - * Checks whether this instance completly contains the given ItemMap, which - * means every stack in the given map also exists in this instance and the - * amount in the given map is either the same or smaller compared to the one - * in this instance - * - * @param im - * ItemStack to check - * @return true if this instance completly contains the given ItemStack, - * false if not - */ - public boolean contains(ItemMap im) { - return im.isContainedIn(this); - } - /** * Turns this item map into a list of ItemStacks, with amounts that do not * surpass the maximum allowed stack size for each ItemStack @@ -543,10 +487,7 @@ public boolean equals(Object o) { if (o instanceof ItemMap) { ItemMap im = (ItemMap) o; if (im.getTotalItemAmount() == getTotalItemAmount()) { - ItemMap diff = im.getDifference(this); - if (diff.getEntrySet().size() == 0) { - return true; - } + return im.getEntrySet().equals(getEntrySet()); } } return false; From e140b43d09e48ba31dea0219332358b353335c94 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Mon, 28 Dec 2015 01:19:25 -0500 Subject: [PATCH 193/459] Labelling typos Addresses https://github.com/Civcraft/FactoryMod/issues/166#issuecomment-167485189 --- config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 5d7cc2ed..32da89d5 100644 --- a/config.yml +++ b/config.yml @@ -8483,7 +8483,7 @@ production_recipes: name: Craft Compactor Crates from Oak Logs production_time: 43 inputs: - Chest: + 'Oak Log': material: LOG amount: 1248 'Iron Ingot': @@ -8499,7 +8499,7 @@ production_recipes: name: Craft Compactor Crates from Birch Logs production_time: 43 inputs: - Chest: + 'Birch Log': material: LOG amount: 1248 durability: 2 @@ -8516,7 +8516,7 @@ production_recipes: name: Craft Compactor Crates from Spruce Logs production_time: 43 inputs: - Chest: + 'Spruce Log': material: LOG amount: 1248 durability: 1 @@ -8533,7 +8533,7 @@ production_recipes: name: Craft Compactor Crates from Dark Oak Logs production_time: 43 inputs: - Chest: + 'Dark Oak Log': material: LOG_2 amount: 1248 durability: 1 @@ -8550,7 +8550,7 @@ production_recipes: name: Craft Compactor Crates from Jungle Logs production_time: 43 inputs: - Chest: + 'Jungle Log': material: LOG amount: 1248 durability: 3 @@ -8567,7 +8567,7 @@ production_recipes: name: Craft Compactor Crates from Acacia Logs production_time: 43 inputs: - Chest: + 'Acacia Log': material: LOG_2 amount: 1248 'Iron Ingot': From 582a65da1fe02b9316e63e830af93aeec449bb3f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 29 Dec 2015 19:31:42 +0100 Subject: [PATCH 194/459] File persistence works, ItemMap rework complete --- .../igotyou/FactoryMod/ConfigParser.java | 4 ++- .../github/igotyou/FactoryMod/FactoryMod.java | 3 +- .../igotyou/FactoryMod/FactoryModManager.java | 30 ++++++++++--------- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 2 +- .../FactoryMod/{ => factories}/Factory.java | 2 +- .../factories/FurnCraftChestFactory.java | 7 ++--- .../listeners/FactoryModListener.java | 2 +- .../persistence/FactoryFileHandler.java | 24 +++++++++++---- .../FactoryMod/recipes/CompactingRecipe.java | 2 +- .../recipes/DecompactingRecipe.java | 2 +- .../DeterministicEnchantingRecipe.java | 24 +++++++++++++++ .../igotyou/FactoryMod/recipes/IRecipe.java | 2 +- .../FactoryMod/recipes/ProductionRecipe.java | 2 +- .../FactoryMod/recipes/RepairRecipe.java | 2 +- .../FactoryMod/recipes/Upgraderecipe.java | 2 +- .../igotyou/FactoryMod/utility/ItemMap.java | 2 +- 17 files changed, 78 insertions(+), 36 deletions(-) rename src/com/github/igotyou/FactoryMod/{ => factories}/Factory.java (98%) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index ec3167ef..5c1aba15 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -146,6 +146,8 @@ private void parseFactory(ConfigurationSection config) { case "FCCUPGRADE": egg = parseFCCFactory(config); upgradeEggs.put(egg.getName(), egg); + manager.addFactoryUpgradeEgg(egg); + break; default: plugin.severe("Could not identify factory type " + config.getString("type")); @@ -267,7 +269,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { case "UPGRADE": ItemMap upgradeCost = parseItemMap(config .getConfigurationSection("input")); - String upgradeName = config.getString("factoryname"); + String upgradeName = config.getString("factory"); IFactoryEgg egg = upgradeEggs.get(upgradeName); if (egg == null) { plugin.severe("Could not find factory " + upgradeName diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index 1e41c4f4..f22bbd16 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -16,10 +16,11 @@ public void onEnable() { manager = cp.parse(); manager.loadFactories(); registerListeners(); + info("Successfully enabled"); } public void onDisable() { - manager.saveFactories(); + manager.shutDown(); plugin.info("Shutting down"); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index d34d6410..51f1ac3c 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -11,6 +11,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.persistence.FactoryFileHandler; @@ -26,7 +27,6 @@ public class FactoryModManager { private HashMap, HashMap> factoryCreationRecipes; private HashMap locations; private HashMap eggs; - private HashMap> upgradeRecipes; private HashSet factories; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; @@ -46,11 +46,10 @@ public FactoryModManager(FactoryMod plugin, this.redstoneRecipeChange = redstoneRecipeChange; fileHandler = new FactoryFileHandler(this); - + factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); eggs = new HashMap(); - upgradeRecipes = new HashMap>(); possibleCenterBlocks = new HashSet(); possibleInteractionBlock = new HashSet(); factories = new HashSet(); @@ -225,28 +224,31 @@ public void addFactoryCreationEgg(Class blockStructureClass, this.eggs.put(egg.getName(), egg); } - public void addFactoryUpgradeEgg(String factoryUpgradingFrom, ItemMap cost, - IFactoryEgg egg) { - HashMap eggs = upgradeRecipes - .get(factoryUpgradingFrom); - if (eggs == null) { - eggs = new HashMap(); - upgradeRecipes.put(factoryUpgradingFrom, eggs); - } - eggs.put(cost, egg); - this.eggs.put(egg.getName(), egg); + public void addFactoryUpgradeEgg(IFactoryEgg egg) { + eggs.put(egg.getName(), egg); } public void saveFactories() { plugin.info("Attempting to save factory data"); fileHandler.save(factories); } - + public void loadFactories() { plugin.info("Attempting to load factory data"); fileHandler.load(eggs); } + /** + * Called when the plugin is deactivated to first save all factories and + * then deactivate them, so the deactivated block state is saved + */ + public void shutDown() { + saveFactories(); + for (Factory f : factories) { + f.deactivate(); + } + } + /** * Checks whether a specific material is a possible center block for a * factory and whether a factory could potentionally created from a block diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 6b45fdc0..7825004b 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index 3620c02a..b1f5b2a6 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -2,7 +2,7 @@ import org.bukkit.entity.Player; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; /** diff --git a/src/com/github/igotyou/FactoryMod/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java similarity index 98% rename from src/com/github/igotyou/FactoryMod/Factory.java rename to src/com/github/igotyou/FactoryMod/factories/Factory.java index eccf4c97..6fd9cbbd 100644 --- a/src/com/github/igotyou/FactoryMod/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod; +package com.github.igotyou.FactoryMod.factories; import org.bukkit.entity.Player; diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index f25268a5..ec7f90de 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -12,7 +12,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; @@ -326,13 +325,13 @@ public String serialize() { sb.append(separator); sb.append(getName()); sb.append(separator); - sb.append(rm.getHealth()); + sb.append(rm.getRawHealth()); sb.append(separator); sb.append(currentProductionTimer); sb.append(separator); - sb.append(currentRecipe); - sb.append(separator); + sb.append(currentRecipe.getRecipeName()); for (Block b : mbs.getAllBlocks()) { + sb.append(separator); sb.append(b.getWorld().getName()); sb.append(separator); sb.append(b.getX()); diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 2cb6bf99..986b7934 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -19,8 +19,8 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; -import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; public class FactoryModListener implements Listener { diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java b/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java index 565ec71d..c55aeae7 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java +++ b/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java @@ -10,15 +10,15 @@ import java.util.List; import java.util.Map; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; -import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; -import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.factories.Factory; public class FactoryFileHandler { private FactoryMod plugin; @@ -30,9 +30,9 @@ public FactoryFileHandler(FactoryModManager manager) { plugin = FactoryMod.getPlugin(); this.manager = manager; saveFile = new File(plugin.getDataFolder().getAbsolutePath() - + File.separator + "factoryData"); + + File.separator + "factoryData.txt"); backup = new File(plugin.getDataFolder().getAbsolutePath() - + File.separator + "factoryDataPreviousSave"); + + File.separator + "factoryDataPreviousSave.txt"); } public void save(Collection factories) { @@ -77,6 +77,7 @@ public void load(Map eggs) { } private void loadFromFile(File f, Map eggs) { + int counter = 0; try { FileReader fr = new FileReader(f); BufferedReader reader = new BufferedReader(fr); @@ -87,6 +88,13 @@ private void loadFromFile(File f, Map eggs) { case "FCC": FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs .get(content[1]); + if (egg == null) { + plugin.warning("Save file contained factory named " + + content[1] + + " , but no factory with this name was found in the config"); + line = reader.readLine(); + continue; + } int health = Integer.parseInt(content[2]); int productionTimer = Integer.parseInt(content[3]); String selectedRecipe = content[4]; @@ -96,14 +104,20 @@ private void loadFromFile(File f, Map eggs) { int x = Integer.parseInt(content[i + 1]); int y = Integer.parseInt(content[i + 2]); int z = Integer.parseInt(content[i + 3]); + blocks.add(new Location(w, x, y, z).getBlock()); } - egg.revive(blocks, health, selectedRecipe, productionTimer); + Factory fac = egg.revive(blocks, health, selectedRecipe, + productionTimer); + manager.addFactory(fac); + counter++; } + line = reader.readLine(); } reader.close(); } catch (Exception e) { plugin.severe("Fatal error while loading factory data"); e.printStackTrace(); } + plugin.info("Loaded " + counter + " factory from save file"); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 2826db78..9496cdaa 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index ca0aab97..08d206f7 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; /** diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java new file mode 100644 index 00000000..4cbb14da --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -0,0 +1,24 @@ +package com.github.igotyou.FactoryMod.recipes; + +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; + +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class DeterministicEnchantingRecipe { + private Enchantment enchant; + + public DeterministicEnchantingRecipe(String name, int productionTime, + ItemMap input, Enchantment enchant) { + //super(name, productionTime, input); + this.enchant = enchant; + } + + public boolean enoughMaterialAvailable(Inventory i) { + //TODO TODO TODO + + + return false; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index cd82ed2c..10a2b012 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -2,7 +2,7 @@ import org.bukkit.inventory.Inventory; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; /** * Encapsulates a specific functionality for a FurnCraftChest factory. Each diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index f45d5b00..4c03e89a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 4e7c44e7..c467d134 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -7,7 +7,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.Factory; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 6685cb5d..1552db7f 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -9,9 +9,9 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.Factory; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index 9929406b..bb60cf7d 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -385,7 +385,7 @@ public boolean containedExactlyIn(Inventory i) { public boolean isContainedIn(Inventory i) { ItemMap invMap = new ItemMap(i); for (Entry entry : getEntrySet()) { - if (entry.getValue() < invMap.getAmount(entry.getKey())) { + if (entry.getValue() > invMap.getAmount(entry.getKey())) { return false; } } From 41d3e514c0141a66784aecfc6d3043a4a973543d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 2 Jan 2016 00:58:07 +0100 Subject: [PATCH 195/459] Working pipes --- .../igotyou/FactoryMod/ConfigParser.java | 40 ++- .../github/igotyou/FactoryMod/FactoryMod.java | 9 + .../igotyou/FactoryMod/FactoryModManager.java | 37 ++- .../FactoryMod/eggs/FurnCraftChestEgg.java | 10 +- .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 2 +- .../igotyou/FactoryMod/eggs/PipeEgg.java | 103 +++++++ .../igotyou/FactoryMod/factories/Factory.java | 55 +++- .../factories/FurnCraftChestFactory.java | 65 +--- .../igotyou/FactoryMod/factories/Pipe.java | 212 +++++++++++++ .../FurnCraftChestInteractionManager.java | 79 +++-- .../PipeInteractionManager.java | 86 ++++++ .../listeners/FactoryModListener.java | 15 +- .../powerManager/FurnacePowerManager.java | 22 +- .../FactoryMod/recipes/ProductionRecipe.java | 1 - .../FactoryMod/recipes/RepairRecipe.java | 7 +- .../repairManager/IRepairManager.java | 19 -- .../NoRepairDestroyOnBreakManager.java | 40 +++ .../FurnCraftChestStructure.java | 2 +- .../MultiBlockStructure.java | 30 +- .../FactoryMod/structures/PipeStructure.java | 133 +++++++++ .../FactoryFileHandler.java | 34 ++- .../FactoryMod/utility/MenuBuilder.java | 280 ++++++++++++++++++ 22 files changed, 1144 insertions(+), 137 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java create mode 100644 src/com/github/igotyou/FactoryMod/factories/Pipe.java create mode 100644 src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java create mode 100644 src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java rename src/com/github/igotyou/FactoryMod/{multiBlockStructures => structures}/FurnCraftChestStructure.java (97%) rename src/com/github/igotyou/FactoryMod/{multiBlockStructures => structures}/MultiBlockStructure.java (65%) create mode 100644 src/com/github/igotyou/FactoryMod/structures/PipeStructure.java rename src/com/github/igotyou/FactoryMod/{persistence => utility}/FactoryFileHandler.java (77%) create mode 100644 src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 5c1aba15..061d3589 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -19,14 +19,16 @@ import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.google.common.collect.Lists; @@ -148,6 +150,13 @@ private void parseFactory(ConfigurationSection config) { upgradeEggs.put(egg.getName(), egg); manager.addFactoryUpgradeEgg(egg); break; + case "PIPE": + egg = parsePipe(config); + ItemMap pipeSetupCost = parseItemMap(config + .getConfigurationSection("setupcost")); + manager.addFactoryCreationEgg(PipeStructure.class, pipeSetupCost, + egg); + break; default: plugin.severe("Could not identify factory type " + config.getString("type")); @@ -156,6 +165,35 @@ private void parseFactory(ConfigurationSection config) { } + public PipeEgg parsePipe(ConfigurationSection config) { + String name = config.getString("name"); + int update; + if (config.contains("updatetime")) { + update = (int) parseTime(config.getString("updatetime")); + } else { + update = defaultUpdateTime; + } + ItemStack fuel; + if (config.contains("fuel")) { + fuel = parseItemMap(config.getConfigurationSection("fuel")) + .getItemStackRepresentation().get(0); + } else { + fuel = defaultFuel; + } + int fuelIntervall; + if (config.contains("fuel_consumption_intervall")) { + fuelIntervall = (int) parseTime(config + .getString("fuel_consumption_intervall")); + } else { + fuelIntervall = defaultFuelConsumptionTime; + } + int transferTimeMultiplier = (int) parseTime(config + .getString("transfer_time_multiplier")); + int transferAmount = config.getInt("transferamount"); + return new PipeEgg(name, update, fuel, fuelIntervall, null, + transferTimeMultiplier, transferAmount); + } + public IFactoryEgg parseFCCFactory(ConfigurationSection config) { String name = config.getString("name"); int update; diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index f22bbd16..a308e0cc 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -2,18 +2,23 @@ import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; import vg.civcraft.mc.civmodcore.ACivMod; public class FactoryMod extends ACivMod { private static FactoryModManager manager; private static FactoryMod plugin; + private static MenuBuilder mb; public void onEnable() { super.onEnable(); plugin = this; + MultiBlockStructure.initializeBlockFaceMap(); ConfigParser cp = new ConfigParser(this); manager = cp.parse(); + mb = new MenuBuilder(); manager.loadFactories(); registerListeners(); info("Successfully enabled"); @@ -45,4 +50,8 @@ private void registerListeners() { new CompactItemListener(manager.getCompactLore()), plugin); } + + public static MenuBuilder getMenuBuilder() { + return mb; + } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 51f1ac3c..1557e42b 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -8,13 +8,15 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Chest; +import org.bukkit.block.Dropper; import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.persistence.FactoryFileHandler; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.FactoryFileHandler; import com.github.igotyou.FactoryMod.utility.ItemMap; /** @@ -60,6 +62,10 @@ public FactoryModManager(FactoryMod plugin, possibleInteractionBlock.add(Material.FURNACE); possibleInteractionBlock.add(Material.BURNING_FURNACE); possibleInteractionBlock.add(Material.CHEST); + + // pipe + possibleCenterBlocks.add(Material.DROPPER); + possibleInteractionBlock.add(Material.DROPPER); } /** @@ -191,10 +197,31 @@ public void attemptCreation(Block b, Player p) { + "There is no factory with the given creation materials"); } } - } else { - p.sendMessage(ChatColor.RED + "This is no complete factory"); + return; } + PipeStructure ps = new PipeStructure(b); + if (ps.isComplete()) { + HashMap eggs = factoryCreationRecipes + .get(PipeStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs.get(new ItemMap(((Dropper) (ps + .getStart().getState())).getInventory())); + if (egg != null) { + Factory f = egg.hatch(ps, p); + if (f != null) { + ((Dropper) (ps.getStart().getState())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + } + } else { + p.sendMessage(ChatColor.RED + + "There is no pipe with the given creation materials"); + } + } + } } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 7825004b..80525c46 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -9,11 +9,11 @@ import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; public class FurnCraftChestEgg implements IFactoryEgg { private String name; @@ -33,7 +33,7 @@ public FurnCraftChestEgg(String name, int updateTime, public Factory hatch(MultiBlockStructure mbs, Player p) { FurnCraftChestStructure fccs = (FurnCraftChestStructure) mbs; - FurnacePowerManager fpm = new FurnacePowerManager(fuel, + FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( @@ -41,7 +41,6 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); - fpm.setFactory(fccf); if (recipes.size() != 0) { fccf.setRecipe(recipes.get(0)); } @@ -74,7 +73,7 @@ public int getFuelConsumptionIntervall() { public Factory revive(List blocks, int health, String selectedRecipe, int productionTimer) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); - FurnacePowerManager fpm = new FurnacePowerManager(fuel, + FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( @@ -82,7 +81,6 @@ public Factory revive(List blocks, int health, String selectedRecipe, int FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); - fpm.setFactory(fccf); for (IRecipe recipe : recipes) { if (recipe.getRecipeName() == selectedRecipe) { fccf.setRecipe(recipe); diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index b1f5b2a6..053be766 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -3,7 +3,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; /** * This represents the design pattern "Factory", but because that word was diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java new file mode 100644 index 00000000..41ff5f81 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -0,0 +1,103 @@ +package com.github.igotyou.FactoryMod.eggs; + +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.Pipe; +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.interactionManager.PipeInteractionManager; +import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.repairManager.NoRepairDestroyOnBreakManager; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; + +public class PipeEgg implements IFactoryEgg { + private String name; + private int updateTime; + private ItemStack fuel; + private int fuelConsumptionIntervall; + private List allowedMaterials; + private int transferTimeMultiplier; + private int transferAmount; + + public PipeEgg(String name, int updateTime, ItemStack fuel, + int fuelConsumptionIntervall, List allowedMaterials, + int transferTimeMultiplier, int transferAmount) { + this.name = name; + this.fuel = fuel; + this.updateTime = updateTime; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.transferTimeMultiplier = transferTimeMultiplier; + this.transferAmount = transferAmount; + this.allowedMaterials = allowedMaterials; + } + + public String getName() { + return name; + } + + public int getUpdateTime() { + return updateTime; + } + + public int getFuelConsumptionIntervall() { + return fuelConsumptionIntervall; + } + + public ItemStack getFuel() { + return fuel; + } + + public List getAllowedMaterials() { + return allowedMaterials; + } + + public int getTransferAmount() { + return transferAmount; + } + + public int getTransferTimeMultiplier() { + return transferTimeMultiplier; + } + + public Factory hatch(MultiBlockStructure mbs, Player p) { + IInteractionManager im = new PipeInteractionManager(); + IRepairManager rm = new NoRepairDestroyOnBreakManager(); + IPowerManager pm = new FurnacePowerManager( + ((PipeStructure) mbs).getFurnace(), fuel, + fuelConsumptionIntervall); + Pipe pipe = new Pipe(im, rm, pm, mbs, updateTime, name, + transferTimeMultiplier, transferAmount); + ((PipeInteractionManager) im).setPipe(pipe); + return pipe; + } + + public Factory revive(List blocks, List allowedMaterials, + int runTime) { + MultiBlockStructure ps = new PipeStructure(blocks); + PipeInteractionManager im = new PipeInteractionManager(); + IRepairManager rm = new NoRepairDestroyOnBreakManager(); + IPowerManager pm = new FurnacePowerManager( + ((PipeStructure) ps).getFurnace(), fuel, + fuelConsumptionIntervall); + Pipe pipe = new Pipe(im, rm, pm, ps, updateTime, name, + transferTimeMultiplier, transferAmount); + ((PipeInteractionManager) im).setPipe(pipe); + pipe.setAllowedMaterials(allowedMaterials); + if (runTime != 0) { + pipe.attemptToActivate(null); + if (pipe.isActive()) { + pipe.setRunTime(runTime); + } + } + return pipe; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 6fd9cbbd..1c00c9a3 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -1,11 +1,16 @@ package com.github.igotyou.FactoryMod.factories; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.Furnace; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; /** * Super class for any sort of factory created by this plugin @@ -19,6 +24,7 @@ public abstract class Factory implements Runnable { protected MultiBlockStructure mbs; protected int updateTime; protected String name; + protected final String separator = "#"; public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, MultiBlockStructure mbs, int updateTime, String name) { @@ -116,4 +122,51 @@ public String getName() { */ public abstract String serialize(); + public void scheduleUpdate() { + FactoryMod + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), this, + (long) updateTime); + } + + public void turnFurnaceOn(Block f) { + Furnace furnace = (Furnace) f.getState(); + byte data = furnace.getData().getData(); + ItemStack[] oldContents = furnace.getInventory().getContents(); + furnace.getInventory().clear(); + f.setType(Material.BURNING_FURNACE); + furnace = (Furnace) f.getState(); + furnace.setRawData(data); + furnace.update(); + furnace.setBurnTime(Short.MAX_VALUE); + furnace.getInventory().setContents(oldContents); + } + + public void turnFurnaceOff(Block f) { + Furnace furnace = (Furnace) f.getState(); + byte data = furnace.getData().getData(); + ItemStack[] oldContents = furnace.getInventory().getContents(); + furnace.getInventory().clear(); + f.setType(Material.FURNACE); + furnace = (Furnace) f.getState(); + furnace.setRawData(data); + furnace.update(); + furnace.getInventory().setContents(oldContents); + } + + public String serializeBlock(Block b) { + StringBuilder sb = new StringBuilder(); + sb.append(separator); + sb.append(b.getWorld().getName()); + sb.append(separator); + sb.append(b.getX()); + sb.append(separator); + sb.append(b.getY()); + sb.append(separator); + sb.append(b.getZ()); + return sb.toString(); + } + } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index ec7f90de..856b3a5c 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -12,15 +12,15 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; /** * Represents a "classic" factory, which consists of a furnace as powersource, a @@ -96,7 +96,6 @@ public void attemptToActivate(Player p) { + currentRecipe.getRecipeName()); } activate(); - run(); } else { if (p != null) { p.sendMessage(ChatColor.RED @@ -118,21 +117,12 @@ public void attemptToActivate(Player p) { * is allowed to turn on */ public void activate() { - // lots of code to make the furnace light up, without loosing contents. active = true; pm.setPowerCounter(0); - Furnace furnace = (Furnace) (getFurnace().getState()); - byte data = furnace.getData().getData(); - ItemStack[] oldContents = furnace.getInventory().getContents(); - furnace.getInventory().clear(); - getFurnace().setType(Material.BURNING_FURNACE); - furnace = (Furnace) (getFurnace().getState()); - furnace.setRawData(data); - furnace.update(); - furnace.setBurnTime(Short.MAX_VALUE); - furnace.getInventory().setContents(oldContents); + turnFurnaceOn(getFurnace()); // reset the production timer currentProductionTimer = 0; + run(); } /** @@ -140,19 +130,7 @@ public void activate() { */ public void deactivate() { if (active) { - // lots of code to make the furnace turn off, without loosing - // contents. - Furnace furnace = (Furnace) (getFurnace().getState()); - byte data = furnace.getData().getData(); - ItemStack[] oldContents = furnace.getInventory().getContents(); - furnace.getInventory().clear(); - getFurnace().setType(Material.FURNACE); - furnace = (Furnace) getFurnace().getState(); - furnace.setRawData(data); - furnace.update(); - furnace.getInventory().setContents(oldContents); - - // put active to false + turnFurnaceOff(getFurnace()); active = false; // reset the production timer currentProductionTimer = 0; @@ -211,13 +189,7 @@ public void run() { // increase the production timer currentProductionTimer += updateTime; // schedule next update - FactoryMod - .getPlugin() - .getServer() - .getScheduler() - .scheduleSyncDelayedTask( - FactoryMod.getPlugin(), this, - (long) updateTime); + scheduleUpdate(); } // if there is no fuel Available turn off the factory else { @@ -242,13 +214,7 @@ else if (currentProductionTimer >= currentRecipe currentProductionTimer = 0; if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); - FactoryMod - .getPlugin() - .getServer() - .getScheduler() - .scheduleSyncDelayedTask( - FactoryMod.getPlugin(), this, - (long) updateTime); + scheduleUpdate(); // keep going } else { deactivate(); @@ -309,8 +275,9 @@ public void upgrade(String name, List recipes, ItemStack fuel, this.name = name; this.recipes = recipes; this.updateTime = updateTime; - this.pm = new FurnacePowerManager(this, fuel, fuelConsumptionIntervall); - this.rm.repair(100); + this.pm = new FurnacePowerManager(getFurnace(), fuel, + fuelConsumptionIntervall); + ((PercentageHealthRepairManager) this.rm).repair(100); if (recipes.size() != 0) { setRecipe(recipes.get(0)); } else { @@ -320,25 +287,17 @@ public void upgrade(String name, List recipes, ItemStack fuel, public String serialize() { StringBuilder sb = new StringBuilder(); - String separator = "#"; sb.append("FCC"); sb.append(separator); sb.append(getName()); sb.append(separator); - sb.append(rm.getRawHealth()); + sb.append(((PercentageHealthRepairManager) rm).getRawHealth()); sb.append(separator); sb.append(currentProductionTimer); sb.append(separator); sb.append(currentRecipe.getRecipeName()); for (Block b : mbs.getAllBlocks()) { - sb.append(separator); - sb.append(b.getWorld().getName()); - sb.append(separator); - sb.append(b.getX()); - sb.append(separator); - sb.append(b.getY()); - sb.append(separator); - sb.append(b.getZ()); + sb.append(serializeBlock(b)); } return sb.toString(); } diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java new file mode 100644 index 00000000..cca0720c --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -0,0 +1,212 @@ +package com.github.igotyou.FactoryMod.factories; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class Pipe extends Factory { + private List allowedMaterials; + private int transferAmount; + private int transferTimeMultiplier; + private int runTime; + + public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, + MultiBlockStructure mbs, int updateTime, String name, + int transferTimeMultiplier, int transferAmount) { + super(im, rm, pm, mbs, updateTime, name); + this.transferTimeMultiplier = transferTimeMultiplier; + this.transferAmount = transferAmount; + allowedMaterials = null; + runTime = 0; + } + + public void attemptToActivate(Player p) { + // TODO Citadel stuff + if (mbs.isComplete()) { + if (transferMaterialsAvailable()) { + if (pm.powerAvailable()) { + if (p != null) { + p.sendMessage(ChatColor.GREEN + + "Activated pipe transfer"); + } + activate(); + } else { + if (p != null) { + p.sendMessage(ChatColor.RED + + "Failed to activate pipe, there is no fuel in the furnace"); + } + } + } else { + if (p != null) { + p.sendMessage(ChatColor.RED + + "No items available to transfer"); + } + } + } + } + + public void activate() { + active = true; + pm.setPowerCounter(0); + turnFurnaceOn(((PipeStructure) mbs).getFurnace()); + // reset the production timer + runTime = 0; + run(); + } + + public void deactivate() { + active = false; + turnFurnaceOff(((PipeStructure) mbs).getFurnace()); + runTime = 0; + } + + public void run() { + if (active && mbs.isComplete() && pm.powerAvailable() + && transferMaterialsAvailable()) { + if (runTime >= getTransferTime()) { + transfer(); + runTime = 0; + if (transferMaterialsAvailable()) { + scheduleUpdate(); + } else { + deactivate(); + } + } else { + // if the time since fuel was last consumed is equal to + // how often fuel needs to be consumed + if (pm.getPowerCounter() >= pm.getPowerConsumptionIntervall() - 1) { + // remove one fuel. + pm.consumePower(); + // 0 seconds since last fuel consumption + pm.setPowerCounter(0); + } + // if we don't need to consume fuel, just increase the + // energy timer + else { + pm.increasePowerCounter(updateTime); + } + // increase the production timer + runTime += updateTime; + // schedule next update + scheduleUpdate(); + } + } else { + deactivate(); + } + } + + public void transfer() { + if (mbs.isComplete()) { + Inventory sourceInventory = ((InventoryHolder) (((PipeStructure) mbs) + .getStart().getState())).getInventory(); + Inventory targetInventory = ((InventoryHolder) (((PipeStructure) mbs) + .getEnd().getState())).getInventory(); + int leftToRemove = transferAmount; + for (ItemStack is : sourceInventory.getContents()) { + if (is != null + && is.getType() != Material.AIR + && (allowedMaterials == null || allowedMaterials + .contains(is.getType()))) { + int removeAmount = Math.min(leftToRemove, is.getAmount()); + ItemStack removing = is.clone(); + removing.setAmount(removeAmount); + ItemMap removeMap = new ItemMap(removing); + if (removeMap.fitsIn(targetInventory)) { + sourceInventory.removeItem(removing); + targetInventory.addItem(removing); + leftToRemove -= removeAmount; + } else { + break; + } + if (leftToRemove <= 0) { + break; + } + } + } + } + } + + public void setRunTime(int time) { + this.runTime = time; + } + + public int getTransferTime() { + return transferTimeMultiplier * ((PipeStructure) mbs).getLength(); + } + + public boolean transferMaterialsAvailable() { + Block start = ((PipeStructure) mbs).getStart(); + if (start != null && start.getState() instanceof InventoryHolder) { + Inventory i = ((InventoryHolder) start.getState()).getInventory(); + for (ItemStack is : i.getContents()) { + if (is != null + && (allowedMaterials == null || allowedMaterials + .contains(is.getType()))) { + return true; + } + } + } + return false; + } + + public void setAllowedMaterials(List mats) { + allowedMaterials = mats; + } + + public List getAllowedMaterials() { + return allowedMaterials; + } + + public void addAllowedMaterial(Material m) { + if (allowedMaterials == null) { + allowedMaterials = new LinkedList(); + } + allowedMaterials.add(m); + } + + public void removeAllowedMaterial(Material m) { + allowedMaterials.remove(m); + if (allowedMaterials.size() == 0) { + allowedMaterials = null; + } + } + + public String serialize() { + StringBuilder sb = new StringBuilder(); + sb.append("PIPE"); + sb.append(separator); + sb.append(name); + sb.append(separator); + sb.append(runTime); + if (allowedMaterials == null) { + sb.append(separator); + sb.append("NONE"); + } else { + for (Material m : allowedMaterials) { + sb.append(separator); + sb.append(m.toString()); + } + } + sb.append(separator); + sb.append("BLOCKS"); + for (Block b : mbs.getAllBlocks()) { + sb.append(serializeBlock(b)); + } + return sb.toString(); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 678dfc4b..80de9c4d 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -15,25 +15,27 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; - import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; -import com.github.igotyou.FactoryMod.multiBlockStructures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); private ReinforcementManager rm; + private MenuBuilder mb; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { this.fccf = fccf; prepCitadel(); + mb = FactoryMod.getMenuBuilder(); } public FurnCraftChestInteractionManager() { @@ -43,7 +45,7 @@ public FurnCraftChestInteractionManager() { public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } - + private void prepCitadel() { if (FactoryMod.getManager().isCitadelEnabled()) { rm = Citadel.getReinforcementManager(); @@ -55,13 +57,15 @@ private void prepCitadel() { public void redStoneEvent(BlockRedstoneEvent e) { if (rm != null) { // Note this also accomplishes all the Citadel checking we need. - BlockFace powerFace = findPoweringFace(e.getBlock(), fccf.getMultiBlockStructure().getAllBlocks()); + BlockFace powerFace = findPoweringFace(e.getBlock(), fccf + .getMultiBlockStructure().getAllBlocks()); if (powerFace != null) { int trueNewCurrent = e.getBlock().getBlockPower(powerFace); if (trueNewCurrent != e.getNewCurrent()) { e.setNewCurrent(trueNewCurrent); } - } else { // null means citadel is enabled but no valid redstone power was found. + } else { // null means citadel is enabled but no valid redstone + // power was found. return; } } @@ -72,26 +76,32 @@ public void redStoneEvent(BlockRedstoneEvent e) { int threshold = FactoryMod.getManager().getRedstonePowerOn(); boolean newState = false; if (e.getBlock().getLocation().equals(fccf.getFurnace().getLocation())) { - if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { + if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold + && fccf.isActive()) { // Falling Edge (turn off) newState = false; - } else if (e.getOldCurrent() < threshold && e.getNewCurrent() >= threshold && !fccf.isActive()) { + } else if (e.getOldCurrent() < threshold + && e.getNewCurrent() >= threshold && !fccf.isActive()) { // Rising Edge (turn on) newState = true; } else { return; } - + if (newState) { fccf.attemptToActivate(null); } else { fccf.deactivate(); } - } else if (!fccf.isActive() && e.getBlock().getLocation().equals( - ((FurnCraftChestStructure) fccf.getMultiBlockStructure()).getCraftingTable())) { + } else if (!fccf.isActive() + && e.getBlock() + .getLocation() + .equals(((FurnCraftChestStructure) fccf + .getMultiBlockStructure()).getCraftingTable())) { // Can't change recipe while active. int change = e.getOldCurrent() - e.getNewCurrent(); - if (Math.abs(change) >= FactoryMod.getManager().getRedstoneRecipeChange()) { + if (Math.abs(change) >= FactoryMod.getManager() + .getRedstoneRecipeChange()) { List currentRecipes = fccf.getRecipes(); if (currentRecipes.size() == 0) { return; @@ -105,13 +115,13 @@ public void redStoneEvent(BlockRedstoneEvent e) { if (idx >= currentRecipes.size() - 1) { idx = 0; } else { - idx ++; + idx++; } } else if (change < 0) { // prev if (idx == 0) { idx = currentRecipes.size() - 1; - } else { - idx --; + } else { + idx--; } } } @@ -119,22 +129,28 @@ public void redStoneEvent(BlockRedstoneEvent e) { } } } - + /** - * Only deals with directly powered redstone interactions, not indirect power - * Finds the block face giving the highest power that is also on a compatible Citadel group. + * Only deals with directly powered redstone interactions, not indirect + * power Finds the block face giving the highest power that is also on a + * compatible Citadel group. * - * @param here The block to check around. - * @param exclude The blocks to exclude from checks. + * @param here + * The block to check around. + * @param exclude + * The blocks to exclude from checks. * @return The Face of the highest compatible power level. */ private BlockFace findPoweringFace(Block here, List exclude) { if (here.isBlockPowered()) { - PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm.getReinforcement(here) : null; + PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm + .getReinforcement(here) : null; int prGID = (pr != null) ? pr.getGroup().getGroupId() : -1; boolean checkCitadel = pr != null; if (checkCitadel) { - checkCitadel = !pr.isInsecure(); // don't check citadel if insecure; any input is good then + checkCitadel = !pr.isInsecure(); // don't check citadel if + // insecure; any input is + // good then } BlockFace max = null; int maxP = -1; @@ -143,8 +159,10 @@ private BlockFace findPoweringFace(Block here, List exclude) { if (!exclude.contains(rel) && here.isBlockFacePowered(face)) { int curP = here.getBlockPower(face); if (curP > maxP) { - if (!checkCitadel || prGID == - ((PlayerReinforcement) rm.getReinforcement(rel)).getGroup().getGroupId()) { + if (!checkCitadel + || prGID == ((PlayerReinforcement) rm + .getReinforcement(rel)).getGroup() + .getGroupId()) { max = face; maxP = curP; // TODO: consider shortcut of iff max == 15 return; @@ -157,9 +175,10 @@ private BlockFace findPoweringFace(Block here, List exclude) { return null; } } - - protected static BlockFace[] adjacentFaces = new BlockFace[] {BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, - BlockFace.SOUTH, BlockFace.DOWN, BlockFace.UP}; + + protected static BlockFace[] adjacentFaces = new BlockFace[] { + BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, + BlockFace.DOWN, BlockFace.UP }; public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); @@ -173,6 +192,10 @@ public void blockBreak(Player p, Block b) { } public void leftClick(Player p, Block b) { + if (p.getItemInHand().getType() != FactoryMod.getManager() + .getFactoryInteractionMaterial()) { + return; + } if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getChest())) { // chest interaction if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff @@ -275,8 +298,8 @@ public void clicked(Player p) { recipes.put(c, recipe); clickables.add(c); } - ClickableInventory ci = new ClickableInventory(clickables, - InventoryType.CHEST, "Select a recipe"); + ClickableInventory ci = new ClickableInventory(clickables, 36, + "Select a recipe"); ci.showInventory(p); return; } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java new file mode 100644 index 00000000..bb9c2a57 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -0,0 +1,86 @@ +package com.github.igotyou.FactoryMod.interactionManager; + +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Pipe; +import com.github.igotyou.FactoryMod.repairManager.NoRepairDestroyOnBreakManager; +import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; + +public class PipeInteractionManager implements IInteractionManager { + private Pipe pipe; + private MenuBuilder mb; + private FactoryModManager manager; + + public PipeInteractionManager() { + this.manager = FactoryMod.getManager(); + this.mb = FactoryMod.getMenuBuilder(); + } + + public void setPipe(Pipe pipe) { + this.pipe = pipe; + } + + public void rightClick(Player p, Block b) { + // no use for this here + } + + public void leftClick(Player p, Block b) { + ItemStack hand = p.getItemInHand(); + if (b.equals(((PipeStructure) (pipe.getMultiBlockStructure())) + .getStart())) { + if (hand.getType() == manager.getFactoryInteractionMaterial()) { + mb.showPipeMaterials(p, pipe); + } else { + if (pipe.isActive()) { + p.sendMessage(ChatColor.RED + + "You can not modify the allowed materials while the pipe is transferring"); + return; + } + List allowedMats = pipe.getAllowedMaterials(); + if (allowedMats == null + || !allowedMats.contains(hand.getType())) { + pipe.addAllowedMaterial(hand.getType()); + p.sendMessage(ChatColor.GREEN + "Added " + + hand.getType().toString() + + " as allowed material"); + } else { + pipe.removeAllowedMaterial(hand.getType()); + p.sendMessage(ChatColor.GOLD + "Removed " + + hand.getType().toString() + + " as allowed material"); + } + } + } else if (b.equals(((PipeStructure) (pipe.getMultiBlockStructure())) + .getFurnace())) { + if (pipe.isActive()) { + pipe.deactivate(); + p.sendMessage(ChatColor.GOLD + pipe.getName() + + " has been deactivated"); + } else { + pipe.attemptToActivate(p); + } + } + } + + public void redStoneEvent(BlockRedstoneEvent e) { + // soon + } + + public void blockBreak(Player p, Block b) { + ((NoRepairDestroyOnBreakManager) (pipe.getRepairManager())).breakIt(); + if (p != null) { + p.sendMessage(ChatColor.RED + "Pipe was destroyed"); + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 986b7934..01a0a979 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -21,7 +21,7 @@ import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.multiBlockStructures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; public class FactoryModListener implements Listener { private FactoryModManager manager; @@ -100,9 +100,7 @@ public void playerInteract(PlayerInteractEvent e) { Block block = e.getClickedBlock(); Player player = e.getPlayer(); if (block != null - && manager.isPossibleInteractionBlock(block.getType()) - && player.getItemInHand().getType() == manager - .getFactoryInteractionMaterial()) { + && manager.isPossibleInteractionBlock(block.getType())) { Factory c = manager.getFactoryAt(block); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (c != null) { @@ -122,7 +120,10 @@ public void playerInteract(PlayerInteractEvent e) { if (e.getAction() == Action.LEFT_CLICK_BLOCK) { if (c == null) { if (manager.isPossibleCenterBlock(block.getType())) { - manager.attemptCreation(block, player); + if (player.getItemInHand().getType() == manager + .getFactoryInteractionMaterial()) { + manager.attemptCreation(block, player); + } } else { if (block.getType() == Material.CHEST) { for (Block b : MultiBlockStructure @@ -130,8 +131,8 @@ public void playerInteract(PlayerInteractEvent e) { Material.CHEST)) { Factory f = manager.getFactoryAt(b); if (f != null) { - f.getInteractionManager().leftClick( - player, b); + f.getInteractionManager().leftClick(player, + b); } } } diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index fcdd8e17..0ede6942 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -1,9 +1,11 @@ package com.github.igotyou.FactoryMod.powerManager; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.Furnace; import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.utility.ItemMap; /** @@ -13,15 +15,15 @@ */ public class FurnacePowerManager implements IPowerManager { private ItemStack fuel; - private FurnCraftChestFactory fccf; private int powerCounter; private int fuelConsumptionIntervall; + private Block furnace; - public FurnacePowerManager(FurnCraftChestFactory fccf, ItemStack fuel, + public FurnacePowerManager(Block furnace, ItemStack fuel, int fuelConsumptionIntervall) { - this.fccf = fccf; this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.furnace = furnace; } public FurnacePowerManager(ItemStack fuel, int fuelConsumptionIntervall) { @@ -29,16 +31,16 @@ public FurnacePowerManager(ItemStack fuel, int fuelConsumptionIntervall) { this.fuelConsumptionIntervall = fuelConsumptionIntervall; } - public void setFactory(FurnCraftChestFactory fccf) { - this.fccf = fccf; - } - public int getPowerCounter() { return powerCounter; } public boolean powerAvailable() { - FurnaceInventory fi = fccf.getFurnaceInventory(); + if (furnace.getType() != Material.FURNACE + && furnace.getType() != Material.BURNING_FURNACE) { + return false; + } + FurnaceInventory fi = ((Furnace) furnace.getState()).getInventory(); ItemMap im = new ItemMap(); im.addItemStack(fi.getFuel()); im.addItemStack(fi.getSmelting()); @@ -58,7 +60,7 @@ public void setPowerCounter(int amount) { } public void consumePower() { - FurnaceInventory fi = fccf.getFurnaceInventory(); + FurnaceInventory fi = ((Furnace) furnace.getState()).getInventory(); fi.removeItem(fuel); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 4c03e89a..412eb54b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -6,7 +6,6 @@ import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index c467d134..5bc78adc 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.utility.ItemMap; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; @@ -28,7 +29,8 @@ public RepairRecipe(String name, int productionTime, ItemMap input, public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); - ItemStackUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); + ItemStackUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + + " health"); result.add(furn); return result; } @@ -42,7 +44,8 @@ public void applyEffect(Inventory i, Factory f) { for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } - f.getRepairManager().repair(healthPerRun); + ((PercentageHealthRepairManager) (f.getRepairManager())) + .repair(healthPerRun); } } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java index 5c41bffb..9d6d80d9 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -14,34 +14,15 @@ public interface IRepairManager { * @return How much health the factory represented currently has as a nice string for output messages */ public String getHealth(); - - /** - * @return How much health the factory represented currently has - */ - public int getRawHealth(); /** * @return Whether the factory represented is currently at full health */ public boolean atFullHealth(); - /** - * Repairs the factory by the given amount, which means the health is - * increased - * - * @param amount - * Health to restore - */ - public void repair(int amount); - /** * @return Whether the factory is in disrepair currently */ public boolean inDisrepair(); - - /** - * Set this factorys health - */ - public void setHealth(int health); } diff --git a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java new file mode 100644 index 00000000..015e3676 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java @@ -0,0 +1,40 @@ +package com.github.igotyou.FactoryMod.repairManager; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Factory; + +public class NoRepairDestroyOnBreakManager implements IRepairManager { + private Factory factory; + + public NoRepairDestroyOnBreakManager(Factory factory) { + this.factory = factory; + } + + public NoRepairDestroyOnBreakManager() { + // we have to offer this explicitly as a possible constructor if we also + // want the one which directly defines the factory + } + + public void setFactory(Factory factory) { + this.factory = factory; + } + + public void breakIt() { + FactoryModManager manager = FactoryMod.getManager(); + manager.removeFactory(factory); + } + + public boolean atFullHealth() { + return true; + } + + public boolean inDisrepair() { + return false; + } + + public String getHealth() { + return "full"; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java similarity index 97% rename from src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java rename to src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index d14ec91b..0a737e29 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.multiBlockStructures; +package com.github.igotyou.FactoryMod.structures; import java.util.LinkedList; import java.util.List; diff --git a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java similarity index 65% rename from src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java rename to src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 8612318e..995d0205 100644 --- a/src/com/github/igotyou/FactoryMod/multiBlockStructures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -1,7 +1,9 @@ -package com.github.igotyou.FactoryMod.multiBlockStructures; +package com.github.igotyou.FactoryMod.structures; import java.util.LinkedList; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import org.bukkit.Location; import org.bukkit.Material; @@ -20,6 +22,8 @@ public abstract class MultiBlockStructure { protected static BlockFace[] northEastWestSouthSides = new BlockFace[] { BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; + protected static Map dataBlockFaceConversion; + /** * Checks east,west,north and south of the given block for other blocks with * the given material and returns all the blocks which fulfill that criteria @@ -42,6 +46,22 @@ public static List searchForBlockOnSides(Block b, Material m) { return result; } + public static void initializeBlockFaceMap() { + dataBlockFaceConversion = new TreeMap(); + dataBlockFaceConversion.put(0, BlockFace.DOWN); + dataBlockFaceConversion.put(8, BlockFace.DOWN); + dataBlockFaceConversion.put(1, BlockFace.UP); + dataBlockFaceConversion.put(9, BlockFace.UP); + dataBlockFaceConversion.put(2, BlockFace.NORTH); + dataBlockFaceConversion.put(10, BlockFace.NORTH); + dataBlockFaceConversion.put(3, BlockFace.SOUTH); + dataBlockFaceConversion.put(11, BlockFace.SOUTH); + dataBlockFaceConversion.put(4, BlockFace.WEST); + dataBlockFaceConversion.put(12, BlockFace.WEST); + dataBlockFaceConversion.put(5, BlockFace.EAST); + dataBlockFaceConversion.put(13, BlockFace.EAST); + } + /** * @return Whether all parts of this factory are where they should be and no * block is broken @@ -63,4 +83,12 @@ public static List searchForBlockOnSides(Block b, Material m) { */ public abstract Location getCenter(); + public static List getAdjacentBlocks(Block b) { + List blocks = new LinkedList(); + for (BlockFace face : allBlockSides) { + blocks.add(b.getRelative(face)); + } + return blocks; + } + } diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java new file mode 100644 index 00000000..05da17bc --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -0,0 +1,133 @@ +package com.github.igotyou.FactoryMod.structures; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.inventory.InventoryHolder; + +/** + * Represents a pipe with a dropper at each end, which are directly connected + * through blocks of one specific type which make up the actual pipe + * + */ +public class PipeStructure extends MultiBlockStructure { + private Block start; + private Block furnace; + private Block end; + private int length; + private List glassPipe; + private static Material pipeMaterial = Material.STAINED_GLASS; + private static int maximumLength = 32; + + public PipeStructure(Block startBlock) { + if (startBlock.getType() != Material.DROPPER) { + return; + } + this.start = startBlock; + for (Block b : MultiBlockStructure.searchForBlockOnSides(startBlock, + Material.FURNACE)) { + furnace = b; + break; + } + if (furnace == null) { + return; + } + glassPipe = new LinkedList(); + Block currentBlock = startBlock.getRelative(dataBlockFaceConversion + .get((int) (startBlock.getState().getRawData()))); + Block previousBlock = null; + if (currentBlock.getType() != pipeMaterial) { + return; + } + glassPipe.add(currentBlock); + int length = 1; + while (length <= maximumLength) { + List blocks = MultiBlockStructure + .getAdjacentBlocks(currentBlock); + boolean foundEnd = false; + boolean foundPipeBlock = false; + for (Block b : blocks) { + if (b.getState() instanceof InventoryHolder) { + end = b; + this.length = length; + foundEnd = true; + break; + } else if (b.getType() == pipeMaterial + && !b.equals(previousBlock)) { + glassPipe.add(b); + previousBlock = currentBlock; + currentBlock = b; + length++; + foundPipeBlock = true; + break; + } + } + if (foundEnd || !foundPipeBlock) { + break; + } + } + } + + public PipeStructure(List blocks) { + this.start = blocks.get(0); + this.furnace = blocks.get(1); + this.end = blocks.get(blocks.size() - 1); + List glass = new LinkedList(); + for(Block b:blocks) { + if (b.getType() == pipeMaterial) { + glass.add(b); + } + } + this.glassPipe = glass; + length = glassPipe.size(); + } + + public Location getCenter() { + return start.getLocation(); + } + + public List getAllBlocks() { + List res = new LinkedList(); + res.add(start); + res.add(furnace); + res.addAll(glassPipe); + res.add(end); + return res; + } + + public boolean isComplete() { + if (start == null + || furnace == null + || end == null + || start.getType() != Material.DROPPER + || (furnace.getType() != Material.FURNACE && furnace.getType() != Material.BURNING_FURNACE) + || !(end.getState() instanceof InventoryHolder)) { + return false; + } + for (Block b : glassPipe) { + if (b.getType() != pipeMaterial) { + return false; + } + } + return true; + } + + public int getLength() { + return length; + } + + public Block getStart() { + return start; + } + + public Block getEnd() { + return end; + } + + public Block getFurnace() { + return furnace; + } +} diff --git a/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java similarity index 77% rename from src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java rename to src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java index c55aeae7..a5a6a0f0 100644 --- a/src/com/github/igotyou/FactoryMod/persistence/FactoryFileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java @@ -1,4 +1,4 @@ -package com.github.igotyou.FactoryMod.persistence; +package com.github.igotyou.FactoryMod.utility; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -11,6 +11,7 @@ import java.util.Map; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; @@ -18,6 +19,7 @@ import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.factories.Factory; public class FactoryFileHandler { @@ -110,6 +112,36 @@ private void loadFromFile(File f, Map eggs) { productionTimer); manager.addFactory(fac); counter++; + break; + case "PIPE": + PipeEgg pipeEgg = (PipeEgg) eggs.get(content[1]); + int runTime = Integer.parseInt(content[2]); + List mats = new LinkedList(); + int i = 3; + for (; i < content.length; i++) { + if (content[i].equals("NONE")) { + mats = null; + i+=2; + break; + } + if (content[i].equals("BLOCKS")) { + i++; + break; + } + Material m = Material.valueOf(content[i]); + mats.add(m); + } + List pipeBlocks = new LinkedList(); + for (; i < content.length; i += 4) { + World w = plugin.getServer().getWorld(content[i]); + int x = Integer.parseInt(content[i + 1]); + int y = Integer.parseInt(content[i + 2]); + int z = Integer.parseInt(content[i + 3]); + pipeBlocks.add(new Location(w, x, y, z).getBlock()); + } + Factory p = pipeEgg.revive(pipeBlocks, mats, runTime); + manager.addFactory(p); + counter++; } line = reader.readLine(); } diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java new file mode 100644 index 00000000..ff28ebb2 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -0,0 +1,280 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.ItemStack; + +import vg.civcraft.mc.civmodcore.inventorygui.Clickable; +import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; +import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.Pipe; +import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; + +public class MenuBuilder { + private FactoryModManager manager; + private Map factoryViewed = new HashMap(); + + public MenuBuilder() { + manager = FactoryMod.getManager(); + } + + public void openFactoryBrowser(Player p, String startingFac) { + ClickableInventory.forceCloseInventory(p); + IFactoryEgg egg = manager.getEgg(startingFac); + if (egg == null) { + p.sendMessage(ChatColor.RED + + "There is no factory with the name you entered"); + return; + } + if (egg instanceof FurnCraftChestEgg) { + FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; + factoryViewed.put(p.getUniqueId(), furnegg.getName()); + ArrayList clickables = new ArrayList(); + clickables.ensureCapacity(27); + + // creation option + ItemStack creationStack = new ItemStack(Material.CHEST); + ItemStackUtils.setName(creationStack, "Setup"); + ItemStackUtils + .addLore( + creationStack, + ChatColor.LIGHT_PURPLE + + "Click to display more information on how to setup this factory"); + Clickable creationClickable = new Clickable(creationStack) { + @Override + public void clicked(Player arg0) { + openSetupBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + clickables.set(10, creationClickable); + + // recipe option + ItemStack recipeStack = new ItemStack(Material.WORKBENCH); + ItemStackUtils.setName(recipeStack, "Recipes"); + ItemStackUtils.addLore(recipeStack, ChatColor.LIGHT_PURPLE + + "Click to display all recipes this factory can run"); + Clickable recipeClickable = new Clickable(recipeStack) { + @Override + public void clicked(Player arg0) { + openRecipeBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + clickables.set(13, recipeClickable); + + // upgrade option + ItemStack upgradeStack = new ItemStack(Material.FURNACE); + ItemStackUtils.setName(upgradeStack, "Upgrades"); + ItemStackUtils + .addLore(upgradeStack, + "Click to display more information about the possible upgrades to this factory"); + Clickable upgradeClickable = new Clickable(upgradeStack) { + @Override + public void clicked(Player arg0) { + openUpgradeBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + clickables.set(16, upgradeClickable); + + ClickableInventory browser = new ClickableInventory( + clickables, + InventoryType.CHEST, + furnegg.getName() + + " --- Click on an option to display more information"); + browser.showInventory(p); + } + + } + + private void openRecipeBrowser(Player p, String facName) { + ClickableInventory.forceCloseInventory(p); + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); + ArrayList clickables = new ArrayList(); + clickables.ensureCapacity(36); + List recipes = egg.getRecipes(); + + // put recipes + for (int i = 0; i < recipes.size(); i++) { + Clickable c = new Clickable( + ((InputRecipe) recipes.get(i)).getRecipeRepresentation()) { + @Override + public void clicked(Player arg0) { + openDetailedRecipeBrowser(arg0, + ItemStackUtils.getName(this.getItemStack())); + } + }; + clickables.set(i, c); + } + + // back option + ItemStack backStack = new ItemStack(Material.ARROW); + ItemStackUtils.setName(backStack, "Back to factory overview"); + ItemStackUtils.addLore(backStack, "Click to go back"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + clickables.set(31, backClickable); + + ClickableInventory recipeInventory = new ClickableInventory(clickables, + 36, "All recipes for " + facName + + " --- Click one to display more information about it"); + recipeInventory.showInventory(p); + } + + private void openSetupBrowser(Player p, String facName) { + ClickableInventory.forceCloseInventory(p); + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager + .getEgg(factoryViewed.get(p.getUniqueId())); + + } + + private void openUpgradeBrowser(Player p, String facName) { + ClickableInventory.forceCloseInventory(p); + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager + .getEgg(factoryViewed.get(p.getUniqueId())); + ClickableInventory ci = new ClickableInventory( + new ArrayList(), 18, + "Click to display more information on an upgrade"); + List upgrades = new LinkedList(); + for (IRecipe recipe : egg.getRecipes()) { + if (recipe instanceof Upgraderecipe) { + upgrades.add(recipe); + } + } + if (upgrades.size() == 0) { + ItemStack bar = new ItemStack(Material.BARRIER); + ItemStackUtils.setName(bar, "No upgrades available"); + ItemStackUtils.addLore(bar, "Click to go back"); + Clickable noUpgrades = new Clickable(bar) { + @Override + public void clicked(Player p) { + openUpgradeBrowser(p, factoryViewed.get(p.getUniqueId())); + } + }; + ci.setSlot(noUpgrades, 4); + } else { + for (IRecipe recipe : upgrades) { + Clickable c= new Clickable(((InputRecipe)recipe).getRecipeRepresentation()) { + @Override + public void clicked(Player p) { + openDetailedRecipeBrowser(p, ItemStackUtils.getName(this.getItemStack())); + } + }; + ci.addSlot(c); + } + } + ci.showInventory(p); + } + + private void openDetailedRecipeBrowser(Player p, String recipeName) { + ClickableInventory.forceCloseInventory(p); + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager + .getEgg(factoryViewed.get(p.getUniqueId())); + InputRecipe rec = null; + for (IRecipe recipe : egg.getRecipes()) { + if (recipe.getRecipeName().equals(recipeName)) { + rec = (InputRecipe) recipe; + break; + } + } + ClickableInventory ci = new ClickableInventory( + new ArrayList(), 54, recipeName + " in factory " + + factoryViewed.get(p.getUniqueId())); + ItemStack inputStack = new ItemStack(Material.PAPER); + ItemStackUtils.setName(inputStack, "Input materials"); + ItemStackUtils.addLore(inputStack, + "The materials required to run this recipe"); + Clickable inputClickable = new Clickable(inputStack) { + @Override + public void clicked(Player arg0) { + } + }; + ci.setSlot(inputClickable, 4); + int index = 13; + for (ItemStack is : rec.getInputRepresentation(null)) { + Clickable c = new DecorationStack(is); + ci.setSlot(c, index); + // weird math to fill up the gui nicely + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index += 9; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } + + } + + ItemStack outputStack = new ItemStack(Material.PAPER); + ItemStackUtils.setName(outputStack, "Output/effect"); + Clickable outputClickable = new Clickable(outputStack) { + @Override + public void clicked(Player arg0) { + } + }; + + ItemStack backStack = new ItemStack(Material.ARROW); + ItemStackUtils.setName(backStack, "Back to recipe overview"); + ItemStackUtils.addLore(backStack, "Click to go back"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openRecipeBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + ci.setSlot(backClickable, 27); + + ci.setSlot(outputClickable, 31); + index = 40; + for (ItemStack is : rec.getOutputRepresentation(null)) { + Clickable c = new DecorationStack(is); + ci.setSlot(c, index); + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index += 9; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } + } + ci.showInventory(p); + } + + public void showPipeMaterials(Player p, Pipe pipe) { + + } + +} From 4f918b6010012a4c27240a1dabe21ae021700489 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 6 Jan 2016 15:26:16 +0100 Subject: [PATCH 196/459] Working sorters, more gui implementations --- Config Scripts/ConfigObjects.py | 184 ------------- Config Scripts/GenerateConfig.py | 251 ------------------ Config Scripts/ParseConfig.py | 58 ---- Config Scripts/template.yml | 149 ----------- .../enchantments.csv | 0 {Config Scripts => Name tables}/materials.csv | 0 .../igotyou/FactoryMod/ConfigParser.java | 37 +++ .../github/igotyou/FactoryMod/FactoryMod.java | 5 + .../igotyou/FactoryMod/FactoryModManager.java | 64 ++++- .../commands/FactoryModCommandHandler.java | 13 + .../FactoryMod/commands/commands/Menu.java | 45 ++++ .../igotyou/FactoryMod/eggs/SorterEgg.java | 99 +++++++ .../igotyou/FactoryMod/factories/Factory.java | 4 +- .../factories/FurnCraftChestFactory.java | 1 + .../igotyou/FactoryMod/factories/Pipe.java | 1 + .../igotyou/FactoryMod/factories/Sorter.java | 220 +++++++++++++++ .../FurnCraftChestInteractionManager.java | 25 +- .../IInteractionManager.java | 5 +- .../PipeInteractionManager.java | 5 +- .../SorterInteractionManager.java | 75 ++++++ .../listeners/FactoryModListener.java | 11 +- .../FactoryMod/recipes/Upgraderecipe.java | 2 +- .../structures/BlockFurnaceStructure.java | 56 ++++ .../structures/FurnCraftChestStructure.java | 21 +- .../structures/MultiBlockStructure.java | 10 +- .../FactoryMod/structures/PipeStructure.java | 17 +- ...ctoryFileHandler.java => FileHandler.java} | 46 +++- .../igotyou/FactoryMod/utility/ItemMap.java | 2 +- .../FactoryMod/utility/MenuBuilder.java | 207 ++++++++++++--- 29 files changed, 882 insertions(+), 731 deletions(-) delete mode 100644 Config Scripts/ConfigObjects.py delete mode 100644 Config Scripts/GenerateConfig.py delete mode 100644 Config Scripts/ParseConfig.py delete mode 100644 Config Scripts/template.yml rename {Config Scripts => Name tables}/enchantments.csv (100%) rename {Config Scripts => Name tables}/materials.csv (100%) create mode 100644 src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java create mode 100644 src/com/github/igotyou/FactoryMod/commands/commands/Menu.java create mode 100644 src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java create mode 100644 src/com/github/igotyou/FactoryMod/factories/Sorter.java create mode 100644 src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java create mode 100644 src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java rename src/com/github/igotyou/FactoryMod/utility/{FactoryFileHandler.java => FileHandler.java} (75%) diff --git a/Config Scripts/ConfigObjects.py b/Config Scripts/ConfigObjects.py deleted file mode 100644 index 21d03790..00000000 --- a/Config Scripts/ConfigObjects.py +++ /dev/null @@ -1,184 +0,0 @@ -test=1 -defaults={} -defaults['name']='Default Name' -defaults['time']=2 -defaults['durability']=0 -defaults['amount']=1 -defaults['probability']=1.0 -defaults['useOnce']=False -defaults['displayName']=None -defaults['lore']=None -defaults['fuelTime']=2 -defaults['level']=1 -defaults['repairMultiple']=0 - -import pydot - -class CraftedRecipe: - def __init__(self,identifier,inputs=None,shape=None,output=None): - self.identifier=identifier - self.inputs=inputs if inputs!=None else {} - self.shape=shape if shape!=None else [] - self.output=output if output!=None else [] - def cOutput(self): - out='\n '+self.identifier+':' - out+='\n inputs:' - if len(self.shape)==0: - for input in self.inputs.values(): - out+=input.cOutput('\n ') - else: - for key,input in self.inputs.items(): - out+='\n '+key+':' - out+=input.cOutput('\n ') - out+='\n shape:' - for string in self.shape: - out+='\n - '+string - out+='\n output:' - out+=self.output.cOutput('\n ') - return out - -class Recipe: - def __init__(self,identifier,name=defaults['name'],time=defaults['time'],inputs=None,upgrades=None,outputs=None,enchantments=None,useOnce=defaults['useOnce'],outputRecipes=None): - self.identifier=identifier - self.name=name - self.time=int(time) - self.inputs=inputs if inputs!=None else [] - self.upgrades=upgrades if upgrades!=None else [] - self.outputs=outputs if outputs!=None else [] - self.enchantments=enchantments if enchantments!=None else [] - self.outputRecipes=outputRecipes if outputRecipes!=None else [] - self.useOnce=useOnce - from math import ceil - self.checkEnchantments() - def checkEnchantments(self): - removeEnchantments=[] - for enchantment in self.enchantments: - valid=False - for output in self.outputs: - for target in enchantment.targets: - if target in output.name: - valid=True - if not valid: - removeEnchantments.append(enchantment) - for enchantment in removeEnchantments: - self.enchantments.remove(enchantment) - def addEnchant(self,enchant): - self.enchantments.append(enchant) - def addOutputRecipe(self,recipe): - self.outputRecipes.append(recipe) - def cOutput(self): - out='\n '+self.identifier+':' - if self.name!=defaults['name']: out+='\n name: '+self.name - if self.time!=defaults['time']: out+='\n production_time: '+str(self.time) - if len(self.inputs)>0: - out+='\n inputs:' - for input in self.inputs:out+=input.cOutput('\n ') - if len(self.upgrades)>0: - out+='\n upgrades:' - for upgrade in self.upgrades:out+=upgrade.cOutput('\n ') - if len(self.outputs)>0: - out+='\n outputs:' - for output in self.outputs:out+=output.cOutput('\n ') - if len(self.enchantments)>0: - out+='\n enchantments:' - for enchantment in self.enchantments: - if enchantment.probability!=0: - out+=enchantment.cOutput('\n ') - if len(self.outputRecipes)>0: - out+='\n output_recipes:' - for outputRecipe in self.outputRecipes: - out+='\n - '+outputRecipe.identifier - if self.useOnce!=defaults['useOnce']:out+='\n use_once: '+str(self.useOnce).lower() - return out - -class Enchantment: - enchantments={} - def __init__(self,name=None,type=None,level=defaults['level'],probability=defaults['probability'],targets=[]): - self.name=name - self.type=Enchantment.enchantments[name][0] - self.level=level - self.probability=probability - self.targets=Enchantment.enchantments[name][1] - @staticmethod - def importEnchantments(filename='enchantments.csv'): - import csv - myfile=open(filename) - csvReader=csv.reader(myfile) - for line in csvReader: - Enchantment.enchantments[line[0]]=(line[1],filter(None,line[2:])) - def cOutput(self,spacer): - out=spacer+self.name+' '+str(self.level)+':' - spacer=spacer+' ' - out+=spacer+'type: '+self.type - out+=spacer+'level: '+str(self.level) - if self.probability!=defaults['probability']: out+=spacer+'probability: '+str(self.probability) - return out - -class ItemStack: - materials={} - - def __init__(self,name,material=None,amount=defaults['amount'],durability=None,displayName=defaults['displayName'],lore=defaults['lore']): - self.name=name - self.material=material if material!=None else ItemStack.materials[name][1] - self.durability=durability if durability!=None else ItemStack.materials[name][3] - import math - self.amount=int(math.ceil(amount)) - self.displayName=displayName - self.lore=lore - @staticmethod - def importMaterials(filename='materials.csv'): - import csv - myfile=open(filename) - csvReader=csv.reader(myfile) - for line in csvReader: - commonName,material,id,durability=line - ItemStack.materials[commonName]=(commonName,material,int(id),int(durability)) - - def modifyAmount(self,modifier): - import copy,math - copy=copy.copy(self) - copy.amount=int(math.ceil(copy.amount*modifier)) - return copy - def cOutput(self,spacer): - out=spacer+self.name+':' - spacer=spacer+' ' - out+=spacer+'material: '+self.material - if self.amount!=defaults['amount']:out+=spacer+'amount: '+str(self.amount) - if self.durability!=defaults['durability']:out+=spacer+'durability: '+str(self.durability) - if self.displayName!=defaults['displayName']:out+=spacer+'display_name: '+self.displayName - if self.lore!=defaults['lore']:out+=spacer+'lore: '+self.lore - return out - def equals(self,otherItemStack): - return self.material==otherItemStack.material and self.durability==otherItemStack.durability and self.amount==otherItemStack.amount and self.displayName==otherItemStack.displayName and self.lore==otherItemStack.lore -ItemStack.importMaterials() - -defaults['fuel']=ItemStack(name='Charcoal') -defaults['repairInputs']=[ItemStack(name='Charcoal',amount=0)] -class Factory: - def __init__(self,identifier,name=defaults['name'],fuel=defaults['fuel'],fuelTime=defaults['fuelTime'],inputs=None,outputRecipes=None,repairMultiple=defaults['repairMultiple'],repairInputs=None): - self.name=name - self.identifier=identifier - self.fuel=fuel - self.fuelTime=int(fuelTime) - self.inputs=inputs if inputs!=None else [] - self.outputRecipes=outputRecipes if outputRecipes!=None else [] - self.repairMultiple=repairMultiple - self.repairInputs=repairInputs if repairInputs!=None else defaults['repairInputs'] - def addRecipe(self,outputRecipe): - self.outputRecipes.append(outputRecipe) - def cOutput(self): - out='\n '+self.identifier+':' - out+='\n name: '+self.name - out+='\n fuel:'+self.fuel.cOutput('\n ') - if self.fuelTime!=defaults['fuelTime']:out+='\n fuel_time: '+str(self.fuelTime) - out+='\n inputs:' - for input in self.inputs:out+=input.cOutput('\n ') - if len(self.outputRecipes)>0: - out+='\n recipes:' - for outputRecipe in self.outputRecipes: - out+='\n - '+outputRecipe.identifier - if self.repairMultiple!=defaults['repairMultiple']:out+='\n repair_multiple: '+str(self.repairMultiple) - if len(self.repairInputs)>0: - out+='\n repair_inputs:' - for repairInput in self.repairInputs:out+=repairInput.cOutput('\n ') - return out \ No newline at end of file diff --git a/Config Scripts/GenerateConfig.py b/Config Scripts/GenerateConfig.py deleted file mode 100644 index dce33acd..00000000 --- a/Config Scripts/GenerateConfig.py +++ /dev/null @@ -1,251 +0,0 @@ -from ConfigObjects import Recipe, Enchantment, ItemStack, Factory, CraftedRecipe -from ParseConfig import ParseConfig - -coeffs={} -gMod=1 -mMod=0.1 - -def main(): - print 'Running....' - ItemStack.importMaterials() - Enchantment.importEnchantments() - createConfigFile() - -def createConfigFile(): - config={} - config['factories'],config['recipes']=createFactorieAndRecipes() - config['disabled_recipes']=[] - config['enabled_recipes']=createCraftingRecipes() - checkConflicts(config['factories']) - print 'Fixing Conflicts...' - fixConflicts(config['factories']) - checkConflicts(config['factories']) - ParseConfig.saveConfig(config) - ParseConfig.prettyList(config) - -def createFactorieAndRecipes(): - inputs={} - outputs={} - enchantments={} - recipes={} - factories={} - - #Smelting - #Stone - id='Smelt_Stone' - inputs[id]=[ItemStack(name='Cobblestone',amount=640)] - outputs[id]=[ItemStack(name='Stone',amount=640*1.333)] - recipes[id]=Recipe(identifier=id,name='Smelt Stone',inputs=inputs[id],outputs=outputs[id],time=80) - id='Stone_Smelter' - inputs[id]=[ItemStack(name='Stone',amount=2048*gMod)] - factories[id]=Factory(identifier=id,name='Stone Smelter',inputs=inputs[id],outputRecipes=[recipes['Smelt_Stone']]) - #Charcoal - woods=['Oak Wood','Spruce Wood','Birch Wood','Jungle Wood'] - id='Charcoal_Smelter' - inputs[id]=[ItemStack(name='Charcoal',amount=600*gMod)] - factories[id]=Factory(identifier=id,name='Charcoal Burner',inputs=inputs[id]) - for wood in woods: - id='Smelt_'+wood.replace(' ','_') - inputs[id]=[ItemStack(name=wood,amount=256)] - outputs[id]=[ItemStack(name='Charcoal',amount=256*2)] - recipes[id]=Recipe(identifier=id,name='Burn '+wood,inputs=inputs[id],outputs=outputs[id],time=256/8*3/4) - factories['Charcoal_Smelter'].addRecipe(recipes[id]) - id='Smelt_Coal' - inputs[id]=[ItemStack(name='Coal',amount=256)] - outputs[id]=[ItemStack(name='Charcoal',amount=256*2)] - recipes[id]=Recipe(identifier=id,name='Burn Coal',inputs=inputs[id],outputs=outputs[id],time=256/8*3/4) - factories['Charcoal_Smelter'].addRecipe(recipes[id]) - #Glass - id='Smelt_Glass' - inputs[id]=[ItemStack(name='Sand',amount=256)] - outputs[id]=[ItemStack(name='Glass',amount=256*3)] - recipes[id]=Recipe(identifier=id,name='Smelt Glass',inputs=inputs[id],outputs=outputs[id],time=48) - id='Glass_Smelter' - inputs[id]=[ItemStack(name='Sand',amount=2048*gMod),ItemStack(name='Charcoal',amount=256*gMod)] - factories[id]=Factory(identifier=id,name='Glass Smelter',inputs=inputs[id],outputRecipes=[recipes['Smelt_Glass']]) - #Stone Brick Smelter - bricks={'Cracked':'Flint','Mossy':'Vine','Chiseled':'Gravel'} - id='Stone_Brick_Smelter' - inputs[id]=[ItemStack(name='Stone Brick',amount=512*gMod),ItemStack(name='Lapis Lazuli',amount=256*gMod)] - factories[id]=Factory(identifier=id,name='Fancy Stone Brick Smelter',inputs=inputs[id]) - factoryid=id - for brick in bricks: - id='Smelt_'+brick+'_Stone_Brick' - inputs[id]=[ItemStack(name='Stone Brick',amount=64),ItemStack(name='Lapis Lazuli',amount=32),ItemStack(bricks[brick],amount=64)] - outputs[id]=[ItemStack(brick+' Stone Brick',amount=64)] - recipes[id]=Recipe(identifier=id,name='Smelt '+brick+' Stone Brick',inputs=inputs[id],outputs=outputs[id],time=64) - factories[factoryid].addRecipe(recipes[id]) - #Smelter - ores={'Coal Ore':('Coal',512,3,128),'Iron Ore':('Iron Ingot',384,1.75,128),'Gold Ore':('Gold Ingot',192,7,32),'Diamond Ore':('Diamond',96,3,16)} - inputs['Smelter']=[ItemStack(name=values[0],amount=values[1]) for ore,values in ores.items()] - factories['Smelter']=Factory(identifier='Smelter',name='Ore Smelter',inputs=inputs['Smelter']) - for ore,values in ores.items(): - id='Smelt_'+ore.replace(' ','_') - inputs[id]=[ItemStack(name=ore,amount=values[3])] - outputs[id]=[ItemStack(name=values[0],amount=values[3]*values[2])] - recipes[id]=Recipe(identifier=id,name='Smelt '+ore,inputs=inputs[id],outputs=outputs[id],time=values[3]/8*3/4) - factories['Smelter'].addRecipe(recipes[id]) - - #Equipment - enchantmentData=[] - enchantmentData.extend([('Unbreaking',[(3,1)]),('Silk Touch',[(1,0.1)]),('Efficiency',[(1,.3),(2,.2),(3,0.1),(4,0.05),(5,0.01)])]) - enchantmentData.extend([('Bane of the Anthropods',[(1,.4),(2,.3),(3,.2),(4,.1),(5,0.3)]),('Smite',[(1,.4),(2,.3),(3,.2),(4,.1),(5,0.05)]),('Looting',[(1,0.5),(2,0.4),(3,0.3)])]) - enchantmentData.extend([('Respiration',[(1,0.5),(2,0.4),(3,0.3),(4,0.4)]),('Blast Protection',[(1,0.5),(2,0.4),(3,0.3),(4,0.4)]),('Feather Falling',[(1,0.5),(2,0.4),(3,0.3),(4,0.4)]),('Fire Protection',[(1,0.5),(2,0.4),(3,0.3),(4,0.4)]),('Projectile Protection',[(1,0.5),(2,0.4),(3,0.3),(4,0.4)])]) - enchantmentsInputs=sum([[Enchantment(name=name,level=level,probability=prob) for level,prob in pairs] for name,pairs in enchantmentData],[]) - - inputDict={'Iron':'Iron Ingot','Gold':'Gold Ingot','Diamond':'Diamond'} - coeffs['i']={'Helmet':5,'Chestplate':8,'Leggings':7,'Boots':4,'Sword':2,'Axe':3,'Pickaxe':3,'Spade':1,'Hoe':2}# Modifier for different branches of the tree, based on vanilla costs - coeffs['b']={'Helmet':1,'Chestplate':1,'Leggings':1,'Boots':1,'Sword':1,'Axe':1,'Pickaxe':1,'Spade':1,'Hoe':1} - for key,value in coeffs['b'].items():coeffs['b'][key]=value*5 - coeffs['e']={'Helmet':3,'Chestplate':3,'Leggings':3,'Boots':3,'Sword':3,'Axe':6,'Pickaxe':3,'Spade':3,'Hoe':6} - buildCosts={'Helmet':192,'Chestplate':320,'Leggings':256,'Boots':160,'Sword':80,'Axe':64,'Pickaxe':96,'Spade':48,'Hoe':32} - for tech in inputDict.keys(): - for equipment in coeffs['i'].keys(): - enchantments[tech+'_'+equipment]=[] - if tech=='Gold': - enchantments[tech+'_'+equipment]=list(enchantmentsInputs) - inputs[tech+'_'+equipment]=[ItemStack(name=inputDict[tech],amount=coeffs['i'][equipment]*coeffs['b'][equipment])] - outputs[tech+'_'+equipment]=[ItemStack(name=tech+' '+equipment,amount=coeffs['b'][equipment]*coeffs['e'][equipment])] - recipes[tech+'_'+equipment]=Recipe(identifier=tech+'_'+equipment,name='Forge '+tech+' '+equipment+'.',inputs=inputs[tech+'_'+equipment],outputs=outputs[tech+'_'+equipment],enchantments=enchantments[tech+'_'+equipment],time=inputs[tech+'_'+equipment][0].amount) - inputs[tech+'_'+equipment+'_Smithy']=[ItemStack(name=inputDict[tech],amount=buildCosts[equipment])] - factories[tech+'_'+equipment+'_Smithy']=Factory(identifier=tech+'_'+equipment+'_Smithy',name=tech+' '+equipment+' Smithy',inputs=inputs[tech+'_'+equipment+'_Smithy'],outputRecipes=[recipes[tech+'_'+equipment]]) - - #Food output:([inputs],build cost,efficieny,bulk) - #Butchers - oi={('Cooked Chicken',1):([('Raw Chicken',1)],192,2,64),('Grilled Pork',1):([('Pork',1)],160,2,64),('Cooked Beef',1):([('Raw Beef',1)],64,2,64),('Cooked Fish',1):([('Raw Fish',1)],16,2,64)} - id='Grill' - inputs[id]=[ItemStack(name=key[0],amount=value[1]) for key,value in oi.items()] - factories[id]=Factory(identifier=id,name='Bakery',inputs=inputs[id]) - for key,value in oi.items(): - id=key[0].replace(' ','_') - inputs[id]=[ItemStack(name=name,amount=amount*value[3]) for name,amount in value[0]] - outputs[id]=[ItemStack(name=key[0],amount=key[1]*value[2]*value[3])] - recipes[id]=Recipe(identifier=id,name='Grill '+name,inputs=inputs[id],outputs=outputs[id],time=inputs[id][0].amount/8*3/4) - factories['Grill'].addRecipe(recipes[id]) - #Bakery - oi={('Bread',1):([('Wheat',3)],256,2,128),('Baked Potato',1):([('Potato',1)],512,2,192),('Cookie',8):([('Wheat',2),('Cocoa',1)],1024,2,128)} - id='Bakery' - inputs[id]=[ItemStack(name=key[0],amount=value[1]) for key,value in oi.items()] - factories[id]=Factory(identifier=id,name='Bakery',inputs=inputs[id]) - for key,value in oi.items(): - id=key[0].replace(' ','_') - inputs[id]=[ItemStack(name=name,amount=amount*value[3]) for name,amount in value[0]] - outputs[id]=[ItemStack(name=key[0],amount=key[1]*value[2]*value[3])] - recipes[id]=Recipe(identifier=id,name='Bake '+name,inputs=inputs[id],outputs=outputs[id],time=256/8*3/4) - factories['Bakery'].addRecipe(recipes[id]) - #Items - ##Wool - inputColors=['White', 'Light Gray', 'Gray', 'Black', 'Brown', 'Pink'] - dyes={'White':'Bone Meal','Light Gray':'Light Gray Dye','Gray':'Gray Dye','Black':'Ink Sack','Red':'Rose Red','Orange':'Orange Dye','Yellow':'Dandelion Yellow','Lime':'Lime Dye','Green':'Cactus Green','Cyan':'Cyan Dye','Light Blue':'Light Blue Dye','Blue':'Lapis Lazuli','Purple':'Purple Dye','Magenta':'Magenta Dye','Pink':'Pink Dye','Brown':'Cocoa'} - for inputColor in inputColors: - factoryId=inputColor.replace(' ','_')+'_Wool_Processing' - inputs[factoryId]=[ItemStack(name=dye,amount=20*gMod) for dye in dyes.values()]+[ItemStack(name=inputColor+' Wool',amount=20)] - factories[factoryId]=Factory(identifier=factoryId,name=inputColor+' Wool Processing',inputs=inputs[factoryId]) - for outputColor,dye in dyes.items(): - if inputColor!=outputColor: - id='Dye_'+inputColor.replace(' ','_')+'_Wool_'+outputColor.replace(' ','_') - inputs[id]=[ItemStack(name=inputColor+' Wool',amount=64),ItemStack(name=dyes[outputColor],amount=4)] - outputs[id]=[ItemStack(name=outputColor+' Wool',amount=64)] - recipes[id]=Recipe(identifier=id,name='Dye '+inputColor+' Wool '+outputColor,inputs=inputs[id],outputs=outputs[id]) - factories[factoryId].addRecipe(recipes[id]) - ##Rail - factoryid='Rail_Factory' - inputs[factoryid]=[ItemStack(name='Iron Ingot',amount=256),ItemStack(name='Stick',amount=96),ItemStack(name='Gold Ingot',amount=192),ItemStack(name='Redstone',amount=32)] - factories[factoryid]=Factory(identifier=factoryid,name='Rail Factory',inputs=inputs[factoryid]) - id='Produce_Rail' - inputs[id]=[ItemStack(name='Iron Ingot',amount=128),ItemStack(name='Stick',amount=32)] - outputs[id]=[ItemStack(name='Rail',amount=528)] - recipes[id]=Recipe(identifier=id,name='Produce Rails',inputs=inputs[id],outputs=outputs[id]) - factories[factoryid].addRecipe(recipes[id]) - id='Produce_Powered_Rail' - inputs[id]=[ItemStack(name='Gold Ingot',amount=64),ItemStack(name='Redstone',amount=10),ItemStack(name='Stick',amount=10)] - outputs[id]=[ItemStack(name='Powered Rail',amount=102)] - recipes[id]=Recipe(identifier=id,name='Produce Powered Rails',inputs=inputs[id],outputs=outputs[id]) - factories[factoryid].addRecipe(recipes[id]) - - #Enchanting - inputs['Wood_Cauldron']=[ItemStack(name='Stick',amount=1024*gMod)] - inputs['Iron_Cauldron']=[ItemStack(name='Iron Ingot',amount=200*gMod)] - inputs['Diamond_Cauldron']=[ItemStack(name='Diamond',amount=50*gMod)] - factories['Wood_Cauldron']=Factory(identifier='Wood_Cauldron',name='Wood Cauldron',inputs=inputs['Wood_Cauldron']) - factories['Iron_Cauldron']=Factory(identifier='Iron_Cauldron',name='Iron Cauldron',inputs=inputs['Iron_Cauldron']) - factories['Diamond_Cauldron']=Factory(identifier='Diamond_Cauldron',name='Diamond Cauldron',inputs=inputs['Diamond_Cauldron']) - ##cauldronInputs[Cauldron Type].append(([(Input Name 1,Input amount 1),(Input Name 2,Input amount 2),...],Number of XP bottles output)) - cauldronInputs={} - cauldronInputs['Wood']=[] - cauldronInputs['Wood'].append(([('Glass Bottle',24),('Wheat',1280)],24)) - cauldronInputs['Wood'].append(([('Glass Bottle',10),('Nether Wart',1280)],10)) - cauldronInputs['Wood'].append(([('Glass Bottle',10),('Baked Potato',1280)],10)) - cauldronInputs['Wood'].append(([('Glass Bottle',8),('Cookie',1280)],8)) - cauldronInputs['Wood'].append(([('Glass Bottle',14),('Carrot',1280)],14)) - #cauldronInputs['Wood'].append(([('Glass Bottle',64),('Melon',1280)],64)) - cauldronInputs['Iron']=[] - cauldronInputs['Iron'].append(([('Glass Bottle',24),('Carrot',256),('Cactus',256),('Bread',256)],24)) - cauldronInputs['Iron'].append(([('Glass Bottle',14),('Carrot',256),('Nether Wart',256),('Baked Potato',256)],14)) - cauldronInputs['Iron'].append(([('Glass Bottle',42),('Carrot',128),('Cocoa',64),('Pumpkin',64),('Cactus',64),('Bread',64),('Cooked Beef',32)],42)) - cauldronInputs['Iron'].append(([('Glass Bottle',42),('Nether Wart',256),('Melon Block',64),('Sugar Cane',64),('Cookie',512),('Baked Potato',64),('Grilled Pork',64)],42)) - cauldronInputs['Diamond']=[] - cauldronInputs['Diamond'].append(([('Glass Bottle',128),('Carrot',96),('Melon Block',32),('Cactus',256),('Red Rose',8),('Rotten Flesh',128),('Red Mushroom',32),('Vine',32),('Bread',128),('Grilled Pork',32)],128)) - cauldronInputs['Diamond'].append(([('Glass Bottle',128),('Nether Wart',64),('Melon Block',32),('Sugar Cane',128),('Yellow Flower',16),('Rotten Flesh',128),('Brown Mushroom',64),('Vine',32),('Baked Potato',256),('Cooked Chicken',16)],128)) - cauldronInputs['Diamond'].append(([('Glass Bottle',128),('Wheat',128),('Cocoa',16),('Pumpkin',128),('Cactus',256),('Red Rose',8),('Spider Eye',32),('Red Mushroom',16),('Grass',32),('Cooked Fish',16)],128)) - cauldronInputs['Diamond'].append(([('Glass Bottle',128),('Nether Wart',64),('Pumpkin',128),('Sugar Cane',128),('Yellow Flower',16),('Spider Eye',32),('Brown Mushroom',64),('Grass',64),('Cookie',256),('Cooked Beef',32)],128)) - for cauldron in cauldronInputs.keys(): - i=0 - for recipeInput,bottles in cauldronInputs[cauldron]: - id=cauldron+'_XP_Bottle_'+str(i) - i+=1 - inputs[id]=[ItemStack(name=name,amount=amount) for name,amount in recipeInput] - outputs[id]=[ItemStack(name='Exp Bottle',amount=bottles)] - recipes[id]=Recipe(identifier=id,name='Brew XP Bottles - '+str(i),inputs=inputs[id],outputs=outputs[id]) - factories[cauldron+'_Cauldron'].addRecipe(recipes[id]) - - #inputs[id+'_Bulk']=[itemStack.modifyAmount(64) for itemStack in recipes[id].inputs] - #outputs[id+'_Bulk']=[itemStack.modifyAmount(64) for itemStack in recipes[id].outputs] - #recipes[id+'_Bulk']=Recipe(identifier=id+'_Bulk',name='Brew XP Bottles - '+str(i),inputs=inputs[id+'_Bulk'],outputs=outputs[id+'_Bulk'],time=128) - #factories[cauldron+'_Cauldron'].addRecipe(recipes[id+'_Bulk']) - - - #Add in repair - for factory in factories.values(): - factory.repairMultiple=min([input.amount for input in [input.modifyAmount(mMod) for input in factory.inputs]]) - factory.repairInputs=[input.modifyAmount(1.0/factory.repairMultiple) for input in [input.modifyAmount(mMod) for input in factory.inputs]] - return (factories,recipes) - -def createCraftingRecipes(): - enabledRecipes=[] - enabledRecipes.append(CraftedRecipe('XP to Emerald',inputs={'a':ItemStack('Exp Bottle',amount=9)},output=ItemStack('Emerald'))) - enabledRecipes.append(CraftedRecipe('Emerald to XP',inputs={'a':ItemStack('Emerald')},output=ItemStack('Exp Bottle',amount=9))) - enabledRecipes.append(CraftedRecipe('Stone to Double Slab',inputs={'s':ItemStack('Stone')},shape=['sss','sss'],output=ItemStack('Double Stone Slab'))) - enabledRecipes.append(CraftedRecipe('Slab to Double Slab',inputs={'s':ItemStack('Stone Slab')},shape=['s','s'],output=ItemStack('Double Stone Slab'))) - return enabledRecipes - -def checkConflicts(factories): - for factory in factories.values(): - for otherFactory in factories.values(): - if factory!=otherFactory: - sameInputs=len(factory.inputs)==len(otherFactory.inputs) - for itemStack in factory.inputs: - inOtherFactory=False - for otherItemStack in otherFactory.inputs: - if itemStack.equals(otherItemStack): - inOtherFactory=True - sameInputs=sameInputs and inOtherFactory - if sameInputs: - print 'Conflict of '+factory.name+' and '+otherFactory.name -def fixConflicts(factories): - for factory in factories.values(): - for otherFactory in factories.values(): - if factory!=otherFactory: - sameInputs=len(factory.inputs)==len(otherFactory.inputs) - for itemStack in factory.inputs: - inOtherFactory=False - for otherItemStack in otherFactory.inputs: - if itemStack.equals(otherItemStack): - inOtherFactory=True - sameInputs=sameInputs and inOtherFactory - if sameInputs: - factory.inputs[0].amount+=1 - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/Config Scripts/ParseConfig.py b/Config Scripts/ParseConfig.py deleted file mode 100644 index 1d781541..00000000 --- a/Config Scripts/ParseConfig.py +++ /dev/null @@ -1,58 +0,0 @@ -from ConfigObjects import Recipe, Enchantment, ItemStack, Factory, defaults -import ConfigObjects -import pydot -import math - -class ParseConfig: - @staticmethod - def prettyList(config,filename='prettylist.txt'): - myfile=open(filename,'w') - myfile.write('\n\n##Factory List') - sortedFactoryKeys=config['factories'].keys() - sortedFactoryKeys.sort() - types=[('Enchanting',['Cauldron']),('Smelting',['Smelter']),('Food',['Bakery','Grill']),('Equipment',['Smithy']),('Items',['Wool','Rail'])] - for type,names in types: - myfile.write('\n\n- ['+type+'](https://github.com/gmlaxfanatic/FactoryMod/wiki#'+type.lower()+')') - for type,names in types: - myfile.write('\n\n###'+type) - for key in sortedFactoryKeys: - factory=config['factories'][key] - if sum([(name in factory.identifier) for name in names])>0: - myfile.write('\n\n**'+factory.name+'**') - myfile.write(' - ') - for input in factory.inputs: - myfile.write(str(input.amount)+' '+input.name) - if(factory.inputs.index(input)!=len(factory.inputs)-1): - myfile.write(', ') - for recipe in factory.outputRecipes: - myfile.write('\n\n\t') - for output in recipe.outputs: - myfile.write(str(output.amount)+' '+output.name) - myfile.write(' for ') - for input in recipe.inputs: - myfile.write(str(input.amount)+' '+input.name) - if(recipe.inputs.index(input)!=len(recipe.inputs)-1): - myfile.write(', ') - myfile.write(' using '+str(int(math.ceil(recipe.time/float(factory.fuelTime))))+' '+factory.fuel.name) - - @staticmethod - def saveConfig(config,filename='config.yml'): - from shutil import copyfile - copyfile('template.yml',filename) - myfile=open(filename,'a') - myfile.write('\ncrafting:') - myfile.write('\n disable:') - for disabled_recipe in config['disabled_recipes']: - myfile.write('\n - '+disabled_recipe) - myfile.write('\n enable:') - for enabledRecipe in config['enabled_recipes']: - myfile.write(enabledRecipe.cOutput()) - myfile.write('\nproduction_factories:') - sortedFactoryKeys=config['factories'].keys() - sortedFactoryKeys.sort() - for key in sortedFactoryKeys: - myfile.write(config['factories'][key].cOutput()) - myfile.write('\nproduction_recipes:') - for recipe in config['recipes'].values(): - myfile.write(recipe.cOutput()) - myfile.close() \ No newline at end of file diff --git a/Config Scripts/template.yml b/Config Scripts/template.yml deleted file mode 100644 index 612336a8..00000000 --- a/Config Scripts/template.yml +++ /dev/null @@ -1,149 +0,0 @@ -#Example: production_general -# update_cycle: 20 the period of ticks between which factories are updated -# maintenance_cycle: 15 the period of ticks between which the maintenance of the factories are updated -# maintenance_rate: 1 %Modifies the rate at which factories degrade, higher numbers degrade the factories faster -#Example recipe entry with defaults included any section should be able to be excluded -# TITLE: (Don't use spaces, should be a unique identifier) -# name: Default Name (Displayed name to user) -# production_time: 1 (Time to produce the recipe) -# inputs: (only include if there are inputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# upgrades: (only include if there are inputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# outputs: (only include if there are outputs) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# enchantments: -# Common Name: -# type: (Offificial bukkit enchantment name, Require) -# level: 1 (level of the enchantment -# probability: 1 (0-1 probability of the enchantment being applied) -# output_recipes: -# - TITLE (TITLE of the output recipe) -# use_once: false (If this recipe is removed after its first use) -# maintenance: 0 (Maximum amount of maintence required for this recipe) -###################################################################### -#Example factory entry with defaults included any section should be able to be excluded -# TITLE: (Don't use spaces, should be a unique identifier) -# name: Default Name (Displayed name to user) -# fuel: (Defaults to charcoal if not present, only first entry used) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default)# fuel_time: 1 (Time that a piece of fuel lasts) -# fuel_time: 1 (Time which fuel lasts) -# inputs: (required) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -# production_recipes: -# - TITLE (title of recipe) -# repair_material: (Defaults to coal if none are present) -# Common Name: -# material: MATERIAL_NAME (Official bukkit material name) -# amount: 1 (number of a particular item) -# durability: 0 (damage value, 0 represents max durability, negative represents greater than max) -# data: 0 (data value of the item stack -# display_name: (display name of the item, null by default) -# lore: (lore of the item, null by default) -copy_defaults: false -general: - central_block: WORKBENCH - save_cycle: 15 - return_build_materials: false - citadel_enabled: true - factory_interaction_material: STICK - disable_experience: true -production_general: - update_cycle: 20 - repair_period: 28 - disrepair_period: 14 -printing_presses: - fuel: - Charcoal: - material: 'COAL' - durability: 1 - costs: - construction: - "Iron block": - material: 'IRON_BLOCK' - amount: 60 - "Redstone": - material: REDSTONE - amount: 256 - "Quartz": - material: QUARTZ - amount: 64 - "Piston": - material: PISTON_BASE - amount: 20 - "Gold plate": - material: GOLD_PLATE - amount: 20 - plates: - "Iron ingot": - material: 'IRON_INGOT' - amount: 4 - "Gold nugget": - material: "GOLD_NUGGET" - amount: 1 - repair: - "Iron block": - material: 'IRON_BLOCK' - amount: 1 - repair_multiple: 5 - binding: # Each - Leather: - material: 'LEATHER' - amount: 1 - page_lot: - Paper: - material: 'PAPER' - amount: 4 - Ink: - material: 'INK_SACK' - durability: 0 - amount: 1 - pages_per_lot: 32 - pamphlet_lot: - Paper: - material: 'PAPER' - amount: 8 - Ink: - material: 'INK_SACK' - durability: 0 - amount: 1 - pamphlets_per_lot: 32 - security_lot: - "Gold nuggets": - material: 'GOLD_NUGGET' - amount: 1 - "Cactus green": - material: 'INK_SACK' - durability: 2 - amount: 6 - security_notes_per_lot: 64 diff --git a/Config Scripts/enchantments.csv b/Name tables/enchantments.csv similarity index 100% rename from Config Scripts/enchantments.csv rename to Name tables/enchantments.csv diff --git a/Config Scripts/materials.csv b/Name tables/materials.csv similarity index 100% rename from Config Scripts/materials.csv rename to Name tables/materials.csv diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 061d3589..6e0279a0 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -20,6 +20,7 @@ import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; +import com.github.igotyou.FactoryMod.eggs.SorterEgg; import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; @@ -27,6 +28,7 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.ItemMap; @@ -157,6 +159,13 @@ private void parseFactory(ConfigurationSection config) { manager.addFactoryCreationEgg(PipeStructure.class, pipeSetupCost, egg); break; + case "SORTER": + egg = parseSorter(config); + ItemMap sorterSetupCost = parseItemMap(config + .getConfigurationSection("setupcost")); + manager.addFactoryCreationEgg(BlockFurnaceStructure.class, + sorterSetupCost, egg); + break; default: plugin.severe("Could not identify factory type " + config.getString("type")); @@ -165,6 +174,34 @@ private void parseFactory(ConfigurationSection config) { } + public SorterEgg parseSorter(ConfigurationSection config) { + String name = config.getString("name"); + int update; + if (config.contains("updatetime")) { + update = (int) parseTime(config.getString("updatetime")); + } else { + update = defaultUpdateTime; + } + ItemStack fuel; + if (config.contains("fuel")) { + fuel = parseItemMap(config.getConfigurationSection("fuel")) + .getItemStackRepresentation().get(0); + } else { + fuel = defaultFuel; + } + int fuelIntervall; + if (config.contains("fuel_consumption_intervall")) { + fuelIntervall = (int) parseTime(config + .getString("fuel_consumption_intervall")); + } else { + fuelIntervall = defaultFuelConsumptionTime; + } + int sortTime = (int) parseTime(config.getString("sort_time")); + int matsPerSide = config.getInt("maximum_materials_per_side"); + return new SorterEgg(name, update, fuel, fuelIntervall, sortTime, + matsPerSide); + } + public PipeEgg parsePipe(ConfigurationSection config) { String name = config.getString("name"); int update; diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index a308e0cc..bbde81f8 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -1,5 +1,7 @@ package com.github.igotyou.FactoryMod; +import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; +import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; @@ -13,6 +15,8 @@ public class FactoryMod extends ACivMod { private static MenuBuilder mb; public void onEnable() { + handle = new FactoryModCommandHandler(); + handle.registerCommands(); super.onEnable(); plugin = this; MultiBlockStructure.initializeBlockFaceMap(); @@ -21,6 +25,7 @@ public void onEnable() { mb = new MenuBuilder(); manager.loadFactories(); registerListeners(); + FurnCraftChestInteractionManager.prep(); info("Successfully enabled"); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 1557e42b..f304af53 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -2,21 +2,24 @@ import java.util.HashMap; import java.util.HashSet; +import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Chest; +import org.bukkit.block.Dispenser; import org.bukkit.block.Dropper; import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; -import com.github.igotyou.FactoryMod.utility.FactoryFileHandler; +import com.github.igotyou.FactoryMod.utility.FileHandler; import com.github.igotyou.FactoryMod.utility.ItemMap; /** @@ -25,7 +28,7 @@ */ public class FactoryModManager { protected FactoryMod plugin; - private FactoryFileHandler fileHandler; + private FileHandler fileHandler; private HashMap, HashMap> factoryCreationRecipes; private HashMap locations; private HashMap eggs; @@ -47,7 +50,7 @@ public FactoryModManager(FactoryMod plugin, this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; - fileHandler = new FactoryFileHandler(this); + fileHandler = new FileHandler(this); factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); @@ -66,6 +69,10 @@ public FactoryModManager(FactoryMod plugin, // pipe possibleCenterBlocks.add(Material.DROPPER); possibleInteractionBlock.add(Material.DROPPER); + + // sorter + possibleCenterBlocks.add(Material.DISPENSER); + possibleInteractionBlock.add(Material.DISPENSER); } /** @@ -86,6 +93,25 @@ public String getCompactLore() { return compactLore; } + /** + * Gets the setupcost for a specific factory + * + * @param c + * Class of the structure type the factory is using + * @param name + * Name of the factory + * @return Setupcost if the factory if it was found or null if it wasnt + */ + public ItemMap getSetupCost(Class c, String name) { + for (Entry entry : factoryCreationRecipes.get(c) + .entrySet()) { + if (entry.getValue().getName().equals(name)) { + return entry.getKey(); + } + } + return null; + } + /** * Adds a factory and the locations of its blocks to the manager * @@ -106,6 +132,13 @@ public boolean isCitadelEnabled() { return citadelEnabled; } + /** + * @return All eggs contained in this manager + */ + public HashMap getAllEggs() { + return eggs; + } + /** * @return Which material is used to interact with factories, stick by * default @@ -221,6 +254,31 @@ public void attemptCreation(Block b, Player p) { + "There is no pipe with the given creation materials"); } } + return; + } + BlockFurnaceStructure bfs = new BlockFurnaceStructure(b); + if (bfs.isComplete()) { + HashMap eggs = factoryCreationRecipes + .get(BlockFurnaceStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs + .get(new ItemMap(((Dispenser) (bfs.getCenter() + .getBlock().getState())).getInventory())); + if (egg != null) { + Factory f = egg.hatch(bfs, p); + if (f != null) { + ((Dispenser) (bfs.getCenter().getBlock().getState())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + } + + } else { + p.sendMessage(ChatColor.RED + + "There is no sorter with the given creation materials"); + } + } } } } diff --git a/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java b/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java new file mode 100644 index 00000000..7e56a792 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java @@ -0,0 +1,13 @@ +package com.github.igotyou.FactoryMod.commands; + +import com.github.igotyou.FactoryMod.commands.commands.Menu; + +import vg.civcraft.mc.civmodcore.command.CommandHandler; + +public class FactoryModCommandHandler extends CommandHandler{ + public void registerCommands() { + addCommands(new Menu("fm")); + } + + +} diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java new file mode 100644 index 00000000..d80ba5e6 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -0,0 +1,45 @@ +package com.github.igotyou.FactoryMod.commands.commands; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; + +import vg.civcraft.mc.civmodcore.command.PlayerCommand; + +public class Menu extends PlayerCommand { + + public Menu(String name) { + super(name); + setIdentifier("fm"); + setDescription("Opens up the factory brower"); + setUsage("/fm"); + setArguments(0, 1); + } + + @Override + public boolean execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage("Fuck off console man"); + return true; + } + MenuBuilder mb = FactoryMod.getMenuBuilder(); + Player p = (Player) sender; + if (args.length == 0) { + mb.openFactoryBrowser(p, FactoryMod.getManager().getAllEggs().values().iterator() + .next().getName()); + } else { + mb.openFactoryBrowser(p, args[0]); + } + return true; + } + + @Override + public List tabComplete(CommandSender arg0, String [] arg1) { + return new LinkedList(); + } +} diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java new file mode 100644 index 00000000..77f3e2cc --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -0,0 +1,99 @@ +package com.github.igotyou.FactoryMod.eggs; + +import java.util.List; +import java.util.Map; + +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.Sorter; +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.interactionManager.SorterInteractionManager; +import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.repairManager.NoRepairDestroyOnBreakManager; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class SorterEgg implements IFactoryEgg { + private String name; + private int updateTime; + private ItemStack fuel; + private int fuelConsumptionIntervall; + private int sortTime; + private int matsPerSide; + + public SorterEgg(String name, int updateTime, ItemStack fuel, + int fuelConsumptionIntervall, int sortTime, int matsPerSide) { + this.name = name; + this.fuel = fuel; + this.updateTime = updateTime; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.sortTime = sortTime; + this.matsPerSide = matsPerSide; + } + + public Factory hatch(MultiBlockStructure mbs, Player p) { + IInteractionManager im = new SorterInteractionManager(); + IRepairManager rm = new NoRepairDestroyOnBreakManager(); + IPowerManager pm = new FurnacePowerManager( + ((BlockFurnaceStructure) mbs).getFurnace(), fuel, + fuelConsumptionIntervall); + Sorter sorter = new Sorter(im, rm, pm, mbs, updateTime, name, + sortTime, matsPerSide); + ((SorterInteractionManager) im).setSorter(sorter); + return sorter; + } + + public Factory revive(List blocks, Map assignments, + int runTime) { + MultiBlockStructure ps = new BlockFurnaceStructure(blocks); + SorterInteractionManager im = new SorterInteractionManager(); + IRepairManager rm = new NoRepairDestroyOnBreakManager(); + IPowerManager pm = new FurnacePowerManager( + ((BlockFurnaceStructure) ps).getFurnace(), fuel, + fuelConsumptionIntervall); + Sorter sorter = new Sorter(im, rm, pm, ps, updateTime, name, + sortTime, matsPerSide); + ((SorterInteractionManager) im).setSorter(sorter); + sorter.setAssignments(assignments); + if (runTime != 0) { + sorter.attemptToActivate(null); + if (sorter.isActive()) { + sorter.setRunTime(runTime); + } + } + return sorter; + } + + + public String getName() { + return name; + } + + public int getUpdateTime() { + return updateTime; + } + + public ItemStack getFuel() { + return fuel; + } + + public int getFuelConsumptionIntervall() { + return fuelConsumptionIntervall; + } + + public int getSortTime() { + return sortTime; + } + + public int getMaterialsPerSide() { + return matsPerSide; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 1c00c9a3..7c2c416e 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -138,7 +138,7 @@ public void turnFurnaceOn(Block f) { furnace.getInventory().clear(); f.setType(Material.BURNING_FURNACE); furnace = (Furnace) f.getState(); - furnace.setRawData(data); + furnace.getData().setData(data); furnace.update(); furnace.setBurnTime(Short.MAX_VALUE); furnace.getInventory().setContents(oldContents); @@ -151,7 +151,7 @@ public void turnFurnaceOff(Block f) { furnace.getInventory().clear(); f.setType(Material.FURNACE); furnace = (Furnace) f.getState(); - furnace.setRawData(data); + furnace.getData().setData(data); furnace.update(); furnace.getInventory().setContents(oldContents); } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 856b3a5c..2cd94400 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -72,6 +72,7 @@ public FurnaceInventory getFurnaceInventory() { */ public void attemptToActivate(Player p) { // TODO Citadel stuff + mbs.recheckComplete(); if (mbs.isComplete()) { if (hasInputMaterials()) { if (pm.powerAvailable()) { diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index cca0720c..26de4f4f 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -36,6 +36,7 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, public void attemptToActivate(Player p) { // TODO Citadel stuff + mbs.recheckComplete(); if (mbs.isComplete()) { if (transferMaterialsAvailable()) { if (pm.powerAvailable()) { diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java new file mode 100644 index 00000000..01c9ad36 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -0,0 +1,220 @@ +package com.github.igotyou.FactoryMod.factories; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; +import com.github.igotyou.FactoryMod.powerManager.IPowerManager; +import com.github.igotyou.FactoryMod.repairManager.IRepairManager; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.utility.ItemMap; + +public class Sorter extends Factory { + private Map assignedMaterials; + private int runTime; + private int matsPerSide; + private int sortTime; + + public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, + MultiBlockStructure mbs, int updateTime, String name, int sortTime, + int matsPerSide) { + super(im, rm, pm, mbs, updateTime, name); + assignedMaterials = new HashMap(); + this.sortTime = sortTime; + runTime = 0; + this.matsPerSide = matsPerSide; + for (BlockFace bf : MultiBlockStructure.allBlockSides) { + assignedMaterials.put(bf, new ItemMap()); + } + assignedMaterials.remove(((BlockFurnaceStructure) mbs).getFurnace().getFace(mbs.getCenter().getBlock())); + } + + public void attemptToActivate(Player p) { + mbs.recheckComplete(); + if (mbs.isComplete()) { + activate(); + if (pm.powerAvailable()) { + if (sortableMaterialsAvailable()) { + activate(); + } else { + if (p != null) { + p.sendMessage(ChatColor.RED + + "Nothing to sort available"); + } + } + } else { + if (p != null) { + p.sendMessage(ChatColor.RED + "No fuel available"); + } + } + } else { + rm.breakIt(); + } + } + + public void setAssignments(Map assigns) { + this.assignedMaterials = assigns; + } + + public void activate() { + turnFurnaceOn(((BlockFurnaceStructure) mbs).getFurnace()); + active = true; + run(); + } + + public void deactivate() { + turnFurnaceOff(((BlockFurnaceStructure) mbs).getFurnace()); + active = false; + } + + public void run() { + if (active && mbs.isComplete() && pm.powerAvailable() + && sortableMaterialsAvailable()) { + if (runTime >= sortTime) { + mbs.recheckComplete(); + if (!mbs.isComplete()) { + deactivate(); + return; + } + sortStack(); + runTime = 0; + if (sortableMaterialsAvailable()) { + scheduleUpdate(); + } else { + deactivate(); + } + } else { + if (pm.getPowerCounter() >= pm.getPowerConsumptionIntervall() - 1) { + pm.consumePower(); + pm.setPowerCounter(0); + + } else { + pm.increasePowerCounter(updateTime); + } + runTime += updateTime; + scheduleUpdate(); + } + } else { + deactivate(); + } + } + + public boolean assigned(ItemStack is) { + return getSide(is) != null; + } + + public BlockFace getSide(ItemStack is) { + for (Entry entry : assignedMaterials.entrySet()) { + if (entry.getValue().getAmount(is) != 0) { + return entry.getKey(); + } + } + return null; + } + + public void addAssignment(BlockFace bf, ItemStack is) { + assignedMaterials.get(bf).addItemStack(is.clone()); + } + + public void removeAssignment(ItemStack is) { + for (Entry entry : assignedMaterials.entrySet()) { + if (entry.getValue().getAmount(is) != 0) { + entry.getValue().removeItemStackCompletly(is); + break; + } + } + } + + public void sortStack() { + Block center = mbs.getCenter().getBlock(); + Inventory inv = getCenterInventory(); + boolean transferred = false; + for (BlockFace bf : MultiBlockStructure.allBlockSides) { + if (center.getRelative(bf).getState() instanceof InventoryHolder) { + Inventory relInv = ((InventoryHolder) center.getRelative(bf) + .getState()).getInventory(); + ItemMap im = assignedMaterials.get(bf); + for (ItemStack is : inv.getContents()) { + if (is != null && is.getType() != Material.AIR + && im.getAmount(is) != 0) { + if (new ItemMap(is).fitsIn(relInv)) { + inv.removeItem(is); + relInv.addItem(is); + transferred = true; + break; + } + } + } + } + if (transferred) { + break; + } + } + } + + public void setRunTime(int runtime) { + this.runTime = runtime; + } + + public Inventory getCenterInventory() { + return ((InventoryHolder) mbs.getCenter().getBlock().getState()) + .getInventory(); + } + + private boolean sortableMaterialsAvailable() { + for (ItemStack is : getCenterInventory()) { + if (is != null && is.getType() != Material.AIR) { + for (Entry entry : assignedMaterials + .entrySet()) { + if (mbs.getCenter().getBlock().getRelative(entry.getKey()) + .getState() instanceof InventoryHolder + && entry.getValue().getAmount(is) != 0) { + return true; + } + } + } + } + return false; + } + + public int getMatsPerSide() { + return matsPerSide; + } + + public String serialize() { + StringBuilder sb = new StringBuilder(); + sb.append("SORTER"); + sb.append(separator); + sb.append(name); + sb.append(separator); + sb.append(runTime); + for (Entry entry : assignedMaterials.entrySet()) { + sb.append(separator); + sb.append(entry.getKey().toString()); + for (ItemStack is : entry.getValue().getItemStackRepresentation()) { + sb.append(separator); + sb.append(is.getType().toString()); + sb.append(separator); + sb.append(is.getDurability()); + } + sb.append(separator); + sb.append("STOP"); + } + for (Block b : mbs.getAllBlocks()) { + sb.append(serializeBlock(b)); + } + return sb.toString(); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 80de9c4d..3dc09c3c 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -5,12 +5,10 @@ import java.util.List; import org.bukkit.ChatColor; -import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; -import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; @@ -29,24 +27,23 @@ public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); - private ReinforcementManager rm; - private MenuBuilder mb; + private static ReinforcementManager rm; + private static MenuBuilder mb; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { this.fccf = fccf; - prepCitadel(); - mb = FactoryMod.getMenuBuilder(); } public FurnCraftChestInteractionManager() { - prepCitadel(); + } public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } - private void prepCitadel() { + public static void prep() { + mb = FactoryMod.getMenuBuilder(); if (FactoryMod.getManager().isCitadelEnabled()) { rm = Citadel.getReinforcementManager(); } else { @@ -191,7 +188,7 @@ public void blockBreak(Player p, Block b) { } } - public void leftClick(Player p, Block b) { + public void leftClick(Player p, Block b, BlockFace bf) { if (p.getItemInHand().getType() != FactoryMod.getManager() .getFactoryInteractionMaterial()) { return; @@ -199,9 +196,8 @@ public void leftClick(Player p, Block b) { if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getChest())) { // chest interaction if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff - ClickableInventory ci = new ClickableInventory( - new ArrayList(), 54, fccf.getCurrentRecipe() - .getRecipeName()); + ClickableInventory ci = new ClickableInventory(54, fccf + .getCurrentRecipe().getRecipeName()); int index = 4; for (ItemStack is : ((InputRecipe) fccf.getCurrentRecipe()) .getInputRepresentation(fccf.getInventory())) { @@ -298,8 +294,7 @@ public void clicked(Player p) { recipes.put(c, recipe); clickables.add(c); } - ClickableInventory ci = new ClickableInventory(clickables, 36, - "Select a recipe"); + ClickableInventory ci = new ClickableInventory(36,"Select a recipe"); ci.showInventory(p); return; } @@ -312,7 +307,7 @@ public void clicked(Player p) { } } - public void rightClick(Player p, Block b) { + public void rightClick(Player p, Block b, BlockFace bf) { // Nothing to do here, every block already has a right click // functionality } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index 752ca920..746d86c3 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -1,6 +1,7 @@ package com.github.igotyou.FactoryMod.interactionManager; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; @@ -18,7 +19,7 @@ public interface IInteractionManager { * @param b * Block which was clicked */ - public void rightClick(Player p, Block b); + public void rightClick(Player p, Block b, BlockFace bf); /** * Called if a player left clicks a block, which is part of the factory of @@ -29,7 +30,7 @@ public interface IInteractionManager { * @param b * Block which was clicked */ - public void leftClick(Player p, Block b); + public void leftClick(Player p, Block b, BlockFace bf); /** * Called if a block, which is part of the factory of this manager is diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index bb9c2a57..89ebeb49 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -5,6 +5,7 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.inventory.ItemStack; @@ -30,11 +31,11 @@ public void setPipe(Pipe pipe) { this.pipe = pipe; } - public void rightClick(Player p, Block b) { + public void rightClick(Player p, Block b, BlockFace bf) { // no use for this here } - public void leftClick(Player p, Block b) { + public void leftClick(Player p, Block b, BlockFace bf) { ItemStack hand = p.getItemInHand(); if (b.equals(((PipeStructure) (pipe.getMultiBlockStructure())) .getStart())) { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java new file mode 100644 index 00000000..5fd7ea07 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -0,0 +1,75 @@ +package com.github.igotyou.FactoryMod.interactionManager; + +import org.bukkit.ChatColor; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.factories.Sorter; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; + +public class SorterInteractionManager implements IInteractionManager { + private Sorter sorter; + private BlockFurnaceStructure bfs; + + public SorterInteractionManager(Sorter sorter) { + setSorter(sorter); + } + + public SorterInteractionManager() { + + } + + public void setSorter(Sorter sorter) { + this.sorter = sorter; + this.bfs = (BlockFurnaceStructure) sorter.getMultiBlockStructure(); + } + + public void blockBreak(Player p, Block b) { + sorter.getRepairManager().breakIt(); + if (p != null) { + p.sendMessage(ChatColor.RED + "The sorter was destroyed"); + } + } + + public void rightClick(Player p, Block b, BlockFace bf) { + //not needed here + } + + public void leftClick(Player p, Block b, BlockFace bf) { + if (b.equals(bfs.getFurnace())) { + if (p.getItemInHand() + .getType() + .equals(FactoryMod.getManager() + .getFactoryInteractionMaterial())) { + sorter.attemptToActivate(p); + } + } else { // center + ItemStack is = p.getItemInHand(); + BlockFace side = sorter.getSide(is); + if (side == null) { + sorter.addAssignment(bf, is); + p.sendMessage(ChatColor.GREEN + "Added " + + is.getType().toString() + " to " + bf.toString()); + } else { + if (side == bf) { + sorter.removeAssignment(is); + p.sendMessage(ChatColor.GOLD + "Removed " + + is.getType().toString() + " from " + + side.toString()); + } else { + p.sendMessage(ChatColor.RED + + "This item is already associated with " + side.toString()); + } + } + } + } + + public void redStoneEvent(BlockRedstoneEvent e) { + + } + +} diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 01a0a979..a7f00f9b 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -4,6 +4,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -101,17 +102,19 @@ public void playerInteract(PlayerInteractEvent e) { Player player = e.getPlayer(); if (block != null && manager.isPossibleInteractionBlock(block.getType())) { + BlockFace bf = e.getBlockFace(); Factory c = manager.getFactoryAt(block); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (c != null) { - c.getInteractionManager().rightClick(player, block); + c.getInteractionManager().rightClick(player, block, bf); } else { if (block.getType() == Material.CHEST) { for (Block b : MultiBlockStructure .searchForBlockOnSides(block, Material.CHEST)) { Factory f = manager.getFactoryAt(b); if (f != null) { - f.getInteractionManager().rightClick(player, b); + f.getInteractionManager().rightClick(player, b, + bf); } } } @@ -132,13 +135,13 @@ public void playerInteract(PlayerInteractEvent e) { Factory f = manager.getFactoryAt(b); if (f != null) { f.getInteractionManager().leftClick(player, - b); + b, bf); } } } } } else { - c.getInteractionManager().leftClick(player, block); + c.getInteractionManager().leftClick(player, block, bf); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 1552db7f..63618d47 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -39,7 +39,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.WORKBENCH); - ItemStackUtils.setName(res, "Upgrade to " + egg.getName()); + ItemStackUtils.setName(res, name); return res; } diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java new file mode 100644 index 00000000..33384174 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -0,0 +1,56 @@ +package com.github.igotyou.FactoryMod.structures; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; + +public class BlockFurnaceStructure extends MultiBlockStructure { + + private Block center; + private Block furnace; + private boolean complete = false; + + public BlockFurnaceStructure(Block center) { + if (center.getType() == Material.DISPENSER) { + this.center = center; + for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { + furnace = b; + complete = true; + break; + } + } + } + + public BlockFurnaceStructure(List blocks) { + this.center = blocks.get(0); + this.furnace = blocks.get(1); + } + + public Location getCenter() { + return center.getLocation(); + } + + public Block getFurnace() { + return furnace; + } + + public List getAllBlocks() { + List blocks = new LinkedList(); + blocks.add(center); + blocks.add(furnace); + return blocks; + } + + public boolean isComplete() { + return complete; + } + + public void recheckComplete() { + complete = (center.getType() == Material.DISPENSER && (furnace + .getType() == Material.FURNACE || furnace.getType() == Material.BURNING_FURNACE)); + } + +} diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index 0a737e29..d219c694 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -19,6 +19,7 @@ public class FurnCraftChestStructure extends MultiBlockStructure { private Block CraftingTable; private Block Furnace; private Block Chest; + private boolean complete; public FurnCraftChestStructure(Block center) { if (center.getType() == Material.WORKBENCH) { @@ -59,6 +60,20 @@ public FurnCraftChestStructure(Block center) { } } + if (Chest != null && Furnace != null) { + complete = true; + } + else { + complete = false; + } + } + + public void recheckComplete() { + complete = CraftingTable != null + && CraftingTable.getType() == Material.WORKBENCH + && Furnace != null + && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) + && Chest != null && Chest.getType() == Material.CHEST; } public FurnCraftChestStructure(List blocks) { @@ -68,11 +83,7 @@ public FurnCraftChestStructure(List blocks) { } public boolean isComplete() { - return CraftingTable != null - && CraftingTable.getType() == Material.WORKBENCH - && Furnace != null - && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) - && Chest != null && Chest.getType() == Material.CHEST; + return complete; } public Block getCraftingTable() { diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 995d0205..8e3d701f 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -16,10 +16,10 @@ * */ public abstract class MultiBlockStructure { - protected static BlockFace[] allBlockSides = new BlockFace[] { + public static BlockFace[] allBlockSides = new BlockFace[] { BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; - protected static BlockFace[] northEastWestSouthSides = new BlockFace[] { + public static BlockFace[] northEastWestSouthSides = new BlockFace[] { BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; protected static Map dataBlockFaceConversion; @@ -78,6 +78,12 @@ public static void initializeBlockFaceMap() { */ public abstract List getAllBlocks(); + /** + * Rechecks whether all blocks of this factory exists and sets the variable + * used for isComplete(), if needed + */ + public abstract void recheckComplete(); + /** * @return center block of the factory which it was created from */ diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 05da17bc..b50a8a34 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -21,6 +21,7 @@ public class PipeStructure extends MultiBlockStructure { private List glassPipe; private static Material pipeMaterial = Material.STAINED_GLASS; private static int maximumLength = 32; + private boolean complete; public PipeStructure(Block startBlock) { if (startBlock.getType() != Material.DROPPER) { @@ -97,22 +98,28 @@ public List getAllBlocks() { res.add(end); return res; } - - public boolean isComplete() { + + public void recheckComplete() { if (start == null || furnace == null || end == null || start.getType() != Material.DROPPER || (furnace.getType() != Material.FURNACE && furnace.getType() != Material.BURNING_FURNACE) || !(end.getState() instanceof InventoryHolder)) { - return false; + complete = false; + return; } for (Block b : glassPipe) { if (b.getType() != pipeMaterial) { - return false; + complete = false; + return; } } - return true; + complete = true; + } + + public boolean isComplete() { + return complete; } public int getLength() { diff --git a/src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java similarity index 75% rename from src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java rename to src/com/github/igotyou/FactoryMod/utility/FileHandler.java index a5a6a0f0..e1a7f024 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FactoryFileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -6,6 +6,7 @@ import java.io.FileReader; import java.io.FileWriter; import java.util.Collection; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -14,21 +15,24 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; +import com.github.igotyou.FactoryMod.eggs.SorterEgg; import com.github.igotyou.FactoryMod.factories.Factory; -public class FactoryFileHandler { +public class FileHandler { private FactoryMod plugin; private FactoryModManager manager; File saveFile; File backup; - public FactoryFileHandler(FactoryModManager manager) { + public FileHandler(FactoryModManager manager) { plugin = FactoryMod.getPlugin(); this.manager = manager; saveFile = new File(plugin.getDataFolder().getAbsolutePath() @@ -121,7 +125,7 @@ private void loadFromFile(File f, Map eggs) { for (; i < content.length; i++) { if (content[i].equals("NONE")) { mats = null; - i+=2; + i += 2; break; } if (content[i].equals("BLOCKS")) { @@ -142,6 +146,42 @@ private void loadFromFile(File f, Map eggs) { Factory p = pipeEgg.revive(pipeBlocks, mats, runTime); manager.addFactory(p); counter++; + break; + case "SORTER": + Map assignments = new HashMap(); + SorterEgg sorterEgg = (SorterEgg) eggs.get(content[1]); + int runTimeSorter = Integer.valueOf(content[2]); + int index = 3; + for (int q = 0; q < 6; q++) { + BlockFace bf = BlockFace.valueOf(content[index++]); + ItemMap im = new ItemMap(); + while(true) { + if (content[index].equals("STOP")) { + index++; + break; + } + else { + Material m = Material.valueOf(content[index]); + int dura = Integer.valueOf(content[index+1]); + im.addItemStack(new ItemStack(m, 1, (short)dura)); + index +=2; + + } + } + assignments.put(bf, im); + } + List sorterBlocks = new LinkedList(); + for (; index < content.length; index += 4) { + World w = plugin.getServer().getWorld(content[index]); + int x = Integer.parseInt(content[index+1]); + int y = Integer.parseInt(content[index + 2]); + int z = Integer.parseInt(content[index + 3]); + sorterBlocks.add(new Location(w, x, y, z).getBlock()); + } + Factory s = sorterEgg.revive(sorterBlocks, assignments, runTimeSorter); + manager.addFactory(s); + counter++; + break; } line = reader.readLine(); } diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java index bb60cf7d..b885a7cf 100644 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java @@ -122,7 +122,7 @@ public void removeItemStack(ItemStack input) { * ItemStack to remove */ public void removeItemStackCompletly(ItemStack input) { - items.remove(input); + items.remove(createMapConformCopy(input)); } public int hashCode() { diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index ff28ebb2..6924b0eb 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.utility; -import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -16,6 +15,7 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; +import vg.civcraft.mc.civmodcore.inventorygui.ScheduledInventoryOpen; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; @@ -25,13 +25,30 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; public class MenuBuilder { private FactoryModManager manager; private Map factoryViewed = new HashMap(); + private Map pipeViewed = new HashMap(); + + // child is key, parent is value + private Map parentFactories = new HashMap(); + public MenuBuilder() { manager = FactoryMod.getManager(); + for (IFactoryEgg egg : manager.getAllEggs().values()) { + if (egg instanceof FurnCraftChestEgg) { + FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; + for (IRecipe rec : furnegg.getRecipes()) { + if (rec instanceof Upgraderecipe) { + parentFactories.put(egg.getName(), + ((Upgraderecipe) rec).getEgg().getName()); + } + } + } + } } public void openFactoryBrowser(Player p, String startingFac) { @@ -45,17 +62,14 @@ public void openFactoryBrowser(Player p, String startingFac) { if (egg instanceof FurnCraftChestEgg) { FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; factoryViewed.put(p.getUniqueId(), furnegg.getName()); - ArrayList clickables = new ArrayList(); - clickables.ensureCapacity(27); - + ClickableInventory browser = new ClickableInventory( + InventoryType.CHEST, furnegg.getName()); // creation option ItemStack creationStack = new ItemStack(Material.CHEST); ItemStackUtils.setName(creationStack, "Setup"); - ItemStackUtils - .addLore( - creationStack, - ChatColor.LIGHT_PURPLE - + "Click to display more information on how to setup this factory"); + ItemStackUtils.addLore(creationStack, ChatColor.LIGHT_PURPLE + + "Click to display more information", + ChatColor.LIGHT_PURPLE + "on how to setup this factory"); Clickable creationClickable = new Clickable(creationStack) { @Override public void clicked(Player arg0) { @@ -63,13 +77,14 @@ public void clicked(Player arg0) { factoryViewed.get(arg0.getUniqueId())); } }; - clickables.set(10, creationClickable); + browser.setSlot(creationClickable, 10); // recipe option ItemStack recipeStack = new ItemStack(Material.WORKBENCH); ItemStackUtils.setName(recipeStack, "Recipes"); ItemStackUtils.addLore(recipeStack, ChatColor.LIGHT_PURPLE - + "Click to display all recipes this factory can run"); + + "Click to display all recipes", ChatColor.LIGHT_PURPLE + + "this factory can run"); Clickable recipeClickable = new Clickable(recipeStack) { @Override public void clicked(Player arg0) { @@ -77,14 +92,15 @@ public void clicked(Player arg0) { factoryViewed.get(arg0.getUniqueId())); } }; - clickables.set(13, recipeClickable); + browser.setSlot(recipeClickable, 13); // upgrade option ItemStack upgradeStack = new ItemStack(Material.FURNACE); ItemStackUtils.setName(upgradeStack, "Upgrades"); - ItemStackUtils - .addLore(upgradeStack, - "Click to display more information about the possible upgrades to this factory"); + ItemStackUtils.addLore(upgradeStack, ChatColor.LIGHT_PURPLE + + "Click to display more information about", + ChatColor.LIGHT_PURPLE + + "the possible upgrades to this factory"); Clickable upgradeClickable = new Clickable(upgradeStack) { @Override public void clicked(Player arg0) { @@ -92,23 +108,18 @@ public void clicked(Player arg0) { factoryViewed.get(arg0.getUniqueId())); } }; - clickables.set(16, upgradeClickable); + browser.setSlot(upgradeClickable, 16); - ClickableInventory browser = new ClickableInventory( - clickables, - InventoryType.CHEST, - furnegg.getName() - + " --- Click on an option to display more information"); - browser.showInventory(p); + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), browser, p); } } private void openRecipeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); + ClickableInventory recipeInventory = new ClickableInventory(36, + "All recipes for " + facName); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); - ArrayList clickables = new ArrayList(); - clickables.ensureCapacity(36); List recipes = egg.getRecipes(); // put recipes @@ -121,7 +132,7 @@ public void clicked(Player arg0) { ItemStackUtils.getName(this.getItemStack())); } }; - clickables.set(i, c); + recipeInventory.setSlot(c, i); } // back option @@ -134,28 +145,91 @@ public void clicked(Player arg0) { openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); } }; - clickables.set(31, backClickable); - - ClickableInventory recipeInventory = new ClickableInventory(clickables, - 36, "All recipes for " + facName - + " --- Click one to display more information about it"); - recipeInventory.showInventory(p); + recipeInventory.setSlot(backClickable, 31); + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), + recipeInventory, p); } private void openSetupBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager .getEgg(factoryViewed.get(p.getUniqueId())); + FurnCraftChestEgg parEgg = (FurnCraftChestEgg) manager + .getEgg(parentFactories.get(egg.getName())); + ClickableInventory ci = new ClickableInventory(54, "How to get a " + + egg.getName()); + ItemStack cr = new ItemStack(Material.WORKBENCH); + ItemStack fur = new ItemStack(Material.FURNACE); + ItemStack che = new ItemStack(Material.CHEST); + if (parEgg == null) {// creation factory + ItemStackUtils.setLore(cr, "This factory can be created with", + "a normal crafting table, furnace and chest"); + ItemStackUtils.setLore(che, "Arrange the 3 blocks like this,", + "put the materials below in the chest", + "and hit the craftingtable with a stick"); + DecorationStack furnDec = new DecorationStack(fur); + DecorationStack chestDec = new DecorationStack(che); + DecorationStack craStack = new DecorationStack(cr); + ci.setSlot(furnDec, 12); + ci.setSlot(craStack, 13); + ci.setSlot(chestDec, 14); + ItemMap im = manager.getSetupCost(FurnCraftChestStructure.class, + egg.getName()); + int slot = 36; + for (ItemStack is : im.getItemStackRepresentation()) { + DecorationStack dec = new DecorationStack(is); + ci.setSlot(dec, slot); + slot++; + } + } else { + Upgraderecipe rec = null; + for (IRecipe reci : parEgg.getRecipes()) { + if (reci instanceof Upgraderecipe + && ((Upgraderecipe) rec).getEgg().equals(egg)) { + rec = (Upgraderecipe) reci; + } + } + ItemStackUtils.setLore(cr, "Upgrade from a " + parEgg.getName()); + Clickable craCli = new Clickable(cr) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, parentFactories.get(factoryViewed + .get(arg0.getUniqueId()))); + } + }; + ci.setSlot(craCli, 13); + Clickable furCli = new Clickable(fur) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, parentFactories.get(factoryViewed + .get(arg0.getUniqueId()))); + } + }; + ci.setSlot(furCli, 12); + Clickable cheCli = new Clickable(che) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, parentFactories.get(factoryViewed + .get(arg0.getUniqueId()))); + } + }; + ci.setSlot(cheCli, 14); + int slot = 36; + for (ItemStack is : rec.getInput().getItemStackRepresentation()) { + DecorationStack dec = new DecorationStack(is); + ci.setSlot(dec, slot); + slot++; + } + } + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } private void openUpgradeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager .getEgg(factoryViewed.get(p.getUniqueId())); - ClickableInventory ci = new ClickableInventory( - new ArrayList(), 18, - "Click to display more information on an upgrade"); + ClickableInventory ci = new ClickableInventory(18, "Possible upgrades"); List upgrades = new LinkedList(); for (IRecipe recipe : egg.getRecipes()) { if (recipe instanceof Upgraderecipe) { @@ -169,22 +243,24 @@ private void openUpgradeBrowser(Player p, String facName) { Clickable noUpgrades = new Clickable(bar) { @Override public void clicked(Player p) { - openUpgradeBrowser(p, factoryViewed.get(p.getUniqueId())); + openFactoryBrowser(p, factoryViewed.get(p.getUniqueId())); } }; ci.setSlot(noUpgrades, 4); } else { for (IRecipe recipe : upgrades) { - Clickable c= new Clickable(((InputRecipe)recipe).getRecipeRepresentation()) { + Clickable c = new Clickable( + ((InputRecipe) recipe).getRecipeRepresentation()) { @Override public void clicked(Player p) { - openDetailedRecipeBrowser(p, ItemStackUtils.getName(this.getItemStack())); + openDetailedRecipeBrowser(p, + ItemStackUtils.getName(this.getItemStack())); } }; ci.addSlot(c); } } - ci.showInventory(p); + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } private void openDetailedRecipeBrowser(Player p, String recipeName) { @@ -198,9 +274,7 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { break; } } - ClickableInventory ci = new ClickableInventory( - new ArrayList(), 54, recipeName + " in factory " - + factoryViewed.get(p.getUniqueId())); + ClickableInventory ci = new ClickableInventory(54, recipeName); ItemStack inputStack = new ItemStack(Material.PAPER); ItemStackUtils.setName(inputStack, "Input materials"); ItemStackUtils.addLore(inputStack, @@ -270,11 +344,56 @@ public void clicked(Player arg0) { } } } - ci.showInventory(p); + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } - + public void showPipeMaterials(Player p, Pipe pipe) { - + pipeViewed.put(p.getUniqueId(), pipe); + showPipeMaterialPart(p, pipe, 0); + } + + private void showPipeMaterialPart(Player p, Pipe pipe, int start) { + List mats = pipe.getAllowedMaterials(); + if (mats == null) { + p.sendMessage(ChatColor.RED + + "No allowed materials specified for this pipe"); + return; + } + ClickableInventory ci = new ClickableInventory(54, + "Currently allowed materials"); + for (int i = start; i < mats.size() && i < (start + 45); i++) { + ItemStack is = new ItemStack(mats.get(i)); + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + pipeViewed.get(arg0.getUniqueId()).removeAllowedMaterial( + this.getItemStack().getType()); + arg0.sendMessage(ChatColor.GOLD + "Removed " + + this.getItemStack().getType() + + " as allowed material"); + } + }; + ci.addSlot(c); + } + if (mats.size() >= (start + 45)) { + ItemStack nextPage = new ItemStack(Material.ARROW); + ItemStackUtils.setName(nextPage, "Next page"); + ItemStackUtils.addLore(nextPage, ChatColor.LIGHT_PURPLE + + "Click to show entries upwards from " + (start + 45)); + + Clickable nextClick = new Clickable(nextPage) { + @Override + public void clicked(Player arg0) { + showPipeMaterialPart( + arg0, + pipeViewed.get(arg0.getUniqueId()), + Integer.valueOf(this.getItemStack().getItemMeta() + .getLore().get(0).split(" ")[7])); + } + }; + ci.setSlot(nextClick, 49); + } + ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } } From 700e240f746d5bf41ba677e0ed13375d27aa219c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 7 Jan 2016 12:48:31 +0100 Subject: [PATCH 197/459] Overall fixes and improvements+ working gui --- .../enchantments.csv => enchantments.csv | 0 Name tables/materials.csv => materials.csv | 0 plugin.yml | 8 +- .../github/igotyou/FactoryMod/FactoryMod.java | 2 + .../igotyou/FactoryMod/factories/Sorter.java | 4 + .../FurnCraftChestInteractionManager.java | 6 +- .../SorterInteractionManager.java | 23 +++- .../FactoryMod/recipes/CompactingRecipe.java | 10 ++ .../recipes/DecompactingRecipe.java | 12 ++ .../FactoryMod/recipes/InputRecipe.java | 8 +- .../FactoryMod/recipes/ProductionRecipe.java | 6 + .../FactoryMod/recipes/RepairRecipe.java | 3 + .../FactoryMod/recipes/Upgraderecipe.java | 3 + .../FactoryMod/structures/PipeStructure.java | 2 + .../FactoryMod/utility/MenuBuilder.java | 103 ++++++++++++++---- .../igotyou/FactoryMod/utility/NiceNames.java | 58 ++++++++++ 16 files changed, 217 insertions(+), 31 deletions(-) rename Name tables/enchantments.csv => enchantments.csv (100%) rename Name tables/materials.csv => materials.csv (100%) create mode 100644 src/com/github/igotyou/FactoryMod/utility/NiceNames.java diff --git a/Name tables/enchantments.csv b/enchantments.csv similarity index 100% rename from Name tables/enchantments.csv rename to enchantments.csv diff --git a/Name tables/materials.csv b/materials.csv similarity index 100% rename from Name tables/materials.csv rename to materials.csv diff --git a/plugin.yml b/plugin.yml index d3faa80d..c16a3917 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,11 @@ name: ${project.name} -main: com.github.igotyou.FactoryMod.FactoryModPlugin +main: com.github.igotyou.FactoryMod.FactoryMod author: igotyou version: ${project.version} depend: [NameLayer, Citadel] +commands: + fm: + permission: fm.public +permissions: + fm.public: + default: true \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index bbde81f8..7cb66bd8 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -6,6 +6,7 @@ import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; +import com.github.igotyou.FactoryMod.utility.NiceNames; import vg.civcraft.mc.civmodcore.ACivMod; @@ -26,6 +27,7 @@ public void onEnable() { manager.loadFactories(); registerListeners(); FurnCraftChestInteractionManager.prep(); + new NiceNames().loadNames(); info("Successfully enabled"); } diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 01c9ad36..2788edf8 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -126,6 +126,10 @@ public BlockFace getSide(ItemStack is) { public void addAssignment(BlockFace bf, ItemStack is) { assignedMaterials.get(bf).addItemStack(is.clone()); } + + public ItemMap getItemsForSide(BlockFace face) { + return assignedMaterials.get(face); + } public void removeAssignment(ItemStack is) { for (Entry entry : assignedMaterials.entrySet()) { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 3dc09c3c..ea43c495 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -272,7 +272,7 @@ public void clicked(Player arg0) { } if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getCraftingTable())) { // crafting table interaction - ArrayList clickables = new ArrayList(); + ClickableInventory ci = new ClickableInventory(36,"Select a recipe"); for (IRecipe rec : fccf.getRecipes()) { InputRecipe recipe = (InputRecipe) (rec); Clickable c = new Clickable(recipe.getRecipeRepresentation()) { @@ -292,9 +292,9 @@ public void clicked(Player p) { } }; recipes.put(c, recipe); - clickables.add(c); + ci.addSlot(c); } - ClickableInventory ci = new ClickableInventory(36,"Select a recipe"); + ci.showInventory(p); return; } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index 5fd7ea07..1810c0fe 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -10,17 +10,21 @@ import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; +import com.github.igotyou.FactoryMod.utility.NiceNames; public class SorterInteractionManager implements IInteractionManager { private Sorter sorter; private BlockFurnaceStructure bfs; + private MenuBuilder mb; public SorterInteractionManager(Sorter sorter) { setSorter(sorter); + mb = FactoryMod.getMenuBuilder(); } public SorterInteractionManager() { - + mb = FactoryMod.getMenuBuilder(); } public void setSorter(Sorter sorter) { @@ -36,7 +40,7 @@ public void blockBreak(Player p, Block b) { } public void rightClick(Player p, Block b, BlockFace bf) { - //not needed here + // not needed here } public void leftClick(Player p, Block b, BlockFace bf) { @@ -48,21 +52,30 @@ public void leftClick(Player p, Block b, BlockFace bf) { sorter.attemptToActivate(p); } } else { // center + if (p.isSneaking() + && p.getItemInHand() + .getType() + .equals(FactoryMod.getManager() + .getFactoryInteractionMaterial())) { + mb.showSorterFace(p, sorter, bf); + return; + } ItemStack is = p.getItemInHand(); BlockFace side = sorter.getSide(is); if (side == null) { sorter.addAssignment(bf, is); p.sendMessage(ChatColor.GREEN + "Added " - + is.getType().toString() + " to " + bf.toString()); + + NiceNames.getName(is) + " to " + bf.toString()); } else { if (side == bf) { sorter.removeAssignment(is); p.sendMessage(ChatColor.GOLD + "Removed " - + is.getType().toString() + " from " + + NiceNames.getName(is) + " from " + side.toString()); } else { p.sendMessage(ChatColor.RED - + "This item is already associated with " + side.toString()); + + "This item is already associated with " + + side.toString()); } } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 9496cdaa..c101d3ea 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -73,6 +73,10 @@ public void applyEffect(Inventory i, Factory f) { public List getInputRepresentation(Inventory i) { List result = new LinkedList(); + if (i == null) { + result.add(new ItemStack(Material.STONE, 64)); + return result; + } result = createLoredStacksForInfo(i); for (ItemStack is : i.getContents()) { if (is != null) { @@ -88,6 +92,12 @@ public List getInputRepresentation(Inventory i) { public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); + if (i == null) { + ItemStack is = new ItemStack(Material.STONE, 64); + compact(is); + result.add(is); + return result; + } for (ItemStack is : i.getContents()) { if (is != null) { if (compactable(is)) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 08d206f7..64aac98c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -10,6 +10,7 @@ import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Used to decompact itemstacks, which means a single item with compacted lore @@ -75,6 +76,13 @@ public void applyEffect(Inventory i, Factory f) { public List getInputRepresentation(Inventory i) { List result = new LinkedList(); + if (i == null) { + ItemStack is = new ItemStack(Material.STONE, 64); + ItemStackUtils.addLore(is, compactedLore); + is.setAmount(1); + result.add(is); + return result; + } result = createLoredStacksForInfo(i); for (ItemStack is : i.getContents()) { if (is != null) { @@ -99,6 +107,10 @@ public ItemStack getRecipeRepresentation() { public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); + if (i == null) { + result.add(new ItemStack(Material.STONE, 64)); + return result; + } for (ItemStack is : i.getContents()) { if (is != null) { ItemMeta im = is.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 1eb018bb..33f95057 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -29,7 +29,9 @@ public InputRecipe(String name, int productionTime, ItemMap input) { /** * Used to get a representation of a recipes input materials, which is * displayed in an item gui to illustrate the recipe and to give additional - * information + * information. If null is given instead of an inventory just general + * information should be returned, which doesnt depend on a specific + * instance * * @param i * Inventory for which the recipe would be run, this is used to @@ -43,7 +45,9 @@ public InputRecipe(String name, int productionTime, ItemMap input) { /** * Used to get a representation of a recipes output materials, which is * displayed in an item gui to illustrate the recipe and to give additional - * information + * information. If null is given instead of an inventory just general + * information should be returned, which doesnt depend on a specific + * instance * * @param i * Inventory for which the recipe would be run, this is used to diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 412eb54b..7d7e7c0b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -41,6 +41,9 @@ public ItemMap getCurrentOutput(Inventory i) { public List getOutputRepresentation(Inventory i) { List stacks = output.getItemStackRepresentation(); + if (i == null) { + return stacks; + } int possibleRuns = input.getMultiplesContainedIn(i); for (ItemStack is : stacks) { ItemStackUtils.addLore(is, ChatColor.GREEN @@ -51,6 +54,9 @@ public List getOutputRepresentation(Inventory i) { } public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } return createLoredStacksForInfo(i); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 5bc78adc..831ad773 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -36,6 +36,9 @@ public List getOutputRepresentation(Inventory i) { } public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } return createLoredStacksForInfo(i); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 63618d47..50a2cab5 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -44,6 +44,9 @@ public ItemStack getRecipeRepresentation() { } public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } LinkedList result = new LinkedList(); ItemMap inventoryMap = new ItemMap(i); ItemMap possibleRuns = new ItemMap(); diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index b50a8a34..f63ac262 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -54,6 +54,7 @@ public PipeStructure(Block startBlock) { if (b.getState() instanceof InventoryHolder) { end = b; this.length = length; + complete = true; foundEnd = true; break; } else if (b.getType() == pipeMaterial @@ -84,6 +85,7 @@ public PipeStructure(List blocks) { } this.glassPipe = glass; length = glassPipe.size(); + recheckComplete(); } public Location getCenter() { diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 6924b0eb..6f11c86f 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -6,22 +6,33 @@ import java.util.Map; import java.util.UUID; +import net.minecraft.server.v1_8_R3.ItemAnvil; + import org.bukkit.ChatColor; +import org.bukkit.DyeColor; import org.bukkit.Material; +import org.bukkit.block.BlockFace; +import org.bukkit.block.banner.Pattern; +import org.bukkit.block.banner.PatternType; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.BannerMeta; +import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; import vg.civcraft.mc.civmodcore.inventorygui.ScheduledInventoryOpen; +import com.avaje.ebean.annotation.CreatedTimestamp; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.Pipe; +import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; @@ -31,10 +42,11 @@ public class MenuBuilder { private FactoryModManager manager; private Map factoryViewed = new HashMap(); - private Map pipeViewed = new HashMap(); - + private Map viewed = new HashMap(); // child is key, parent is value private Map parentFactories = new HashMap(); + private DecorationStack input; + private DecorationStack output; public MenuBuilder() { manager = FactoryMod.getManager(); @@ -42,13 +54,34 @@ public MenuBuilder() { if (egg instanceof FurnCraftChestEgg) { FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; for (IRecipe rec : furnegg.getRecipes()) { + System.out.println(rec.toString()); if (rec instanceof Upgraderecipe) { - parentFactories.put(egg.getName(), - ((Upgraderecipe) rec).getEgg().getName()); + parentFactories.put(((Upgraderecipe) rec).getEgg() + .getName(), egg.getName()); } } } } + ItemStack inp = new ItemStack(Material.PAPER); + ItemStackUtils.setName(inp, "Input"); + ItemStackUtils.setLore(inp, ChatColor.LIGHT_PURPLE + + "The items below are required"); + input = new DecorationStack(inp); + ItemStack outp = new ItemStack(Material.PAPER); + ItemStackUtils.setName(outp, "Output"); + ItemStackUtils.setLore(outp, ChatColor.LIGHT_PURPLE + + "The output of this recipe"); + } + + private DecorationStack createBannerDeco(PatternType... types) { + ItemStack is = new ItemStack(Material.BANNER); + BannerMeta bm = (BannerMeta) is.getItemMeta(); + bm.setBaseColor(DyeColor.GRAY); + for (PatternType type : types) { + bm.addPattern(new Pattern(DyeColor.YELLOW, type)); + } + is.setItemMeta(bm); + return new DecorationStack(is); } public void openFactoryBrowser(Player p, String startingFac) { @@ -109,7 +142,6 @@ public void clicked(Player arg0) { } }; browser.setSlot(upgradeClickable, 16); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), browser, p); } @@ -138,7 +170,8 @@ public void clicked(Player arg0) { // back option ItemStack backStack = new ItemStack(Material.ARROW); ItemStackUtils.setName(backStack, "Back to factory overview"); - ItemStackUtils.addLore(backStack, "Click to go back"); + ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -152,21 +185,24 @@ public void clicked(Player arg0) { private void openSetupBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); - FurnCraftChestEgg egg = (FurnCraftChestEgg) manager - .getEgg(factoryViewed.get(p.getUniqueId())); + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); FurnCraftChestEgg parEgg = (FurnCraftChestEgg) manager - .getEgg(parentFactories.get(egg.getName())); + .getEgg(parentFactories.get(facName)); ClickableInventory ci = new ClickableInventory(54, "How to get a " + egg.getName()); ItemStack cr = new ItemStack(Material.WORKBENCH); ItemStack fur = new ItemStack(Material.FURNACE); ItemStack che = new ItemStack(Material.CHEST); if (parEgg == null) {// creation factory - ItemStackUtils.setLore(cr, "This factory can be created with", - "a normal crafting table, furnace and chest"); - ItemStackUtils.setLore(che, "Arrange the 3 blocks like this,", - "put the materials below in the chest", - "and hit the craftingtable with a stick"); + ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE + + "This factory can be created with", + ChatColor.LIGHT_PURPLE + + "a normal crafting table, furnace and chest"); + ItemStackUtils.setLore(che, ChatColor.LIGHT_PURPLE + + "Arrange the 3 blocks like this,", ChatColor.LIGHT_PURPLE + + "put the materials below in the chest", + ChatColor.LIGHT_PURPLE + + "and hit the craftingtable with a stick"); DecorationStack furnDec = new DecorationStack(fur); DecorationStack chestDec = new DecorationStack(che); DecorationStack craStack = new DecorationStack(cr); @@ -185,7 +221,7 @@ private void openSetupBrowser(Player p, String facName) { Upgraderecipe rec = null; for (IRecipe reci : parEgg.getRecipes()) { if (reci instanceof Upgraderecipe - && ((Upgraderecipe) rec).getEgg().equals(egg)) { + && ((Upgraderecipe) reci).getEgg().equals(egg)) { rec = (Upgraderecipe) reci; } } @@ -199,6 +235,8 @@ public void clicked(Player arg0) { } }; ci.setSlot(craCli, 13); + ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE + + "Click to display information", "on this factory"); Clickable furCli = new Clickable(fur) { @Override public void clicked(Player arg0) { @@ -222,6 +260,7 @@ public void clicked(Player arg0) { slot++; } } + ci.setSlot(input, 31); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } @@ -239,7 +278,8 @@ private void openUpgradeBrowser(Player p, String facName) { if (upgrades.size() == 0) { ItemStack bar = new ItemStack(Material.BARRIER); ItemStackUtils.setName(bar, "No upgrades available"); - ItemStackUtils.addLore(bar, "Click to go back"); + ItemStackUtils.addLore(bar, ChatColor.LIGHT_PURPLE + + "Click to go back"); Clickable noUpgrades = new Clickable(bar) { @Override public void clicked(Player p) { @@ -348,7 +388,7 @@ public void clicked(Player arg0) { } public void showPipeMaterials(Player p, Pipe pipe) { - pipeViewed.put(p.getUniqueId(), pipe); + viewed.put(p.getUniqueId(), pipe); showPipeMaterialPart(p, pipe, 0); } @@ -366,8 +406,9 @@ private void showPipeMaterialPart(Player p, Pipe pipe, int start) { Clickable c = new Clickable(is) { @Override public void clicked(Player arg0) { - pipeViewed.get(arg0.getUniqueId()).removeAllowedMaterial( - this.getItemStack().getType()); + ((Pipe) viewed.get(arg0.getUniqueId())) + .removeAllowedMaterial(this.getItemStack() + .getType()); arg0.sendMessage(ChatColor.GOLD + "Removed " + this.getItemStack().getType() + " as allowed material"); @@ -386,7 +427,7 @@ public void clicked(Player arg0) { public void clicked(Player arg0) { showPipeMaterialPart( arg0, - pipeViewed.get(arg0.getUniqueId()), + (Pipe) viewed.get(arg0.getUniqueId()), Integer.valueOf(this.getItemStack().getItemMeta() .getLore().get(0).split(" ")[7])); } @@ -396,4 +437,26 @@ public void clicked(Player arg0) { ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } + public void showSorterFace(Player p, Sorter s, BlockFace face) { + ClickableInventory.forceCloseInventory(p); + ClickableInventory ci = new ClickableInventory(54, + "Items for this side"); + viewed.put(p.getUniqueId(), s); + for (ItemStack is : s.getItemsForSide(face) + .getItemStackRepresentation()) { + is.setAmount(1); + ci.addSlot(new Clickable(is) { + @Override + public void clicked(Player arg0) { + ((Sorter) viewed.get(arg0.getUniqueId())) + .removeAssignment(this.getItemStack()); + arg0.sendMessage(ChatColor.GOLD + "Removed " + + NiceNames.getName(this.getItemStack())); + } + }); + } + ci.showInventory(p); + + } + } diff --git a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java new file mode 100644 index 00000000..644ba8e7 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java @@ -0,0 +1,58 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.HashMap; +import java.util.Map; + +import org.bukkit.inventory.ItemStack; +import org.bukkit.Material; + +import com.github.igotyou.FactoryMod.FactoryMod; + +public class NiceNames { + private static Map> names; + + public static String getName(ItemStack is) { + Map duraMap = names.get(is.getType()); + if (duraMap == null) { + return "COULD NOT FIND NAME FOR " + is.getType() + ", dura:" + + is.getDurability(); + } + String res = duraMap.get(is.getDurability()); + if (res == null) { + return "COULD NOT FIND NAME FOR " + is.getType() + ", dura:" + + is.getDurability(); + } else { + return res; + } + } + + public void loadNames() { + names = new HashMap>(); + int counter = 0; + try { + InputStream in = getClass().getResourceAsStream("/materials.csv"); + BufferedReader reader = new BufferedReader( + new InputStreamReader(in)); + String line = reader.readLine(); + while (line != null) { + String[] content = line.split(","); + Map duraMap = names.get(Material + .valueOf(content[1])); + if (duraMap == null) { + duraMap = new HashMap(); + } + duraMap.put(Short.valueOf(content[3]), content[0]); + line = reader.readLine(); + counter++; + } + reader.close(); + } catch (Exception e) { + e.printStackTrace(); + } + FactoryMod.getPlugin().info( + "Imported " + counter + " item name aliases"); + } +} From 2f4e6609bab9bcd05d7d542778c2f85d51a2ff5a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 7 Jan 2016 19:14:21 +0100 Subject: [PATCH 198/459] Enchanting recipes, UI improvements --- .../FurnCraftChestInteractionManager.java | 12 ++ .../DeterministicEnchantingRecipe.java | 85 +++++++++++-- .../recipes/EnchantmentOptions.java | 43 ------- .../recipes/ProbabilisticEnchantment.java | 42 ------- .../recipes/RandomEnchantingRecipe.java | 118 ++++++++++++++++++ .../FactoryMod/recipes/Upgraderecipe.java | 6 + .../FactoryMod/utility/MenuBuilder.java | 68 +++++----- .../igotyou/FactoryMod/utility/NiceNames.java | 5 + 8 files changed, 258 insertions(+), 121 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java delete mode 100644 src/com/github/igotyou/FactoryMod/recipes/ProbabilisticEnchantment.java create mode 100644 src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index ea43c495..0d4c7972 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -5,6 +5,7 @@ import java.util.List; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; @@ -22,6 +23,7 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; import com.github.igotyou.FactoryMod.utility.MenuBuilder; public class FurnCraftChestInteractionManager implements IInteractionManager { @@ -294,6 +296,16 @@ public void clicked(Player p) { recipes.put(c, recipe); ci.addSlot(c); } + ItemStack menuStack = new ItemStack(Material.PAINTING); + ItemStackUtils.setName(menuStack, "Open menu"); + ItemStackUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + "Click to open a detailed menu"); + Clickable menuC = new Clickable(menuStack) { + @Override + public void clicked(Player arg0) { + mb.openFactoryBrowser(arg0, fccf.getName()); + } + }; + ci.setSlot(menuC, 35); ci.showInventory(p); return; diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index 4cbb14da..e1635d5a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -1,24 +1,93 @@ package com.github.igotyou.FactoryMod.recipes; +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; -public class DeterministicEnchantingRecipe { +public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; + private int level; + private Material tool; public DeterministicEnchantingRecipe(String name, int productionTime, - ItemMap input, Enchantment enchant) { - //super(name, productionTime, input); + ItemMap input, Material tool, Enchantment enchant, int level) { + super(name, productionTime, input); this.enchant = enchant; + this.tool = tool; + this.level = level; } - + public boolean enoughMaterialAvailable(Inventory i) { - //TODO TODO TODO - - - return false; + if (input.isContainedIn(i)) { + for (ItemStack is : i.getContents()) { + if (is != null && is.getType() == tool + && is.getItemMeta().getEnchantLevel(enchant) < level) { + return true; + } + } + } + return false; + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = new ItemStack(tool); + is.addEnchantment(enchant, level); + ItemStackUtils.setName(is, name); + return is; + } + + public List getOutputRepresentation(Inventory i) { + ItemStack is = new ItemStack(tool); + is.addEnchantment(enchant, level); + if (i != null) { + ItemStackUtils.addLore( + is, + ChatColor.GREEN + + "Enough materials for " + + String.valueOf(Integer.max(new ItemMap( + new ItemStack(tool)) + .getMultiplesContainedIn(i), input + .getMultiplesContainedIn(i))) + " runs"); + } + List stacks = new LinkedList(); + stacks.add(is); + return stacks; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + List bla = input.getItemStackRepresentation(); + bla.add(new ItemStack(tool)); + return bla; + } + List returns = createLoredStacksForInfo(i); + ItemStack toSt = new ItemStack(tool); + ItemStackUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); + returns.add(toSt); + return returns; + } + + public void applyEffect(Inventory i, Factory f) { + for(ItemStack is:input.getItemStackRepresentation()) { + i.removeItem(is); + } + for(ItemStack is:i.getContents()) { + if (is != null && is.getType() == tool && is.getItemMeta().getEnchantLevel(enchant) < level) { + is.getItemMeta().removeEnchant(enchant); + is.getItemMeta().addEnchant(enchant, level, true); + break; + } + } } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java b/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java deleted file mode 100644 index 0c9c8b20..00000000 --- a/src/com/github/igotyou/FactoryMod/recipes/EnchantmentOptions.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.github.igotyou.FactoryMod.recipes; - -/** - * Wrapper for current and all future enchantment control options. - * - * @author ProgrammerDan - * @since v1.4.0 - * - */ -public class EnchantmentOptions { - private boolean safeOnly; - private boolean ensureOne; - - public static final EnchantmentOptions DEFAULT = new EnchantmentOptions(false, false); - - /** - * Standard constructor, sets the flag values. - * - * @param safeOnly true if only MC combinable enchantments allowed - * @param ensureOne true if should ensure at least one enchantment. - */ - public EnchantmentOptions(boolean safeOnly, boolean ensureOne) { - this.safeOnly = safeOnly; - this.ensureOne = ensureOne; - } - - /** - * Returns true if only safe to combine enchantments should be allowed. - * - * @return the value of the control flag. - */ - public boolean getSafeOnly() { - return this.safeOnly; - } - - /** - * Return true if only mod should ensure at least one enchantment on output. - * @return - */ - public boolean getEnsureOne() { - return this.ensureOne; - } -} diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProbabilisticEnchantment.java b/src/com/github/igotyou/FactoryMod/recipes/ProbabilisticEnchantment.java deleted file mode 100644 index 69d3f8f4..00000000 --- a/src/com/github/igotyou/FactoryMod/recipes/ProbabilisticEnchantment.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.github.igotyou.FactoryMod.recipes; - -import org.bukkit.enchantments.Enchantment; - -/** - * - * @author Brian Landry - */ -public class ProbabilisticEnchantment { - private String name; - private Enchantment enchantment; - private int level; - private double probability; - - public ProbabilisticEnchantment(String name, String enchantment,Integer level,double probability){ - this.name=name; - this.enchantment=Enchantment.getByName(enchantment); - this.level=level.intValue(); - this.probability=probability; - } - - public String getName() - { - return name; - } - - public Enchantment getEnchantment() - { - return enchantment; - } - - public int getLevel() - { - return level; - } - - public double getProbability() - { - return probability; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java new file mode 100644 index 00000000..c655258e --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -0,0 +1,118 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; +import java.util.Random; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; +import com.github.igotyou.FactoryMod.utility.NiceNames; + +public class RandomEnchantingRecipe extends InputRecipe { + private List enchants; + private Material tool; + private static Random rng; + + public class RandomEnchant { + private Enchantment enchant; + private int level; + private double chance; + + public RandomEnchant(Enchantment enchant, int level, double chance) { + this.enchant = enchant; + this.level = level; + this.chance = chance; + } + } + + public RandomEnchantingRecipe(String name, int productionTime, + ItemMap input, Material tool, List enchants) { + super(name, productionTime, input); + this.enchants = enchants; + this.tool = tool; + if (rng == null) { + rng = new Random(); + } + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = new ItemStack(tool); + for (RandomEnchant re : enchants) { + is.addEnchantment(re.enchant, re.level); + } + ItemStackUtils.setName(is, name); + return is; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + List bla = input.getItemStackRepresentation(); + bla.add(new ItemStack(tool)); + return bla; + } + List returns = createLoredStacksForInfo(i); + ItemStack toSt = new ItemStack(tool); + ItemStackUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); + returns.add(toSt); + return returns; + } + + public List getOutputRepresentation(Inventory i) { + ItemStack is = new ItemStack(tool); + for (RandomEnchant re : enchants) { + is.addEnchantment(re.enchant, re.level); + } + if (i != null) { + ItemStackUtils.addLore( + is, + ChatColor.GREEN + + "Enough materials for " + + String.valueOf(Integer.max(new ItemMap( + new ItemStack(tool)) + .getMultiplesContainedIn(i), input + .getMultiplesContainedIn(i))) + " runs"); + } + for (RandomEnchant re : enchants) { + ItemStackUtils.addLore(is, + ChatColor.YELLOW + String.valueOf(re.chance * 100) + + " % chance for " + NiceNames.getName(re.enchant) + + " " + String.valueOf(re.level)); + } + ItemStackUtils.addLore(is, ChatColor.LIGHT_PURPLE + + "At least one guaranteed"); + List stacks = new LinkedList(); + stacks.add(is); + return stacks; + } + + public void applyEffect(Inventory i, Factory f) { + for (ItemStack is : input.getItemStackRepresentation()) { + i.removeItem(is); + } + for (ItemStack is : i.getContents()) { + if (is != null && is.getType() == tool + && !is.getItemMeta().hasEnchants()) { + boolean applied = false; + while (!applied) { + for (RandomEnchant re : enchants) { + if (rng.nextDouble() <= re.chance) { + is.getItemMeta().addEnchant(re.enchant, re.level, + true); + applied = true; + } + } + } + break; + } + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 50a2cab5..44d16793 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -77,11 +77,17 @@ public List getOutputRepresentation(Inventory i) { List res = new LinkedList(); ItemStack cr = new ItemStack(Material.WORKBENCH); ItemStackUtils.setName(cr, egg.getName()); + ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE+ "Upgrade to get new and better recipes"); res.add(cr); ItemStack fur = new ItemStack(Material.FURNACE); ItemStackUtils.setName(fur, egg.getName()); + ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Recipes:"); + for(IRecipe rec : ((FurnCraftChestEgg)egg).getRecipes()) { + ItemStackUtils.addLore(fur, ChatColor.YELLOW + rec.getRecipeName()); + } res.add(fur); ItemStack che = new ItemStack(Material.CHEST); + ItemStackUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Careful, you can not",ChatColor.LIGHT_PURPLE+ "revert upgrades!"); ItemStackUtils.setName(che, egg.getName()); res.add(che); return res; diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 6f11c86f..5bae7c37 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -6,8 +6,6 @@ import java.util.Map; import java.util.UUID; -import net.minecraft.server.v1_8_R3.ItemAnvil; - import org.bukkit.ChatColor; import org.bukkit.DyeColor; import org.bukkit.Material; @@ -18,14 +16,12 @@ import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BannerMeta; -import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; import vg.civcraft.mc.civmodcore.inventorygui.ScheduledInventoryOpen; -import com.avaje.ebean.annotation.CreatedTimestamp; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; @@ -46,7 +42,6 @@ public class MenuBuilder { // child is key, parent is value private Map parentFactories = new HashMap(); private DecorationStack input; - private DecorationStack output; public MenuBuilder() { manager = FactoryMod.getManager(); @@ -54,7 +49,6 @@ public MenuBuilder() { if (egg instanceof FurnCraftChestEgg) { FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; for (IRecipe rec : furnegg.getRecipes()) { - System.out.println(rec.toString()); if (rec instanceof Upgraderecipe) { parentFactories.put(((Upgraderecipe) rec).getEgg() .getName(), egg.getName()); @@ -206,12 +200,12 @@ private void openSetupBrowser(Player p, String facName) { DecorationStack furnDec = new DecorationStack(fur); DecorationStack chestDec = new DecorationStack(che); DecorationStack craStack = new DecorationStack(cr); - ci.setSlot(furnDec, 12); - ci.setSlot(craStack, 13); - ci.setSlot(chestDec, 14); + ci.setSlot(furnDec, 3); + ci.setSlot(craStack, 4); + ci.setSlot(chestDec, 5); ItemMap im = manager.getSetupCost(FurnCraftChestStructure.class, egg.getName()); - int slot = 36; + int slot = 27; for (ItemStack is : im.getItemStackRepresentation()) { DecorationStack dec = new DecorationStack(is); ci.setSlot(dec, slot); @@ -234,7 +228,7 @@ public void clicked(Player arg0) { .get(arg0.getUniqueId()))); } }; - ci.setSlot(craCli, 13); + ci.setSlot(craCli, 4); ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Click to display information", "on this factory"); Clickable furCli = new Clickable(fur) { @@ -244,7 +238,7 @@ public void clicked(Player arg0) { .get(arg0.getUniqueId()))); } }; - ci.setSlot(furCli, 12); + ci.setSlot(furCli, 3); Clickable cheCli = new Clickable(che) { @Override public void clicked(Player arg0) { @@ -252,7 +246,7 @@ public void clicked(Player arg0) { .get(arg0.getUniqueId()))); } }; - ci.setSlot(cheCli, 14); + ci.setSlot(cheCli, 5); int slot = 36; for (ItemStack is : rec.getInput().getItemStackRepresentation()) { DecorationStack dec = new DecorationStack(is); @@ -260,7 +254,18 @@ public void clicked(Player arg0) { slot++; } } - ci.setSlot(input, 31); + ci.setSlot(input, 22); + ItemStack backStack = new ItemStack(Material.ARROW); + ItemStackUtils.setName(backStack, "Back to factory overview"); + ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + + "Click to go back"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + ci.setSlot(backClickable, 18); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } @@ -289,6 +294,10 @@ public void clicked(Player p) { ci.setSlot(noUpgrades, 4); } else { for (IRecipe recipe : upgrades) { + ItemStack recStack = ((InputRecipe) recipe) + .getRecipeRepresentation(); + ItemStackUtils.setLore(recStack, ChatColor.LIGHT_PURPLE + + "Click to display more information"); Clickable c = new Clickable( ((InputRecipe) recipe).getRecipeRepresentation()) { @Override @@ -300,6 +309,17 @@ public void clicked(Player p) { ci.addSlot(c); } } + ItemStack backStack = new ItemStack(Material.ARROW); + ItemStackUtils.setName(backStack, "Back to factory overview"); + ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + + "Click to go back"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + ci.setSlot(backClickable, 17); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } @@ -317,13 +337,9 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { ClickableInventory ci = new ClickableInventory(54, recipeName); ItemStack inputStack = new ItemStack(Material.PAPER); ItemStackUtils.setName(inputStack, "Input materials"); - ItemStackUtils.addLore(inputStack, - "The materials required to run this recipe"); - Clickable inputClickable = new Clickable(inputStack) { - @Override - public void clicked(Player arg0) { - } - }; + ItemStackUtils.addLore(inputStack, ChatColor.LIGHT_PURPLE + + "The materials required to run this recipe"); + DecorationStack inputClickable = new DecorationStack(inputStack); ci.setSlot(inputClickable, 4); int index = 13; for (ItemStack is : rec.getInputRepresentation(null)) { @@ -348,15 +364,11 @@ public void clicked(Player arg0) { ItemStack outputStack = new ItemStack(Material.PAPER); ItemStackUtils.setName(outputStack, "Output/effect"); - Clickable outputClickable = new Clickable(outputStack) { - @Override - public void clicked(Player arg0) { - } - }; - + DecorationStack outputClickable = new DecorationStack(outputStack); ItemStack backStack = new ItemStack(Material.ARROW); ItemStackUtils.setName(backStack, "Back to recipe overview"); - ItemStackUtils.addLore(backStack, "Click to go back"); + ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { diff --git a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java index 644ba8e7..20bfb02f 100644 --- a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java +++ b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.Map; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.Material; @@ -28,6 +29,10 @@ public static String getName(ItemStack is) { return res; } } + + public static String getName(Enchantment enchant) { + return ""; + } public void loadNames() { names = new HashMap>(); From 1014f1a18b695f5a914560469d45ade4b275c42d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 7 Jan 2016 22:58:33 +0100 Subject: [PATCH 199/459] Fix naming scheme for items and add enchantment names --- .../igotyou/FactoryMod/ConfigParser.java | 6 ++-- .../igotyou/FactoryMod/utility/NiceNames.java | 36 +++++++++++++++---- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 6e0279a0..2951d5d4 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -399,11 +399,9 @@ private static ItemMap parseItemMap(ConfigurationSection config) { if (name != null) { im.setDisplayName(name); } - String lore = current.getString("lore"); + List lore = current.getStringList("lore"); if (lore != null) { - List loreList = new LinkedList(); - loreList.add(lore); - im.setLore(loreList); + im.setLore(lore); } if (current.contains("enchants")) { for (String enchantKey : current.getConfigurationSection( diff --git a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java index 20bfb02f..ea824323 100644 --- a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java +++ b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java @@ -13,10 +13,11 @@ import com.github.igotyou.FactoryMod.FactoryMod; public class NiceNames { - private static Map> names; + private static Map> items; + private static Map enchants; public static String getName(ItemStack is) { - Map duraMap = names.get(is.getType()); + Map duraMap = items.get(is.getType()); if (duraMap == null) { return "COULD NOT FIND NAME FOR " + is.getType() + ", dura:" + is.getDurability(); @@ -29,13 +30,14 @@ public static String getName(ItemStack is) { return res; } } - + public static String getName(Enchantment enchant) { - return ""; + return enchants.get(enchant); } public void loadNames() { - names = new HashMap>(); + //item aliases + items = new HashMap>(); int counter = 0; try { InputStream in = getClass().getResourceAsStream("/materials.csv"); @@ -44,10 +46,11 @@ public void loadNames() { String line = reader.readLine(); while (line != null) { String[] content = line.split(","); - Map duraMap = names.get(Material + Map duraMap = items.get(Material .valueOf(content[1])); if (duraMap == null) { duraMap = new HashMap(); + items.put(Material.valueOf(content[1]), duraMap); } duraMap.put(Short.valueOf(content[3]), content[0]); line = reader.readLine(); @@ -59,5 +62,26 @@ public void loadNames() { } FactoryMod.getPlugin().info( "Imported " + counter + " item name aliases"); + + //enchantment aliases + enchants = new HashMap(); + counter = 0; + try { + InputStream in = getClass().getResourceAsStream("/enchantments.csv"); + BufferedReader reader = new BufferedReader( + new InputStreamReader(in)); + String line = reader.readLine(); + while (line != null) { + String[] content = line.split(","); + enchants.put(Enchantment.getByName(content[1]), content[0]); + line = reader.readLine(); + counter++; + } + reader.close(); + } catch (Exception e) { + e.printStackTrace(); + } + FactoryMod.getPlugin().info( + "Imported " + counter + " enchantment aliases"); } } From e74d48b45775ec03c6cdf6ee80be6c0645c6da77 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 8 Jan 2016 01:23:06 +0100 Subject: [PATCH 200/459] Each pipe has a predefined glass color --- .../github/igotyou/FactoryMod/ConfigParser.java | 3 ++- .../igotyou/FactoryMod/FactoryModManager.java | 5 +++++ .../github/igotyou/FactoryMod/eggs/PipeEgg.java | 8 +++++++- .../FactoryMod/structures/PipeStructure.java | 15 +++++++++++---- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 2951d5d4..5ee1ea9e 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -227,8 +227,9 @@ public PipeEgg parsePipe(ConfigurationSection config) { int transferTimeMultiplier = (int) parseTime(config .getString("transfer_time_multiplier")); int transferAmount = config.getInt("transferamount"); + byte color = (byte)config.getInt("glass_color"); return new PipeEgg(name, update, fuel, fuelIntervall, null, - transferTimeMultiplier, transferAmount); + transferTimeMultiplier, transferAmount, color); } public IFactoryEgg parseFCCFactory(ConfigurationSection config) { diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index f304af53..75511fff 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -14,6 +14,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; @@ -240,6 +241,10 @@ public void attemptCreation(Block b, Player p) { IFactoryEgg egg = eggs.get(new ItemMap(((Dropper) (ps .getStart().getState())).getInventory())); if (egg != null) { + if (ps.getGlassColor() != ((PipeEgg)egg).getColor()) { + p.sendMessage(ChatColor.RED + "You dont have the right color of glass for this pipe"); + return; + } Factory f = egg.hatch(ps, p); if (f != null) { ((Dropper) (ps.getStart().getState())) diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index 41ff5f81..2eafb31a 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -26,10 +26,11 @@ public class PipeEgg implements IFactoryEgg { private List allowedMaterials; private int transferTimeMultiplier; private int transferAmount; + private byte color; public PipeEgg(String name, int updateTime, ItemStack fuel, int fuelConsumptionIntervall, List allowedMaterials, - int transferTimeMultiplier, int transferAmount) { + int transferTimeMultiplier, int transferAmount, byte color) { this.name = name; this.fuel = fuel; this.updateTime = updateTime; @@ -37,6 +38,7 @@ public PipeEgg(String name, int updateTime, ItemStack fuel, this.transferTimeMultiplier = transferTimeMultiplier; this.transferAmount = transferAmount; this.allowedMaterials = allowedMaterials; + this.color = color; } public String getName() { @@ -66,6 +68,10 @@ public int getTransferAmount() { public int getTransferTimeMultiplier() { return transferTimeMultiplier; } + + public byte getColor() { + return color; + } public Factory hatch(MultiBlockStructure mbs, Player p) { IInteractionManager im = new PipeInteractionManager(); diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index f63ac262..6d761397 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -19,6 +19,7 @@ public class PipeStructure extends MultiBlockStructure { private Block end; private int length; private List glassPipe; + private byte glassColor; private static Material pipeMaterial = Material.STAINED_GLASS; private static int maximumLength = 32; private boolean complete; @@ -43,6 +44,7 @@ public PipeStructure(Block startBlock) { if (currentBlock.getType() != pipeMaterial) { return; } + glassColor = currentBlock.getData(); glassPipe.add(currentBlock); int length = 1; while (length <= maximumLength) { @@ -58,6 +60,7 @@ public PipeStructure(Block startBlock) { foundEnd = true; break; } else if (b.getType() == pipeMaterial + && b.getData() == glassColor && !b.equals(previousBlock)) { glassPipe.add(b); previousBlock = currentBlock; @@ -77,8 +80,8 @@ public PipeStructure(List blocks) { this.start = blocks.get(0); this.furnace = blocks.get(1); this.end = blocks.get(blocks.size() - 1); - List glass = new LinkedList(); - for(Block b:blocks) { + List glass = new LinkedList(); + for (Block b : blocks) { if (b.getType() == pipeMaterial) { glass.add(b); } @@ -100,7 +103,7 @@ public List getAllBlocks() { res.add(end); return res; } - + public void recheckComplete() { if (start == null || furnace == null @@ -112,7 +115,7 @@ public void recheckComplete() { return; } for (Block b : glassPipe) { - if (b.getType() != pipeMaterial) { + if (b.getType() != pipeMaterial || b.getData() != glassColor) { complete = false; return; } @@ -123,6 +126,10 @@ public void recheckComplete() { public boolean isComplete() { return complete; } + + public byte getGlassColor() { + return glassColor; + } public int getLength() { return length; From 9b4b7cbed79d3166b7a2e3622edf8c7f6651721f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Jan 2016 00:16:56 +0100 Subject: [PATCH 201/459] Make sorter sort a set amount of materials total --- .../igotyou/FactoryMod/ConfigParser.java | 5 ++- .../igotyou/FactoryMod/eggs/SorterEgg.java | 40 +++++++++++-------- .../igotyou/FactoryMod/factories/Sorter.java | 20 +++++++--- .../FactoryMod/structures/PipeStructure.java | 2 +- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 5ee1ea9e..25a12107 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -197,9 +197,10 @@ public SorterEgg parseSorter(ConfigurationSection config) { fuelIntervall = defaultFuelConsumptionTime; } int sortTime = (int) parseTime(config.getString("sort_time")); + int sortamount = config.getInt("sort_amount"); int matsPerSide = config.getInt("maximum_materials_per_side"); return new SorterEgg(name, update, fuel, fuelIntervall, sortTime, - matsPerSide); + matsPerSide, sortamount); } public PipeEgg parsePipe(ConfigurationSection config) { @@ -227,7 +228,7 @@ public PipeEgg parsePipe(ConfigurationSection config) { int transferTimeMultiplier = (int) parseTime(config .getString("transfer_time_multiplier")); int transferAmount = config.getInt("transferamount"); - byte color = (byte)config.getInt("glass_color"); + byte color = (byte) config.getInt("glass_color"); return new PipeEgg(name, update, fuel, fuelIntervall, null, transferTimeMultiplier, transferAmount, color); } diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index 77f3e2cc..8fa70e59 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -27,39 +27,42 @@ public class SorterEgg implements IFactoryEgg { private int fuelConsumptionIntervall; private int sortTime; private int matsPerSide; - + private int sortAmount; + public SorterEgg(String name, int updateTime, ItemStack fuel, - int fuelConsumptionIntervall, int sortTime, int matsPerSide) { + int fuelConsumptionIntervall, int sortTime, int matsPerSide, + int sortAmount) { this.name = name; this.fuel = fuel; this.updateTime = updateTime; this.fuelConsumptionIntervall = fuelConsumptionIntervall; this.sortTime = sortTime; + this.sortAmount = sortAmount; this.matsPerSide = matsPerSide; } - + public Factory hatch(MultiBlockStructure mbs, Player p) { IInteractionManager im = new SorterInteractionManager(); IRepairManager rm = new NoRepairDestroyOnBreakManager(); IPowerManager pm = new FurnacePowerManager( ((BlockFurnaceStructure) mbs).getFurnace(), fuel, fuelConsumptionIntervall); - Sorter sorter = new Sorter(im, rm, pm, mbs, updateTime, name, - sortTime, matsPerSide); + Sorter sorter = new Sorter(im, rm, pm, mbs, updateTime, name, sortTime, + matsPerSide, sortAmount); ((SorterInteractionManager) im).setSorter(sorter); return sorter; } - - public Factory revive(List blocks, Map assignments, - int runTime) { + + public Factory revive(List blocks, + Map assignments, int runTime) { MultiBlockStructure ps = new BlockFurnaceStructure(blocks); SorterInteractionManager im = new SorterInteractionManager(); IRepairManager rm = new NoRepairDestroyOnBreakManager(); IPowerManager pm = new FurnacePowerManager( ((BlockFurnaceStructure) ps).getFurnace(), fuel, fuelConsumptionIntervall); - Sorter sorter = new Sorter(im, rm, pm, ps, updateTime, name, - sortTime, matsPerSide); + Sorter sorter = new Sorter(im, rm, pm, ps, updateTime, name, sortTime, + matsPerSide, sortAmount); ((SorterInteractionManager) im).setSorter(sorter); sorter.setAssignments(assignments); if (runTime != 0) { @@ -70,30 +73,33 @@ public Factory revive(List blocks, Map assignments, } return sorter; } - - + public String getName() { return name; } - + public int getUpdateTime() { return updateTime; } - + public ItemStack getFuel() { return fuel; } - + public int getFuelConsumptionIntervall() { return fuelConsumptionIntervall; } - + public int getSortTime() { return sortTime; } - + public int getMaterialsPerSide() { return matsPerSide; } + + public int getSortAmount() { + return sortAmount; + } } diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 2788edf8..c9ba4587 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -25,13 +25,15 @@ public class Sorter extends Factory { private int runTime; private int matsPerSide; private int sortTime; + private int sortAmount; public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, MultiBlockStructure mbs, int updateTime, String name, int sortTime, - int matsPerSide) { + int matsPerSide, int sortAmount) { super(im, rm, pm, mbs, updateTime, name); assignedMaterials = new HashMap(); this.sortTime = sortTime; + this.sortAmount = sortAmount; runTime = 0; this.matsPerSide = matsPerSide; for (BlockFace bf : MultiBlockStructure.allBlockSides) { @@ -143,7 +145,7 @@ public void removeAssignment(ItemStack is) { public void sortStack() { Block center = mbs.getCenter().getBlock(); Inventory inv = getCenterInventory(); - boolean transferred = false; + int leftToSort = sortAmount; for (BlockFace bf : MultiBlockStructure.allBlockSides) { if (center.getRelative(bf).getState() instanceof InventoryHolder) { Inventory relInv = ((InventoryHolder) center.getRelative(bf) @@ -152,16 +154,22 @@ public void sortStack() { for (ItemStack is : inv.getContents()) { if (is != null && is.getType() != Material.AIR && im.getAmount(is) != 0) { + int removeAmount = Math.min(leftToSort, is.getAmount()); + ItemStack rem = is.clone(); + rem.setAmount(removeAmount); if (new ItemMap(is).fitsIn(relInv)) { - inv.removeItem(is); - relInv.addItem(is); - transferred = true; + inv.removeItem(rem); + relInv.addItem(rem); + leftToSort -=removeAmount; break; } } + if (leftToSort <= 0) { + break; + } } } - if (transferred) { + if (leftToSort <= 0) { break; } } diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 6d761397..cdd19c15 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -21,7 +21,7 @@ public class PipeStructure extends MultiBlockStructure { private List glassPipe; private byte glassColor; private static Material pipeMaterial = Material.STAINED_GLASS; - private static int maximumLength = 32; + private static int maximumLength = 128; private boolean complete; public PipeStructure(Block startBlock) { From 58c0a2cfb130c316b765218295c9bd56eaee7008 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 19 Jan 2016 23:18:07 +0100 Subject: [PATCH 202/459] Such bugfix, much functionality --- .../igotyou/FactoryMod/ConfigParser.java | 9 + .../igotyou/FactoryMod/FactoryModManager.java | 39 +++- .../FactoryMod/commands/commands/Menu.java | 37 +++- .../igotyou/FactoryMod/factories/Factory.java | 17 +- .../factories/FurnCraftChestFactory.java | 51 ++++++ .../igotyou/FactoryMod/factories/Pipe.java | 5 +- .../igotyou/FactoryMod/factories/Sorter.java | 2 +- .../FurnCraftChestInteractionManager.java | 139 ++------------ .../IInteractionManager.java | 2 +- .../PipeInteractionManager.java | 31 +++- .../SorterInteractionManager.java | 33 +++- .../listeners/FactoryModListener.java | 33 +++- .../FactoryMod/recipes/AOERepairRecipe.java | 173 ++++++++++++++++++ .../FactoryMod/recipes/PylonRecipe.java | 110 +++++++++++ .../structures/BlockFurnaceStructure.java | 4 +- .../structures/MultiBlockStructure.java | 43 +++++ .../FactoryMod/structures/PipeStructure.java | 8 +- .../FactoryMod/utility/MenuBuilder.java | 80 +++++++- 18 files changed, 643 insertions(+), 173 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java create mode 100644 src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 25a12107..04eb0cf9 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -22,6 +22,7 @@ import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.eggs.SorterEgg; import com.github.igotyou.FactoryMod.listeners.NetherPortalListener; +import com.github.igotyou.FactoryMod.recipes.AOERepairRecipe; import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; @@ -354,6 +355,14 @@ private IRecipe parseRecipe(ConfigurationSection config) { } result = new Upgraderecipe(name, productionTime, upgradeCost, egg); break; + case "AOEREPAIR": + ItemStack essence = parseItemMap( + config.getConfigurationSection("essence")) + .getItemStackRepresentation().get(0); + int repPerEssence = config.getInt("repair_per_essence"); + int range = config.getInt("range"); + result = new AOERepairRecipe(name, productionTime, essence, range, repPerEssence); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 75511fff..3ed660a3 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -2,6 +2,8 @@ import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; import java.util.Map.Entry; import org.bukkit.ChatColor; @@ -67,11 +69,11 @@ public FactoryModManager(FactoryMod plugin, possibleInteractionBlock.add(Material.BURNING_FURNACE); possibleInteractionBlock.add(Material.CHEST); - // pipe + // sorter possibleCenterBlocks.add(Material.DROPPER); possibleInteractionBlock.add(Material.DROPPER); - // sorter + // pipe possibleCenterBlocks.add(Material.DISPENSER); possibleInteractionBlock.add(Material.DISPENSER); } @@ -238,16 +240,17 @@ public void attemptCreation(Block b, Player p) { HashMap eggs = factoryCreationRecipes .get(PipeStructure.class); if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Dropper) (ps + IFactoryEgg egg = eggs.get(new ItemMap(((Dispenser) (ps .getStart().getState())).getInventory())); if (egg != null) { - if (ps.getGlassColor() != ((PipeEgg)egg).getColor()) { - p.sendMessage(ChatColor.RED + "You dont have the right color of glass for this pipe"); + if (ps.getGlassColor() != ((PipeEgg) egg).getColor()) { + p.sendMessage(ChatColor.RED + + "You dont have the right color of glass for this pipe"); return; } Factory f = egg.hatch(ps, p); if (f != null) { - ((Dropper) (ps.getStart().getState())) + ((Dispenser) (ps.getStart().getState())) .getInventory().clear(); addFactory(f); p.sendMessage(ChatColor.GREEN @@ -267,12 +270,12 @@ public void attemptCreation(Block b, Player p) { .get(BlockFurnaceStructure.class); if (eggs != null) { IFactoryEgg egg = eggs - .get(new ItemMap(((Dispenser) (bfs.getCenter() + .get(new ItemMap(((Dropper) (bfs.getCenter() .getBlock().getState())).getInventory())); if (egg != null) { Factory f = egg.hatch(bfs, p); if (f != null) { - ((Dispenser) (bfs.getCenter().getBlock().getState())) + ((Dropper) (bfs.getCenter().getBlock().getState())) .getInventory().clear(); addFactory(f); p.sendMessage(ChatColor.GREEN @@ -288,6 +291,26 @@ public void attemptCreation(Block b, Player p) { } } + /** + * Gets all the factories within a certain range of a given location + * + * @param l + * Location on which the search is centered + * @param range + * maximum distance from the center allowed + * @return All of the factories which are less or equal than the given range + * away from the given location + */ + public List getNearbyFactories(Location l, int range) { + List facs = new LinkedList(); + for (Factory f : factories) { + if (f.getMultiBlockStructure().getCenter().distance(l) <= range) { + facs.add(f); + } + } + return facs; + } + /** * Adds a factory egg to the manager and associates it with a specific setup * cost in items and a specific MultiBlockStructure which is the physical diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java index d80ba5e6..4214bedd 100644 --- a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -2,11 +2,15 @@ import java.util.LinkedList; import java.util.List; +import java.util.Map.Entry; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.MenuBuilder; import vg.civcraft.mc.civmodcore.command.PlayerCommand; @@ -18,28 +22,47 @@ public Menu(String name) { setIdentifier("fm"); setDescription("Opens up the factory brower"); setUsage("/fm"); - setArguments(0, 1); + setArguments(0, 10); } @Override public boolean execute(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { - sender.sendMessage("Fuck off console man"); + sender.sendMessage(ChatColor.MAGIC + "Fuck off console man"); return true; } MenuBuilder mb = FactoryMod.getMenuBuilder(); Player p = (Player) sender; if (args.length == 0) { - mb.openFactoryBrowser(p, FactoryMod.getManager().getAllEggs().values().iterator() - .next().getName()); + mb.openFactoryBrowser(p, FactoryMod.getManager().getAllEggs() + .values().iterator().next().getName()); } else { - mb.openFactoryBrowser(p, args[0]); + mb.openFactoryBrowser(p, getFactoryName(args)); } return true; } - + @Override public List tabComplete(CommandSender arg0, String [] arg1) { - return new LinkedList(); + List fac = new LinkedList(); + String entered = getFactoryName(arg1); + for(String name:FactoryMod.getManager().getAllEggs().keySet()) { + if (name.toLowerCase().startsWith(entered)) { + fac.add(name); + } + } + return fac; + } + + private String getFactoryName(String[] args) { + if (args.length == 0) { + return ""; + } + StringBuilder sb = new StringBuilder(); + for (String arg : args) { + sb.append(arg); + sb.append(" "); + } + return sb.toString().substring(0, sb.length() - 1).toLowerCase(); } } diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 7c2c416e..83334aec 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -2,9 +2,12 @@ import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.Furnace; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.bukkit.material.DirectionalContainer; +import org.bukkit.material.MaterialData; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; @@ -133,12 +136,15 @@ public void scheduleUpdate() { public void turnFurnaceOn(Block f) { Furnace furnace = (Furnace) f.getState(); - byte data = furnace.getData().getData(); ItemStack[] oldContents = furnace.getInventory().getContents(); + BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); + System.out.println(facing); furnace.getInventory().clear(); f.setType(Material.BURNING_FURNACE); furnace = (Furnace) f.getState(); - furnace.getData().setData(data); + MaterialData data = furnace.getData(); + ((DirectionalContainer)data).setFacingDirection(facing); + furnace.setData(data); furnace.update(); furnace.setBurnTime(Short.MAX_VALUE); furnace.getInventory().setContents(oldContents); @@ -146,12 +152,15 @@ public void turnFurnaceOn(Block f) { public void turnFurnaceOff(Block f) { Furnace furnace = (Furnace) f.getState(); - byte data = furnace.getData().getData(); ItemStack[] oldContents = furnace.getInventory().getContents(); + BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); + System.out.println(facing); furnace.getInventory().clear(); f.setType(Material.FURNACE); furnace = (Furnace) f.getState(); - furnace.getData().setData(data); + MaterialData data = furnace.getData(); + ((DirectionalContainer)data).setFacingDirection(facing); + furnace.setData(data); furnace.update(); furnace.getInventory().setContents(oldContents); } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 2cd94400..7857b4af 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -1,6 +1,9 @@ package com.github.igotyou.FactoryMod.factories; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -16,6 +19,7 @@ import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.PylonRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; @@ -32,6 +36,9 @@ public class FurnCraftChestFactory extends Factory { protected int currentProductionTimer = 0; protected List recipes; protected IRecipe currentRecipe; + protected Map runCount; + + private static HashSet pylonFactories; public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, @@ -39,6 +46,19 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, super(im, rm, ipm, mbs, updateTime, name); this.active = false; this.recipes = recipes; + this.runCount = new HashMap(); + for(IRecipe rec:recipes) { + runCount.put(rec, 0); + } + if (pylonFactories == null) { + pylonFactories = new HashSet(); + } + for (IRecipe rec : recipes) { + if (rec instanceof PylonRecipe) { + pylonFactories.add(this); + break; + } + } } /** @@ -110,6 +130,9 @@ public void attemptToActivate(Player p) { } } } + else { + rm.breakIt(); + } } /** @@ -159,6 +182,12 @@ public int getRunningTime() { return currentProductionTimer; } + public void setRunCount(IRecipe r, Integer count) { + if (recipes.contains(r)) { + runCount.put(r, count); + } + } + /** * Called by the manager each update cycle */ @@ -211,6 +240,8 @@ else if (currentProductionTimer >= currentRecipe return; } else { currentRecipe.applyEffect(getInventory(), this); + runCount.put(currentRecipe, + runCount.get(currentRecipe) + 1); } currentProductionTimer = 0; if (hasInputMaterials() && pm.powerAvailable()) { @@ -234,6 +265,18 @@ public List getRecipes() { return recipes; } + /** + * Pylon recipes have a special functionality, which requires them to know + * all other factories with pylon recipes on the map. Because of that all of + * those factories are kept in a separated hashset, which is provided by + * this method + * + * @return All factories with a pylon recipe + */ + public static HashSet getPylonFactories() { + return pylonFactories; + } + /** * @return The recipe currently selected in this instance */ @@ -252,6 +295,10 @@ public void setRecipe(IRecipe pr) { currentRecipe = pr; } } + + public int getRunCount(IRecipe r) { + return runCount.get(r); + } /** * Sets the internal production timer @@ -284,6 +331,10 @@ public void upgrade(String name, List recipes, ItemStack fuel, } else { currentRecipe = null; } + runCount = new HashMap(); + for(IRecipe rec:recipes) { + runCount.put(rec, 0); + } } public String serialize() { diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 26de4f4f..f7a2ea39 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -33,7 +33,7 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, allowedMaterials = null; runTime = 0; } - + public void attemptToActivate(Player p) { // TODO Citadel stuff mbs.recheckComplete(); @@ -58,6 +58,9 @@ public void attemptToActivate(Player p) { } } } + else { + rm.breakIt(); + } } public void activate() { diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index c9ba4587..6acc2ac6 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -39,7 +39,7 @@ public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, for (BlockFace bf : MultiBlockStructure.allBlockSides) { assignedMaterials.put(bf, new ItemMap()); } - assignedMaterials.remove(((BlockFurnaceStructure) mbs).getFurnace().getFace(mbs.getCenter().getBlock())); + assignedMaterials.remove(mbs.getCenter().getBlock().getFace(((BlockFurnaceStructure)mbs).getFurnace())); } public void attemptToActivate(Player p) { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 0d4c7972..081f193a 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.interactionManager; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -23,6 +22,7 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.ItemStackUtils; import com.github.igotyou.FactoryMod.utility.MenuBuilder; @@ -37,7 +37,7 @@ public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { } public FurnCraftChestInteractionManager() { - + } public void setFactory(FurnCraftChestFactory fccf) { @@ -53,132 +53,25 @@ public static void prep() { } } - public void redStoneEvent(BlockRedstoneEvent e) { - if (rm != null) { - // Note this also accomplishes all the Citadel checking we need. - BlockFace powerFace = findPoweringFace(e.getBlock(), fccf - .getMultiBlockStructure().getAllBlocks()); - if (powerFace != null) { - int trueNewCurrent = e.getBlock().getBlockPower(powerFace); - if (trueNewCurrent != e.getNewCurrent()) { - e.setNewCurrent(trueNewCurrent); - } - } else { // null means citadel is enabled but no valid redstone - // power was found. - return; - } - } - - if (e.getNewCurrent() == e.getOldCurrent()) { - return; - } + public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { int threshold = FactoryMod.getManager().getRedstonePowerOn(); - boolean newState = false; - if (e.getBlock().getLocation().equals(fccf.getFurnace().getLocation())) { + if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { - // Falling Edge (turn off) - newState = false; + if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e.getBlock()))) { + fccf.deactivate(); + } } else if (e.getOldCurrent() < threshold && e.getNewCurrent() >= threshold && !fccf.isActive()) { - // Rising Edge (turn on) - newState = true; - } else { - return; - } - - if (newState) { + if (rm == null || MultiBlockStructure.citadelRedstoneChecks(e.getBlock())) { fccf.attemptToActivate(null); - } else { - fccf.deactivate(); - } - } else if (!fccf.isActive() - && e.getBlock() - .getLocation() - .equals(((FurnCraftChestStructure) fccf - .getMultiBlockStructure()).getCraftingTable())) { - // Can't change recipe while active. - int change = e.getOldCurrent() - e.getNewCurrent(); - if (Math.abs(change) >= FactoryMod.getManager() - .getRedstoneRecipeChange()) { - List currentRecipes = fccf.getRecipes(); - if (currentRecipes.size() == 0) { - return; - } - IRecipe current = fccf.getCurrentRecipe(); - int idx = 0; - // edge case? - if (current != null) { - idx = currentRecipes.indexOf(current); - if (change > 0) { // next - if (idx >= currentRecipes.size() - 1) { - idx = 0; - } else { - idx++; - } - } else if (change < 0) { // prev - if (idx == 0) { - idx = currentRecipes.size() - 1; - } else { - idx--; - } - } - } - fccf.setRecipe(currentRecipes.get(idx)); - } - } - } - - /** - * Only deals with directly powered redstone interactions, not indirect - * power Finds the block face giving the highest power that is also on a - * compatible Citadel group. - * - * @param here - * The block to check around. - * @param exclude - * The blocks to exclude from checks. - * @return The Face of the highest compatible power level. - */ - private BlockFace findPoweringFace(Block here, List exclude) { - if (here.isBlockPowered()) { - PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm - .getReinforcement(here) : null; - int prGID = (pr != null) ? pr.getGroup().getGroupId() : -1; - boolean checkCitadel = pr != null; - if (checkCitadel) { - checkCitadel = !pr.isInsecure(); // don't check citadel if - // insecure; any input is - // good then - } - BlockFace max = null; - int maxP = -1; - for (BlockFace face : adjacentFaces) { - Block rel = here.getRelative(face); - if (!exclude.contains(rel) && here.isBlockFacePowered(face)) { - int curP = here.getBlockPower(face); - if (curP > maxP) { - if (!checkCitadel - || prGID == ((PlayerReinforcement) rm - .getReinforcement(rel)).getGroup() - .getGroupId()) { - max = face; - maxP = curP; - // TODO: consider shortcut of iff max == 15 return; - } - } } + } else { + return; } - return max; - } else { - return null; } } - protected static BlockFace[] adjacentFaces = new BlockFace[] { - BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH, - BlockFace.DOWN, BlockFace.UP }; - public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); if (p != null) { @@ -274,10 +167,14 @@ public void clicked(Player arg0) { } if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getCraftingTable())) { // crafting table interaction - ClickableInventory ci = new ClickableInventory(36,"Select a recipe"); + ClickableInventory ci = new ClickableInventory(36, + "Select a recipe"); for (IRecipe rec : fccf.getRecipes()) { InputRecipe recipe = (InputRecipe) (rec); - Clickable c = new Clickable(recipe.getRecipeRepresentation()) { + ItemStack recStack = recipe.getRecipeRepresentation(); + ItemStackUtils.addLore(recStack, ChatColor.GOLD + "Ran " + + String.valueOf(fccf.getRunCount(recipe)) + " times"); + Clickable c = new Clickable(recStack) { @Override public void clicked(Player p) { @@ -298,7 +195,8 @@ public void clicked(Player p) { } ItemStack menuStack = new ItemStack(Material.PAINTING); ItemStackUtils.setName(menuStack, "Open menu"); - ItemStackUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + "Click to open a detailed menu"); + ItemStackUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + + "Click to open a detailed menu"); Clickable menuC = new Clickable(menuStack) { @Override public void clicked(Player arg0) { @@ -313,6 +211,7 @@ public void clicked(Player arg0) { if (b.equals(fccf.getFurnace())) { // furnace interaction if (fccf.isActive()) { fccf.deactivate(); + p.sendMessage(ChatColor.RED + "Deactivated " + fccf.getName()); } else { fccf.attemptToActivate(p); } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java index 746d86c3..1a0400a0 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -51,6 +51,6 @@ public interface IInteractionManager { * @param e * Event which occured */ - public void redStoneEvent(BlockRedstoneEvent e); + public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock); } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index 89ebeb49..653871e7 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -10,10 +10,14 @@ import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.factories.Pipe; import com.github.igotyou.FactoryMod.repairManager.NoRepairDestroyOnBreakManager; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; @@ -73,8 +77,30 @@ public void leftClick(Player p, Block b, BlockFace bf) { } } - public void redStoneEvent(BlockRedstoneEvent e) { - // soon + public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { + ReinforcementManager rm = FactoryMod.getManager().isCitadelEnabled() ? Citadel + .getReinforcementManager() : null; + int threshold = FactoryMod.getManager().getRedstonePowerOn(); + if (factoryBlock.getLocation().equals( + ((PipeStructure) pipe.getMultiBlockStructure()).getFurnace() + .getLocation())) { + if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold + && pipe.isActive()) { + if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock()))) { + pipe.deactivate(); + } + } else if (e.getOldCurrent() < threshold + && e.getNewCurrent() >= threshold && !pipe.isActive()) { + if (rm == null + || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock())) { + pipe.attemptToActivate(null); + } + } else { + return; + } + } } public void blockBreak(Player p, Block b) { @@ -83,5 +109,4 @@ public void blockBreak(Player p, Block b) { p.sendMessage(ChatColor.RED + "Pipe was destroyed"); } } - } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index 1810c0fe..a10ae829 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -7,9 +7,13 @@ import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; import com.github.igotyou.FactoryMod.utility.NiceNames; @@ -35,7 +39,7 @@ public void setSorter(Sorter sorter) { public void blockBreak(Player p, Block b) { sorter.getRepairManager().breakIt(); if (p != null) { - p.sendMessage(ChatColor.RED + "The sorter was destroyed"); + p.sendMessage(ChatColor.DARK_RED + "The sorter was destroyed"); } } @@ -81,8 +85,29 @@ public void leftClick(Player p, Block b, BlockFace bf) { } } - public void redStoneEvent(BlockRedstoneEvent e) { - + public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { + ReinforcementManager rm = FactoryMod.getManager().isCitadelEnabled() ? Citadel + .getReinforcementManager() : null; + int threshold = FactoryMod.getManager().getRedstonePowerOn(); + if (factoryBlock.getLocation().equals( + ((BlockFurnaceStructure) sorter.getMultiBlockStructure()) + .getFurnace().getLocation())) { + if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold + && sorter.isActive()) { + if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock()))) { + sorter.deactivate(); + } + } else if (e.getOldCurrent() < threshold + && e.getNewCurrent() >= threshold && !sorter.isActive()) { + if (rm == null + || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock())) { + sorter.attemptToActivate(null); + } + } else { + return; + } + } } - } diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index a7f00f9b..e6fa8650 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -7,10 +7,12 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBurnEvent; +import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.entity.EntityExplodeEvent; @@ -39,12 +41,10 @@ public FactoryModListener(FactoryModManager manager) { * Called when a block is broken If the block that is destroyed is part of a * factory, call the required methods. */ - @EventHandler + @EventHandler (ignoreCancelled = true, priority = EventPriority.MONITOR) public void blockBreakEvent(BlockBreakEvent e) { Block block = e.getBlock(); - if (manager.isPossibleInteractionBlock(block.getType()) - && ((manager.isCitadelEnabled() && !rm.isReinforced(block)) || !manager - .isCitadelEnabled())) { + if (manager.isPossibleInteractionBlock(block.getType())) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(e.getPlayer(), block); @@ -53,11 +53,21 @@ public void blockBreakEvent(BlockBreakEvent e) { } - @EventHandler() + @EventHandler public void redstoneChange(BlockRedstoneEvent e) { - Factory f = manager.getFactoryAt(e.getBlock()); - if (f != null) { - f.getInteractionManager().redStoneEvent(e); + if (e.getOldCurrent() == e.getNewCurrent()) { + System.out.println(e.getBlock().getLocation() + " unchanged at " + + e.getOldCurrent()); + return; + } + System.out.println("Switching " + e.getBlock().getLocation().toString() + + " from " + e.getOldCurrent() + " to " + e.getNewCurrent()); + for (BlockFace face : MultiBlockStructure.allBlockSides) { + Factory f = manager.getFactoryAt(e.getBlock().getRelative(face)); + if (f != null) { + f.getInteractionManager().redStoneEvent(e, + e.getBlock().getRelative(face)); + } } } @@ -147,6 +157,13 @@ public void playerInteract(PlayerInteractEvent e) { } } } + + @EventHandler + public void blockDispenser(BlockDispenseEvent e) { + if (manager.getFactoryAt(e.getBlock()) != null) { + e.setCancelled(true); + } + } /** * Turns slabs with the lore "Smooth double slab" into smooth double slab diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java new file mode 100644 index 00000000..0be6bd79 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -0,0 +1,173 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Chest; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; + +public class AOERepairRecipe extends InputRecipe { + private ItemStack essence; + private int repairPerEssence; + private int range; + + public AOERepairRecipe(String name, int productionTime, ItemStack essence, + int range, int repairPerEssence) { + super(name, productionTime, new ItemMap(essence)); + this.essence = essence; + this.range = range; + this.repairPerEssence = repairPerEssence; + } + + public ItemStack getRecipeRepresentation() { + return essence; + } + + public List getInputRepresentation(Inventory i) { + Chest c = (Chest) i.getHolder(); + Location loc = c.getLocation(); + List facs = getNearbyFactoriesSortedByDistance(loc); + int facCounter = 0; + int essenceCount = new ItemMap(i).getAmount(essence); + for (FurnCraftChestFactory fac : facs) { + PercentageHealthRepairManager rm = (PercentageHealthRepairManager) fac + .getRepairManager(); + int diff = 100 - rm.getRawHealth(); + if (diff >= repairPerEssence) { + essenceCount -= Math.min(essenceCount, diff / repairPerEssence); + facCounter++; + } + if (essenceCount <= 0) { + break; + } + } + ItemMap imp = new ItemMap(); + imp.addItemAmount(essence, new ItemMap(i).getAmount(essence) + - essenceCount); + List bla = imp.getItemStackRepresentation(); + for (ItemStack item : bla) { + item.setAmount(new ItemMap(i).getAmount(essence) - essenceCount); + ItemStackUtils.addLore(item, ChatColor.YELLOW + "Will repair " + + facCounter + " nearby factories total"); + } + return bla; + } + + private List getNearbyFactoriesSortedByDistance( + Location loc) { + LinkedList list = new LinkedList(); + Map distances = new HashMap(); + for (Factory f : FactoryMod.getManager().getNearbyFactories(loc, range)) { + if (f instanceof FurnCraftChestFactory) { + double dist = f.getMultiBlockStructure().getCenter() + .distance(loc); + distances.put((FurnCraftChestFactory) f, dist); + if (list.size() == 0) { + list.add((FurnCraftChestFactory) f); + } else { + for (int j = 0; j < list.size(); j++) { + if (distances.get(list.get(j)) > dist) { + list.add(j, (FurnCraftChestFactory) f); + break; + } + if (j == list.size() - 1) { + list.add(j, (FurnCraftChestFactory) f); + break; + } + } + } + } + } + return list; + } + + public List getOutputRepresentation(Inventory i) { + Chest c = (Chest) i.getHolder(); + Location loc = c.getLocation(); + List facs = getNearbyFactoriesSortedByDistance(loc); + ItemStack is = new ItemStack(Material.WORKBENCH); + int essenceCount = new ItemMap(i).getAmount(essence); + for (FurnCraftChestFactory fac : facs) { + PercentageHealthRepairManager rm = (PercentageHealthRepairManager) fac + .getRepairManager(); + int diff = 100 - rm.getRawHealth(); + if (diff >= repairPerEssence) { + ItemStackUtils + .addLore( + is, + ChatColor.LIGHT_PURPLE + + "Will repair " + + fac.getName() + + " to " + + Math.min( + 100, + rm.getRawHealth() + + (repairPerEssence * Math + .min(essenceCount, + diff + / repairPerEssence)))); + essenceCount -= Math.min(essenceCount, diff / repairPerEssence); + } + if (essenceCount <= 0) { + break; + } + } + List bla = new LinkedList(); + bla.add(is); + return bla; + } + + public void applyEffect(Inventory i, Factory f) { + Chest c = (Chest) i.getHolder(); + Location loc = c.getLocation(); + List facs = getNearbyFactoriesSortedByDistance(loc); + ItemStack is = new ItemStack(Material.WORKBENCH); + int essenceCount = new ItemMap(i).getAmount(essence); + for (FurnCraftChestFactory fac : facs) { + PercentageHealthRepairManager rm = (PercentageHealthRepairManager) fac + .getRepairManager(); + int diff = 100 - rm.getRawHealth(); + fac.getMultiBlockStructure().recheckComplete(); + if (diff >= repairPerEssence + && fac.getMultiBlockStructure().isComplete() + && !fac.isActive() + && fac.getPowerManager().powerAvailable()) { + int rem = Math.min(essenceCount, diff / repairPerEssence); + ItemStack remStack = essence.clone(); + remStack.setAmount(rem); + Inventory targetInv = ((InventoryHolder) (fac.getChest() + .getState())).getInventory(); + if (new ItemMap(remStack).fitsIn(targetInv)) { + i.removeItem(remStack); + targetInv.addItem(remStack); + for (IRecipe rec : fac.getRecipes()) { + if (rec instanceof RepairRecipe) { + fac.setRecipe(rec); + break; + } + } + fac.attemptToActivate(null); + break; + } + } + if (essenceCount <= 0) { + break; + } + } + } + +} diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java new file mode 100644 index 00000000..616fb6c5 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -0,0 +1,110 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.utility.ItemMap; +import com.github.igotyou.FactoryMod.utility.ItemStackUtils; + +public class PylonRecipe extends InputRecipe { + + private ItemMap output; + private static int currentGlobalWeight; + private int weight; + private double maximumFraction; + + public PylonRecipe(String name, int productionTime, ItemMap input, + ItemMap output, int weight) { + super(name, productionTime, input); + this.output = output; + this.weight = weight; + } + + public void applyEffect(Inventory i, Factory f) { + if (!input.isContainedIn(i)) { + return; + } + ItemMap actualOutput = getCurrentOutput(); + if (!actualOutput.fitsIn(i)) { + return; + } + for (ItemStack is : input.getItemStackRepresentation()) { + i.removeItem(is); + } + for (ItemStack is : actualOutput.getItemStackRepresentation()) { + i.addItem(is); + } + } + + public List getOutputRepresentation(Inventory i) { + ItemMap currOut = getCurrentOutput(); + List res = new LinkedList(); + for (ItemStack is : currOut.getItemStackRepresentation()) { + ItemStackUtils.setLore(is, ChatColor.GOLD + "Currently there are " + + FurnCraftChestFactory.getPylonFactories().size() + + " pylons on the map", ChatColor.RED + + "Current global weight is " + currentGlobalWeight); + res.add(is); + } + return res; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public ItemStack getRecipeRepresentation() { + List out = output.getItemStackRepresentation(); + ItemStack res; + if (out.size() == 0) { + res = new ItemStack(Material.STONE); + } else { + res = out.get(0); + } + ItemStackUtils.setName(res, getRecipeName()); + return res; + } + + public boolean enoughMaterialAvailable(Inventory i) { + return input.isContainedIn(i) && skyView(); + } + + public int getWeight() { + return weight; + } + + private boolean skyView() { + return true; + // place holder in case we want to do something with it in the future + } + + private ItemMap getCurrentOutput() { + double multiplier = Math.min(1 / currentGlobalWeight, maximumFraction); + ItemMap actualOutput = new ItemMap(); + for (Entry entry : output.getEntrySet()) { + actualOutput.addItemAmount(entry.getKey(), + (int) (entry.getValue() * multiplier)); + } + return actualOutput; + } + + public static void addWeight(int weight) { + currentGlobalWeight += weight; + } + + public static void removeWeight(int weight) { + currentGlobalWeight -= weight; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java index 33384174..6c6addb6 100644 --- a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -14,7 +14,7 @@ public class BlockFurnaceStructure extends MultiBlockStructure { private boolean complete = false; public BlockFurnaceStructure(Block center) { - if (center.getType() == Material.DISPENSER) { + if (center.getType() == Material.DROPPER) { this.center = center; for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { furnace = b; @@ -49,7 +49,7 @@ public boolean isComplete() { } public void recheckComplete() { - complete = (center.getType() == Material.DISPENSER && (furnace + complete = (center.getType() == Material.DROPPER && (furnace .getType() == Material.FURNACE || furnace.getType() == Material.BURNING_FURNACE)); } diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 8e3d701f..10f908c2 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -10,6 +10,12 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import com.github.igotyou.FactoryMod.FactoryMod; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; + /** * Physical representation of a factory. This may be any shape as long as the * required methods can be applied on the shape. @@ -96,5 +102,42 @@ public static List getAdjacentBlocks(Block b) { } return blocks; } + + /** + * Only deals with directly powered redstone interactions, not indirect + * power. If all blocks powering this block are on the same group or if the + * block is insecure or if the block is unreinforced, true will be returned + * + * @param here + * The block to check around. + * @return Whether all power sources around the given block are on the same + * group + */ + public static boolean citadelRedstoneChecks(Block here) { + ReinforcementManager rm; + if (FactoryMod.getManager().isCitadelEnabled()) { + rm = Citadel.getReinforcementManager(); + } + else { + return true; + } + PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm + .getReinforcement(here) : null; + if (pr == null || pr.isInsecure()) { + return true; + } + int prGID = pr.getGroup().getGroupId(); + for (BlockFace face : MultiBlockStructure.allBlockSides) { + Block rel = here.getRelative(face); + if (here.isBlockFacePowered(face)) { + PlayerReinforcement relRein = (PlayerReinforcement) rm + .getReinforcement(rel); + if (relRein == null || relRein.getGroup().getGroupId() != prGID) { + return false; + } + } + } + return true; + } } diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index cdd19c15..267e845f 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -9,7 +9,7 @@ import org.bukkit.inventory.InventoryHolder; /** - * Represents a pipe with a dropper at each end, which are directly connected + * Represents a pipe with a dispenser at each end, which are directly connected * through blocks of one specific type which make up the actual pipe * */ @@ -25,7 +25,7 @@ public class PipeStructure extends MultiBlockStructure { private boolean complete; public PipeStructure(Block startBlock) { - if (startBlock.getType() != Material.DROPPER) { + if (startBlock.getType() != Material.DISPENSER) { return; } this.start = startBlock; @@ -108,7 +108,7 @@ public void recheckComplete() { if (start == null || furnace == null || end == null - || start.getType() != Material.DROPPER + || start.getType() != Material.DISPENSER || (furnace.getType() != Material.FURNACE && furnace.getType() != Material.BURNING_FURNACE) || !(end.getState() instanceof InventoryHolder)) { complete = false; @@ -126,7 +126,7 @@ public void recheckComplete() { public boolean isComplete() { return complete; } - + public byte getGlassColor() { return glassColor; } diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 5bae7c37..58bf042c 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -4,6 +4,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.UUID; import org.bukkit.ChatColor; @@ -82,9 +83,20 @@ public void openFactoryBrowser(Player p, String startingFac) { ClickableInventory.forceCloseInventory(p); IFactoryEgg egg = manager.getEgg(startingFac); if (egg == null) { - p.sendMessage(ChatColor.RED - + "There is no factory with the name you entered"); - return; + String comp = startingFac.toLowerCase(); + // check for lower/uppercase miss spellings + for (Entry entry : manager.getAllEggs() + .entrySet()) { + if (entry.getKey().toLowerCase().equals(comp)) { + egg = entry.getValue(); + break; + } + } + if (egg == null) { + p.sendMessage(ChatColor.RED + + "There is no factory with the name you entered"); + return; + } } if (egg instanceof FurnCraftChestEgg) { FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; @@ -205,11 +217,23 @@ private void openSetupBrowser(Player p, String facName) { ci.setSlot(chestDec, 5); ItemMap im = manager.getSetupCost(FurnCraftChestStructure.class, egg.getName()); - int slot = 27; + int slot = 31; for (ItemStack is : im.getItemStackRepresentation()) { DecorationStack dec = new DecorationStack(is); ci.setSlot(dec, slot); - slot++; + if ((slot % 9) == 4) { + slot++; + continue; + } + if ((slot % 9) > 4) { + slot -= (((slot % 9) - 4) * 2); + } else { + if ((slot % 9) == 0) { + slot += 9; + } else { + slot += (((4 - (slot % 9)) * 2) + 1); + } + } } } else { Upgraderecipe rec = null; @@ -220,7 +244,7 @@ private void openSetupBrowser(Player p, String facName) { } } - ItemStackUtils.setLore(cr, "Upgrade from a " + parEgg.getName()); + ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "Upgrade from a " + parEgg.getName()); Clickable craCli = new Clickable(cr) { @Override public void clicked(Player arg0) { @@ -230,7 +254,7 @@ public void clicked(Player arg0) { }; ci.setSlot(craCli, 4); ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE - + "Click to display information", "on this factory"); + + "Click to display information", ChatColor.LIGHT_PURPLE + "on this factory"); Clickable furCli = new Clickable(fur) { @Override public void clicked(Player arg0) { @@ -247,11 +271,23 @@ public void clicked(Player arg0) { } }; ci.setSlot(cheCli, 5); - int slot = 36; + int slot = 40; for (ItemStack is : rec.getInput().getItemStackRepresentation()) { DecorationStack dec = new DecorationStack(is); ci.setSlot(dec, slot); - slot++; + if ((slot % 9) == 4) { + slot++; + continue; + } + if ((slot % 9) > 4) { + slot -= (((slot % 9) - 4) * 2); + } else { + if ((slot % 9) == 0) { + slot += 9; + } else { + slot += (((4 - (slot % 9)) * 2) + 1); + } + } } } ci.setSlot(input, 22); @@ -380,7 +416,31 @@ public void clicked(Player arg0) { ci.setSlot(outputClickable, 31); index = 40; for (ItemStack is : rec.getOutputRepresentation(null)) { - Clickable c = new DecorationStack(is); + Clickable c; + if (rec instanceof Upgraderecipe) { + c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + IFactoryEgg egg = manager.getEgg(factoryViewed.get(arg0 + .getUniqueId())); + for (IRecipe re : ((FurnCraftChestEgg) egg) + .getRecipes()) { + if (re instanceof Upgraderecipe + && ((Upgraderecipe) re) + .getEgg() + .getName() + .equals(ItemStackUtils.getName(this + .getItemStack()))) { + openFactoryBrowser(arg0, ((Upgraderecipe) re) + .getEgg().getName()); + break; + } + } + } + }; + } else { + c = new DecorationStack(is); + } ci.setSlot(c, index); if ((index % 9) == 4) { index++; From 2d584be08049aac939c756a3cae6be2858a12ce9 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 20 Jan 2016 02:29:06 +0100 Subject: [PATCH 203/459] Remove stuff thats now in CivModCore --- .../igotyou/FactoryMod/ConfigParser.java | 3 +- .../github/igotyou/FactoryMod/FactoryMod.java | 2 +- .../igotyou/FactoryMod/FactoryModManager.java | 3 +- .../igotyou/FactoryMod/eggs/SorterEgg.java | 3 +- .../factories/FurnCraftChestFactory.java | 3 + .../igotyou/FactoryMod/factories/Pipe.java | 3 +- .../igotyou/FactoryMod/factories/Sorter.java | 3 +- .../FurnCraftChestInteractionManager.java | 8 +- .../SorterInteractionManager.java | 2 +- .../powerManager/FurnacePowerManager.java | 2 +- .../FactoryMod/recipes/AOERepairRecipe.java | 34 +- .../FactoryMod/recipes/CompactingRecipe.java | 7 +- .../recipes/DecompactingRecipe.java | 8 +- .../DeterministicEnchantingRecipe.java | 11 +- .../FactoryMod/recipes/InputRecipe.java | 6 +- .../FactoryMod/recipes/ProductionRecipe.java | 9 +- .../FactoryMod/recipes/PylonRecipe.java | 9 +- .../recipes/RandomEnchantingRecipe.java | 17 +- .../FactoryMod/recipes/RepairRecipe.java | 9 +- .../FactoryMod/recipes/Upgraderecipe.java | 25 +- .../FactoryMod/utility/FileHandler.java | 2 + .../igotyou/FactoryMod/utility/ItemMap.java | 508 ------------------ .../FactoryMod/utility/ItemStackUtils.java | 44 -- .../FactoryMod/utility/MenuBuilder.java | 69 +-- .../igotyou/FactoryMod/utility/NiceNames.java | 87 --- 25 files changed, 129 insertions(+), 748 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/utility/ItemMap.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java delete mode 100644 src/com/github/igotyou/FactoryMod/utility/NiceNames.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 04eb0cf9..298d4aea 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -17,6 +17,8 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; @@ -32,7 +34,6 @@ import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; -import com.github.igotyou.FactoryMod.utility.ItemMap; import com.google.common.collect.Lists; public class ConfigParser { diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index 7cb66bd8..a5f09800 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -6,9 +6,9 @@ import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; -import com.github.igotyou.FactoryMod.utility.NiceNames; import vg.civcraft.mc.civmodcore.ACivMod; +import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; public class FactoryMod extends ACivMod { private static FactoryModManager manager; diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 3ed660a3..93e93030 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -15,6 +15,8 @@ import org.bukkit.block.Dropper; import org.bukkit.entity.Player; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.factories.Factory; @@ -23,7 +25,6 @@ import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.FileHandler; -import com.github.igotyou.FactoryMod.utility.ItemMap; /** * Manager class which handles all factories, their locations and their creation diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index 8fa70e59..9de49241 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -8,6 +8,8 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; @@ -18,7 +20,6 @@ import com.github.igotyou.FactoryMod.repairManager.NoRepairDestroyOnBreakManager; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.utility.ItemMap; public class SorterEgg implements IFactoryEgg { private String name; diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 7857b4af..ca4f83ce 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -93,6 +93,9 @@ public FurnaceInventory getFurnaceInventory() { public void attemptToActivate(Player p) { // TODO Citadel stuff mbs.recheckComplete(); + if (active) { + return; + } if (mbs.isComplete()) { if (hasInputMaterials()) { if (pm.powerAvailable()) { diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index f7a2ea39..fe67c91f 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -11,12 +11,13 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; -import com.github.igotyou.FactoryMod.utility.ItemMap; public class Pipe extends Factory { private List allowedMaterials; diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 6acc2ac6..2303fef1 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -13,12 +13,13 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.utility.ItemMap; public class Sorter extends Factory { private Map assignedMaterials; diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 081f193a..6b37e75c 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -13,6 +13,7 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; @@ -23,7 +24,6 @@ import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; import com.github.igotyou.FactoryMod.utility.MenuBuilder; public class FurnCraftChestInteractionManager implements IInteractionManager { @@ -172,7 +172,7 @@ public void clicked(Player arg0) { for (IRecipe rec : fccf.getRecipes()) { InputRecipe recipe = (InputRecipe) (rec); ItemStack recStack = recipe.getRecipeRepresentation(); - ItemStackUtils.addLore(recStack, ChatColor.GOLD + "Ran " + ISUtils.addLore(recStack, ChatColor.GOLD + "Ran " + String.valueOf(fccf.getRunCount(recipe)) + " times"); Clickable c = new Clickable(recStack) { @@ -194,8 +194,8 @@ public void clicked(Player p) { ci.addSlot(c); } ItemStack menuStack = new ItemStack(Material.PAINTING); - ItemStackUtils.setName(menuStack, "Open menu"); - ItemStackUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(menuStack, "Open menu"); + ISUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + "Click to open a detailed menu"); Clickable menuC = new Clickable(menuStack) { @Override diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index a10ae829..fcc0d962 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -9,13 +9,13 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; -import com.github.igotyou.FactoryMod.utility.NiceNames; public class SorterInteractionManager implements IInteractionManager { private Sorter sorter; diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index 0ede6942..3641f922 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -6,7 +6,7 @@ import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.utility.ItemMap; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; /** * Power manager for a FurnCraftChest factory, which uses a specific item in the diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index 0be6bd79..ec9890e6 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -13,12 +13,13 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; public class AOERepairRecipe extends InputRecipe { private ItemStack essence; @@ -61,7 +62,7 @@ public List getInputRepresentation(Inventory i) { List bla = imp.getItemStackRepresentation(); for (ItemStack item : bla) { item.setAmount(new ItemMap(i).getAmount(essence) - essenceCount); - ItemStackUtils.addLore(item, ChatColor.YELLOW + "Will repair " + ISUtils.addLore(item, ChatColor.YELLOW + "Will repair " + facCounter + " nearby factories total"); } return bla; @@ -106,20 +107,19 @@ public List getOutputRepresentation(Inventory i) { .getRepairManager(); int diff = 100 - rm.getRawHealth(); if (diff >= repairPerEssence) { - ItemStackUtils - .addLore( - is, - ChatColor.LIGHT_PURPLE - + "Will repair " - + fac.getName() - + " to " - + Math.min( - 100, - rm.getRawHealth() - + (repairPerEssence * Math - .min(essenceCount, - diff - / repairPerEssence)))); + ISUtils.addLore( + is, + ChatColor.LIGHT_PURPLE + + "Will repair " + + fac.getName() + + " to " + + Math.min( + 100, + rm.getRawHealth() + + (repairPerEssence * Math + .min(essenceCount, + diff + / repairPerEssence)))); essenceCount -= Math.min(essenceCount, diff / repairPerEssence); } if (essenceCount <= 0) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index c101d3ea..664ece94 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -8,9 +8,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Used to "compact" itemstack, which means complete stacks are reduced to a @@ -127,7 +128,7 @@ public ItemStack getRecipeRepresentation() { * @param is */ private void compact(ItemStack is) { - ItemStackUtils.addLore(is, compactedLore); + ISUtils.addLore(is, compactedLore); is.setAmount(1); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 64aac98c..4cd6c805 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -8,10 +8,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import com.github.igotyou.FactoryMod.factories.Factory; /** * Used to decompact itemstacks, which means a single item with compacted lore * is turned into a whole stack without lore. This reverses the functionality of @@ -78,7 +78,7 @@ public List getInputRepresentation(Inventory i) { List result = new LinkedList(); if (i == null) { ItemStack is = new ItemStack(Material.STONE, 64); - ItemStackUtils.addLore(is, compactedLore); + ISUtils.addLore(is, compactedLore); is.setAmount(1); result.add(is); return result; diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index e1635d5a..ef5cec06 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -9,9 +9,10 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; @@ -41,7 +42,7 @@ public boolean enoughMaterialAvailable(Inventory i) { public ItemStack getRecipeRepresentation() { ItemStack is = new ItemStack(tool); is.addEnchantment(enchant, level); - ItemStackUtils.setName(is, name); + ISUtils.setName(is, name); return is; } @@ -49,7 +50,7 @@ public List getOutputRepresentation(Inventory i) { ItemStack is = new ItemStack(tool); is.addEnchantment(enchant, level); if (i != null) { - ItemStackUtils.addLore( + ISUtils.addLore( is, ChatColor.GREEN + "Enough materials for " @@ -71,7 +72,7 @@ public List getInputRepresentation(Inventory i) { } List returns = createLoredStacksForInfo(i); ItemStack toSt = new ItemStack(tool); - ItemStackUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); returns.add(toSt); return returns; diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 33f95057..0e70887d 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -8,8 +8,8 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; /** * A recipe with any form of item input to run it @@ -108,7 +108,7 @@ protected List createLoredStacksForInfo(Inventory i) { } for (ItemStack is : input.getItemStackRepresentation()) { - ItemStackUtils.addLore( + ISUtils.addLore( is, ChatColor.GREEN + "Enough materials for " + String.valueOf(possibleRuns.getAmount(is)) diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 7d7e7c0b..3d36daa9 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -7,9 +7,10 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Consumes a set of materials from a container and outputs another set of @@ -46,7 +47,7 @@ public List getOutputRepresentation(Inventory i) { } int possibleRuns = input.getMultiplesContainedIn(i); for (ItemStack is : stacks) { - ItemStackUtils.addLore(is, ChatColor.GREEN + ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + String.valueOf(possibleRuns) + " runs"); } @@ -81,7 +82,7 @@ public ItemStack getRecipeRepresentation() { } else { res = out.get(0); } - ItemStackUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getRecipeName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 616fb6c5..89a64649 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -9,10 +9,11 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; public class PylonRecipe extends InputRecipe { @@ -48,7 +49,7 @@ public List getOutputRepresentation(Inventory i) { ItemMap currOut = getCurrentOutput(); List res = new LinkedList(); for (ItemStack is : currOut.getItemStackRepresentation()) { - ItemStackUtils.setLore(is, ChatColor.GOLD + "Currently there are " + ISUtils.setLore(is, ChatColor.GOLD + "Currently there are " + FurnCraftChestFactory.getPylonFactories().size() + " pylons on the map", ChatColor.RED + "Current global weight is " + currentGlobalWeight); @@ -72,7 +73,7 @@ public ItemStack getRecipeRepresentation() { } else { res = out.get(0); } - ItemStackUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getRecipeName()); return res; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index c655258e..f956d915 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -10,10 +10,11 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; + import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; -import com.github.igotyou.FactoryMod.utility.NiceNames; public class RandomEnchantingRecipe extends InputRecipe { private List enchants; @@ -47,7 +48,7 @@ public ItemStack getRecipeRepresentation() { for (RandomEnchant re : enchants) { is.addEnchantment(re.enchant, re.level); } - ItemStackUtils.setName(is, name); + ISUtils.setName(is, name); return is; } @@ -59,7 +60,7 @@ public List getInputRepresentation(Inventory i) { } List returns = createLoredStacksForInfo(i); ItemStack toSt = new ItemStack(tool); - ItemStackUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); returns.add(toSt); return returns; @@ -71,7 +72,7 @@ public List getOutputRepresentation(Inventory i) { is.addEnchantment(re.enchant, re.level); } if (i != null) { - ItemStackUtils.addLore( + ISUtils.addLore( is, ChatColor.GREEN + "Enough materials for " @@ -81,12 +82,12 @@ public List getOutputRepresentation(Inventory i) { .getMultiplesContainedIn(i))) + " runs"); } for (RandomEnchant re : enchants) { - ItemStackUtils.addLore(is, + ISUtils.addLore(is, ChatColor.YELLOW + String.valueOf(re.chance * 100) + " % chance for " + NiceNames.getName(re.enchant) + " " + String.valueOf(re.level)); } - ItemStackUtils.addLore(is, ChatColor.LIGHT_PURPLE + ISUtils.addLore(is, ChatColor.LIGHT_PURPLE + "At least one guaranteed"); List stacks = new LinkedList(); stacks.add(is); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 831ad773..41b531f4 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -7,10 +7,11 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; /** * Used to repair FurnCraftChest factories. Once one of those factories is in @@ -29,7 +30,7 @@ public RepairRecipe(String name, int productionTime, ItemMap input, public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); - ItemStackUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + ISUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); result.add(furn); return result; @@ -54,7 +55,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.FURNACE); - ItemStackUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getRecipeName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 44d16793..0a217712 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -9,12 +9,13 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; -import com.github.igotyou.FactoryMod.utility.ItemMap; -import com.github.igotyou.FactoryMod.utility.ItemStackUtils; public class Upgraderecipe extends InputRecipe { private IFactoryEgg egg; @@ -39,7 +40,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.WORKBENCH); - ItemStackUtils.setName(res, name); + ISUtils.setName(res, name); return res; } @@ -62,10 +63,10 @@ public List getInputRepresentation(Inventory i) { } for (ItemStack is : input.getItemStackRepresentation()) { if (possibleRuns.getAmount(is) != 0) { - ItemStackUtils.addLore(is, ChatColor.GREEN + ISUtils.addLore(is, ChatColor.GREEN + "Enough of this material available to upgrade"); } else { - ItemStackUtils.addLore(is, ChatColor.RED + ISUtils.addLore(is, ChatColor.RED + "Not enough of this materials available to upgrade"); } result.add(is); @@ -76,19 +77,19 @@ public List getInputRepresentation(Inventory i) { public List getOutputRepresentation(Inventory i) { List res = new LinkedList(); ItemStack cr = new ItemStack(Material.WORKBENCH); - ItemStackUtils.setName(cr, egg.getName()); - ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE+ "Upgrade to get new and better recipes"); + ISUtils.setName(cr, egg.getName()); + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE+ "Upgrade to get new and better recipes"); res.add(cr); ItemStack fur = new ItemStack(Material.FURNACE); - ItemStackUtils.setName(fur, egg.getName()); - ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Recipes:"); + ISUtils.setName(fur, egg.getName()); + ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Recipes:"); for(IRecipe rec : ((FurnCraftChestEgg)egg).getRecipes()) { - ItemStackUtils.addLore(fur, ChatColor.YELLOW + rec.getRecipeName()); + ISUtils.addLore(fur, ChatColor.YELLOW + rec.getRecipeName()); } res.add(fur); ItemStack che = new ItemStack(Material.CHEST); - ItemStackUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Careful, you can not",ChatColor.LIGHT_PURPLE+ "revert upgrades!"); - ItemStackUtils.setName(che, egg.getName()); + ISUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Careful, you can not",ChatColor.LIGHT_PURPLE+ "revert upgrades!"); + ISUtils.setName(che, egg.getName()); res.add(che); return res; } diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index e1a7f024..cc735dbb 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -18,6 +18,8 @@ import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java b/src/com/github/igotyou/FactoryMod/utility/ItemMap.java deleted file mode 100644 index b885a7cf..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/ItemMap.java +++ /dev/null @@ -1,508 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; - -/** - * Allows the storage and comparison of itemstacks while ignoring their maximum - * possible stack sizes. This offers various tools to compare inventories, to - * store recipe costs or to specify setupcosts. Take great care when dealing - * with itemstacks with negative amounnts, while this implementation should be - * consistent even with negative values, they create possibly unexpected - * results. For example an empty inventory/itemmap will seem to contain items - * when compared to a map containing negative values - * - */ -public class ItemMap { - private HashMap items; - private int totalItems; - - /** - * Empty constructor to create empty item map - */ - public ItemMap() { - items = new HashMap(); - totalItems = 0; - } - - /** - * Constructor to create an item map based on the content of an inventory. - * The ItemMap will not be in sync with the inventory, it will only update - * if it's explicitly told to do so - * - * @param inv - * Inventory to base the item map on - */ - public ItemMap(Inventory inv) { - update(inv); - } - - /** - * Constructor to create an ItemMap based on a single ItemStack - * - * @param is - * ItemStack to start with - */ - public ItemMap(ItemStack is) { - items = new HashMap(); - addItemStack(is); - } - - /** - * Constructor to create an item map based on a collection of ItemStacks - * - * @param stacks - * Stacks to add to the map - */ - public ItemMap(Collection stacks) { - items = new HashMap(); - addAll(stacks); - } - - /** - * Clones the given itemstack, sets its amount to one and checks whether a - * stack equaling the created one exists in the item map. If yes the amount - * of the given stack (before the amount was set to 1) will be added to the - * current amount in the item map, if not a new entry in the map with the - * correct amount will be created - * - * @param input - * ItemStack to insert - */ - public void addItemStack(ItemStack input) { - if (input != null) { - ItemStack is = createMapConformCopy(input); - Integer i; - if ((i = items.get(is)) != null) { - items.put(is, i + input.getAmount()); - } else { - items.put(is, input.getAmount()); - } - totalItems += input.getAmount(); - } - } - - /** - * Removes the given ItemStack from this map. Only the amount of the given - * ItemStack will be removed, not all of them. If the amount of the given - * itemstack is bigger than the existing ones in this map, not more than the - * amount in this map will be removed - * - * @param input - * ItemStack to remove - */ - public void removeItemStack(ItemStack input) { - ItemStack is = createMapConformCopy(input); - Integer value = items.get(is); - if (value != null) { - int newVal = value - input.getAmount(); - if (newVal > 0) { - items.put(is, newVal); - } else { - items.remove(is); - } - } - } - - /** - * Completly removes the given itemstack of this item map, completly - * independent of its amount - * - * @param input - * ItemStack to remove - */ - public void removeItemStackCompletly(ItemStack input) { - items.remove(createMapConformCopy(input)); - } - - public int hashCode() { - int res = 0; - for (Entry entry : items.entrySet()) { - res += entry.hashCode(); - } - return res; - } - - /** - * Adds all the stacks given in the collection to this map - * - * @param stacks - * Stacks to add - */ - public void addAll(Collection stacks) { - for (ItemStack is : stacks) { - if (is != null) { - addItemStack(is); - } - } - } - - /** - * Merges the given item map into this instance - * - * @param im - * ItemMap to merge - */ - public void merge(ItemMap im) { - for (Entry entry : im.getEntrySet()) { - addItemAmount(entry.getKey(), entry.getValue()); - } - } - - public void update(Inventory inv) { - items = new HashMap(); - totalItems = 0; - for (int i = 0; i < inv.getSize(); i++) { - ItemStack is = inv.getItem(i); - if (is != null) { - addItemStack(is); - } - } - } - - public void addEntrySet(Set> entries) { - for (Entry entry : entries) { - addItemAmount(entry.getKey(), entry.getValue()); - } - } - - /** - * Utility method, which has the amount of items to add as parameter. - * - * @param input - * ItemStack to sort into the map - * @param amount - * Amount associated with the given ItemStack - */ - public void addItemAmount(ItemStack input, int amount) { - ItemStack copy = createMapConformCopy(input); - copy.setAmount(amount); - addItemStack(copy); - } - - /** - * Gets a submap of this instance which contains all stacks with the same - * material as the given one and their respective amounts - * - * @param m - * Material to search for - * @return New ItemMap with all ItemStack and their amount whose material - * matches the given one - */ - public ItemMap getStacksByMaterial(Material m) { - ItemMap result = new ItemMap(); - for (ItemStack is : items.keySet()) { - if (is.getType() == m) { - result.addItemAmount(is.clone(), items.get(is)); - } - } - return result; - } - - public ItemMap getStacksByMaterial(ItemStack is) { - return getStacksByMaterial(is.getType()); - } - - /** - * Gets a submap of this instance which contains all stacks with the same - * material and durability as the given one and their respective amounts - * - * @param m - * Material to search for - * @param durability - * Durability to search for - * @return New ItemMap with all ItemStack and their amount whose material - * and durability matches the given one - */ - public ItemMap getStacksByMaterialDurability(Material m, int durability) { - ItemMap result = new ItemMap(); - for (ItemStack is : items.keySet()) { - if (is.getType() == m && is.getDurability() == durability) { - result.addItemAmount(is.clone(), items.get(is)); - } - } - return result; - } - - public ItemMap getStacksByMaterialDurability(ItemStack is) { - return getStacksByMaterialDurability(is.getType(), is.getDurability()); - } - - /** - * Gets a submap of this instance which contains all stacks with the same - * material, durability and enchants as the given one and their respective - * amounts - * - * @param m - * Material to search for - * @param durability - * Durability to search for - * @param enchants - * Enchants to search for - * @return New ItemMap with all ItemStack and their amount whose material, - * durability and enchants matches the given one - */ - public ItemMap getStacksByMaterialDurabilityEnchants(Material m, - int durability, Map enchants) { - ItemMap result = new ItemMap(); - for (ItemStack is : items.keySet()) { - if (is.getType() == m && is.getDurability() == durability - && is.getItemMeta() != null - && is.getItemMeta().getEnchants().equals(enchants)) { - result.addItemAmount(is.clone(), items.get(is)); - } - } - return result; - } - - public ItemMap getStacksByMaterialDurabilityEnchants(ItemStack is) { - if (is.getItemMeta() != null) { - return getStacksByMaterialDurabilityEnchants(is.getType(), - (int) is.getDurability(), is.getItemMeta().getEnchants()); - } else { - return getStacksByMaterialDurabilityEnchants(is.getType(), - (int) is.getDurability(), - new HashMap()); - } - } - - /** - * Gets a submap of this instance which contains all stacks with the same - * lore as the given and their respective amount - * - * @param lore - * Lore to search for - * @return New ItemMap with all ItemStacks and their amount whose lore - * matches the given one - */ - public ItemMap getStacksByLore(List lore) { - ItemMap result = new ItemMap(); - for (ItemStack is : items.keySet()) { - if (is.getItemMeta() != null - && is.getItemMeta().getLore().equals(lore)) { - result.addItemAmount(is.clone(), items.get(is)); - } - } - return result; - } - - /** - * Gets how many items of the given stack are in this map. Be aware that if - * a stack doesnt equal with the given one, for example because of - * mismatched NBT tags, it wont be included in the result - * - * @param is - * Exact ItemStack to search for - * @return amount of items like the given stack in this map - */ - public int getAmount(ItemStack is) { - ItemMap matSubMap = getStacksByMaterial(is); - int amount = 0; - for (Entry entry : matSubMap.getEntrySet()) { - ItemStack current = entry.getKey(); - if ((is.getDurability() == -1 || is.getDurability() == current - .getDurability()) - && is.getEnchantments().equals(current.getEnchantments()) - && (current.getItemMeta().getLore() == null || current - .getItemMeta().getLore() - .equals(is.getItemMeta().getLore()))) { - amount += entry.getValue(); - } - } - return amount; - } - - /** - * @return How many items are stored in this map total - */ - public int getTotalItemAmount() { - return totalItems; - } - - /** - * @return How many unique items are stored in this map - */ - public int getTotalUniqueItemAmount() { - return items.keySet().size(); - } - - public Set> getEntrySet() { - return ((HashMap) items.clone()).entrySet(); - } - - // autoformatting messed this up a bit, this method isnt needed anymore, but - // shouldnt be removed yet - /* - * public ItemMap getDifference(Inventory inv) { ItemMap res = new - * ItemMap(); ItemMap invMap = new ItemMap(inv); for (Entry entry : getEntrySet()) { int amount = entry.getValue(); int - * invAmount = invMap.getAmount(entry.getKey()); if (amount != invAmount) { - * res.addItemAmount(entry.getKey(), invAmount - amount); } - * invMap.removeItemStackCompletly(entry.getKey()); } res.merge(invMap); - * return res; } - */ - - /** - * Checks whether an inventory contains exactly what's described in this - * ItemMap - * - * @param i - * Inventory to compare - * @return True if the inventory is identical with this instance, false if - * not - */ - public boolean containedExactlyIn(Inventory i) { - ItemMap invMap = new ItemMap(i); - for (Entry entry : getEntrySet()) { - if (!entry.getValue().equals(invMap.getAmount(entry.getKey()))) { - return false; - } - } - return true; - } - - /** - * Checks whether this instance is completly contained in the given - * inventory, which means every stack in this instance is also in the given - * inventory and the amount in the given inventory is either the same or - * bigger as in this instance - * - * @param im - * inventory to check - * @return true if this instance is completly contained in the given - * inventory, false if not - */ - public boolean isContainedIn(Inventory i) { - ItemMap invMap = new ItemMap(i); - for (Entry entry : getEntrySet()) { - if (entry.getValue() > invMap.getAmount(entry.getKey())) { - return false; - } - } - return true; - } - - public String toString() { - String res = ""; - for (ItemStack is : getItemStackRepresentation()) { - res += is.toString() + ";"; - } - return res; - } - - /** - * Checks how often this ItemMap is contained in the given ItemMap or how - * often this ItemMap could be removed from the given one before creating - * negative stacks - * - * @param im - * ItemMap to check - * @return How often this map is contained in the given one or - * Integer.MAX_VALUE if this instance is empty - */ - public int getMultiplesContainedIn(Inventory i) { - ItemMap invMap = new ItemMap(i); - int res = Integer.MAX_VALUE; - for (Entry entry : getEntrySet()) { - int pulledAmount = invMap.getAmount(entry.getKey()); - int multiples = pulledAmount/entry.getValue(); - res = Math.min(res, multiples); - } - return res; - } - - /** - * Multiplies the whole content of this instance by the given multiplier - * - * @param multiplier - * Multiplier to scale the amount of the contained items with - */ - public void multiplyContent(double multiplier) { - totalItems = 0; - for (Entry entry : getEntrySet()) { - items.put(entry.getKey(), (int) (entry.getValue() * multiplier)); - totalItems += (int) (entry.getValue() * multiplier); - } - } - - /** - * Turns this item map into a list of ItemStacks, with amounts that do not - * surpass the maximum allowed stack size for each ItemStack - * - * @return List of stacksize conform ItemStacks - */ - public LinkedList getItemStackRepresentation() { - LinkedList result = new LinkedList(); - for (Entry entry : getEntrySet()) { - ItemStack is = entry.getKey(); - Integer amount = entry.getValue(); - while (amount != 0) { - ItemStack toAdd = is.clone(); - int addAmount = Math.min(amount, is.getMaxStackSize()); - toAdd.setAmount(addAmount); - result.add(toAdd); - amount -= addAmount; - } - } - return result; - } - - /** - * Clones this map - */ - public ItemMap clone() { - ItemMap clone = new ItemMap(); - for (Entry entry : getEntrySet()) { - clone.addItemAmount(entry.getKey(), entry.getValue()); - } - return clone; - } - - /** - * Checks whether this instance would completly fit into the given inventory - * - * @param i - * Inventory to check - * @return True if this ItemMap's item representation would completly fit in - * the inventory, false if not - */ - public boolean fitsIn(Inventory i) { - ItemMap invCopy = new ItemMap(i); - ItemMap instanceCopy = this.clone(); - instanceCopy.merge(invCopy); - return instanceCopy.getItemStackRepresentation().size() <= i.getSize(); - } - - public boolean equals(Object o) { - if (o instanceof ItemMap) { - ItemMap im = (ItemMap) o; - if (im.getTotalItemAmount() == getTotalItemAmount()) { - return im.getEntrySet().equals(getEntrySet()); - } - } - return false; - } - - /** - * Utility to not mess with stacks directly taken from inventories - * - * @param is - * Template ItemStack - * @return Cloned ItemStack with its amount set to 1 - */ - private static ItemStack createMapConformCopy(ItemStack is) { - ItemStack copy = is.clone(); - copy.setAmount(1); - return copy; - } -} diff --git a/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java b/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java deleted file mode 100644 index a1f72bc3..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/ItemStackUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.util.LinkedList; -import java.util.List; - -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -public class ItemStackUtils { - public static void addLore(ItemStack is, String... lore) { - ItemMeta im = is.getItemMeta(); - List loreList = im.getLore(); - if (loreList == null) { - loreList = new LinkedList(); - } - for (String currLore : lore) { - loreList.add(currLore); - } - im.setLore(loreList); - is.setItemMeta(im); - - } - - public static void setLore(ItemStack is, String... lore) { - ItemMeta im = is.getItemMeta(); - List loreList = new LinkedList(); - for (String currLore : lore) { - loreList.add(currLore); - } - im.setLore(loreList); - is.setItemMeta(im); - } - - public static void setName(ItemStack is, String name) { - ItemMeta im = is.getItemMeta(); - im.setDisplayName(name); - is.setItemMeta(im); - } - - public static String getName(ItemStack is) { - return is.getItemMeta().getDisplayName(); - } - -} diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 58bf042c..e48a18cd 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -22,6 +22,9 @@ import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; import vg.civcraft.mc.civmodcore.inventorygui.ScheduledInventoryOpen; +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; @@ -58,13 +61,13 @@ public MenuBuilder() { } } ItemStack inp = new ItemStack(Material.PAPER); - ItemStackUtils.setName(inp, "Input"); - ItemStackUtils.setLore(inp, ChatColor.LIGHT_PURPLE + ISUtils.setName(inp, "Input"); + ISUtils.setLore(inp, ChatColor.LIGHT_PURPLE + "The items below are required"); input = new DecorationStack(inp); ItemStack outp = new ItemStack(Material.PAPER); - ItemStackUtils.setName(outp, "Output"); - ItemStackUtils.setLore(outp, ChatColor.LIGHT_PURPLE + ISUtils.setName(outp, "Output"); + ISUtils.setLore(outp, ChatColor.LIGHT_PURPLE + "The output of this recipe"); } @@ -105,8 +108,8 @@ public void openFactoryBrowser(Player p, String startingFac) { InventoryType.CHEST, furnegg.getName()); // creation option ItemStack creationStack = new ItemStack(Material.CHEST); - ItemStackUtils.setName(creationStack, "Setup"); - ItemStackUtils.addLore(creationStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(creationStack, "Setup"); + ISUtils.addLore(creationStack, ChatColor.LIGHT_PURPLE + "Click to display more information", ChatColor.LIGHT_PURPLE + "on how to setup this factory"); Clickable creationClickable = new Clickable(creationStack) { @@ -120,8 +123,8 @@ public void clicked(Player arg0) { // recipe option ItemStack recipeStack = new ItemStack(Material.WORKBENCH); - ItemStackUtils.setName(recipeStack, "Recipes"); - ItemStackUtils.addLore(recipeStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(recipeStack, "Recipes"); + ISUtils.addLore(recipeStack, ChatColor.LIGHT_PURPLE + "Click to display all recipes", ChatColor.LIGHT_PURPLE + "this factory can run"); Clickable recipeClickable = new Clickable(recipeStack) { @@ -135,8 +138,8 @@ public void clicked(Player arg0) { // upgrade option ItemStack upgradeStack = new ItemStack(Material.FURNACE); - ItemStackUtils.setName(upgradeStack, "Upgrades"); - ItemStackUtils.addLore(upgradeStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(upgradeStack, "Upgrades"); + ISUtils.addLore(upgradeStack, ChatColor.LIGHT_PURPLE + "Click to display more information about", ChatColor.LIGHT_PURPLE + "the possible upgrades to this factory"); @@ -167,7 +170,7 @@ private void openRecipeBrowser(Player p, String facName) { @Override public void clicked(Player arg0) { openDetailedRecipeBrowser(arg0, - ItemStackUtils.getName(this.getItemStack())); + ISUtils.getName(this.getItemStack())); } }; recipeInventory.setSlot(c, i); @@ -175,8 +178,8 @@ public void clicked(Player arg0) { // back option ItemStack backStack = new ItemStack(Material.ARROW); - ItemStackUtils.setName(backStack, "Back to factory overview"); - ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(backStack, "Back to factory overview"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override @@ -200,11 +203,11 @@ private void openSetupBrowser(Player p, String facName) { ItemStack fur = new ItemStack(Material.FURNACE); ItemStack che = new ItemStack(Material.CHEST); if (parEgg == null) {// creation factory - ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "This factory can be created with", ChatColor.LIGHT_PURPLE + "a normal crafting table, furnace and chest"); - ItemStackUtils.setLore(che, ChatColor.LIGHT_PURPLE + ISUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Arrange the 3 blocks like this,", ChatColor.LIGHT_PURPLE + "put the materials below in the chest", ChatColor.LIGHT_PURPLE @@ -244,7 +247,7 @@ private void openSetupBrowser(Player p, String facName) { } } - ItemStackUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "Upgrade from a " + parEgg.getName()); + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "Upgrade from a " + parEgg.getName()); Clickable craCli = new Clickable(cr) { @Override public void clicked(Player arg0) { @@ -253,7 +256,7 @@ public void clicked(Player arg0) { } }; ci.setSlot(craCli, 4); - ItemStackUtils.setLore(fur, ChatColor.LIGHT_PURPLE + ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Click to display information", ChatColor.LIGHT_PURPLE + "on this factory"); Clickable furCli = new Clickable(fur) { @Override @@ -292,8 +295,8 @@ public void clicked(Player arg0) { } ci.setSlot(input, 22); ItemStack backStack = new ItemStack(Material.ARROW); - ItemStackUtils.setName(backStack, "Back to factory overview"); - ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(backStack, "Back to factory overview"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override @@ -318,8 +321,8 @@ private void openUpgradeBrowser(Player p, String facName) { } if (upgrades.size() == 0) { ItemStack bar = new ItemStack(Material.BARRIER); - ItemStackUtils.setName(bar, "No upgrades available"); - ItemStackUtils.addLore(bar, ChatColor.LIGHT_PURPLE + ISUtils.setName(bar, "No upgrades available"); + ISUtils.addLore(bar, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable noUpgrades = new Clickable(bar) { @Override @@ -332,22 +335,22 @@ public void clicked(Player p) { for (IRecipe recipe : upgrades) { ItemStack recStack = ((InputRecipe) recipe) .getRecipeRepresentation(); - ItemStackUtils.setLore(recStack, ChatColor.LIGHT_PURPLE + ISUtils.setLore(recStack, ChatColor.LIGHT_PURPLE + "Click to display more information"); Clickable c = new Clickable( ((InputRecipe) recipe).getRecipeRepresentation()) { @Override public void clicked(Player p) { openDetailedRecipeBrowser(p, - ItemStackUtils.getName(this.getItemStack())); + ISUtils.getName(this.getItemStack())); } }; ci.addSlot(c); } } ItemStack backStack = new ItemStack(Material.ARROW); - ItemStackUtils.setName(backStack, "Back to factory overview"); - ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(backStack, "Back to factory overview"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override @@ -372,8 +375,8 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { } ClickableInventory ci = new ClickableInventory(54, recipeName); ItemStack inputStack = new ItemStack(Material.PAPER); - ItemStackUtils.setName(inputStack, "Input materials"); - ItemStackUtils.addLore(inputStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(inputStack, "Input materials"); + ISUtils.addLore(inputStack, ChatColor.LIGHT_PURPLE + "The materials required to run this recipe"); DecorationStack inputClickable = new DecorationStack(inputStack); ci.setSlot(inputClickable, 4); @@ -399,11 +402,11 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { } ItemStack outputStack = new ItemStack(Material.PAPER); - ItemStackUtils.setName(outputStack, "Output/effect"); + ISUtils.setName(outputStack, "Output/effect"); DecorationStack outputClickable = new DecorationStack(outputStack); ItemStack backStack = new ItemStack(Material.ARROW); - ItemStackUtils.setName(backStack, "Back to recipe overview"); - ItemStackUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + ISUtils.setName(backStack, "Back to recipe overview"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override @@ -429,7 +432,7 @@ public void clicked(Player arg0) { && ((Upgraderecipe) re) .getEgg() .getName() - .equals(ItemStackUtils.getName(this + .equals(ISUtils.getName(this .getItemStack()))) { openFactoryBrowser(arg0, ((Upgraderecipe) re) .getEgg().getName()); @@ -490,8 +493,8 @@ public void clicked(Player arg0) { } if (mats.size() >= (start + 45)) { ItemStack nextPage = new ItemStack(Material.ARROW); - ItemStackUtils.setName(nextPage, "Next page"); - ItemStackUtils.addLore(nextPage, ChatColor.LIGHT_PURPLE + ISUtils.setName(nextPage, "Next page"); + ISUtils.addLore(nextPage, ChatColor.LIGHT_PURPLE + "Click to show entries upwards from " + (start + 45)); Clickable nextClick = new Clickable(nextPage) { diff --git a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java b/src/com/github/igotyou/FactoryMod/utility/NiceNames.java deleted file mode 100644 index ea824323..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/NiceNames.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.ItemStack; -import org.bukkit.Material; - -import com.github.igotyou.FactoryMod.FactoryMod; - -public class NiceNames { - private static Map> items; - private static Map enchants; - - public static String getName(ItemStack is) { - Map duraMap = items.get(is.getType()); - if (duraMap == null) { - return "COULD NOT FIND NAME FOR " + is.getType() + ", dura:" - + is.getDurability(); - } - String res = duraMap.get(is.getDurability()); - if (res == null) { - return "COULD NOT FIND NAME FOR " + is.getType() + ", dura:" - + is.getDurability(); - } else { - return res; - } - } - - public static String getName(Enchantment enchant) { - return enchants.get(enchant); - } - - public void loadNames() { - //item aliases - items = new HashMap>(); - int counter = 0; - try { - InputStream in = getClass().getResourceAsStream("/materials.csv"); - BufferedReader reader = new BufferedReader( - new InputStreamReader(in)); - String line = reader.readLine(); - while (line != null) { - String[] content = line.split(","); - Map duraMap = items.get(Material - .valueOf(content[1])); - if (duraMap == null) { - duraMap = new HashMap(); - items.put(Material.valueOf(content[1]), duraMap); - } - duraMap.put(Short.valueOf(content[3]), content[0]); - line = reader.readLine(); - counter++; - } - reader.close(); - } catch (Exception e) { - e.printStackTrace(); - } - FactoryMod.getPlugin().info( - "Imported " + counter + " item name aliases"); - - //enchantment aliases - enchants = new HashMap(); - counter = 0; - try { - InputStream in = getClass().getResourceAsStream("/enchantments.csv"); - BufferedReader reader = new BufferedReader( - new InputStreamReader(in)); - String line = reader.readLine(); - while (line != null) { - String[] content = line.split(","); - enchants.put(Enchantment.getByName(content[1]), content[0]); - line = reader.readLine(); - counter++; - } - reader.close(); - } catch (Exception e) { - e.printStackTrace(); - } - FactoryMod.getPlugin().info( - "Imported " + counter + " enchantment aliases"); - } -} From f87676a15a6f71b0c176031f6f789a76ba27abae Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 22 Jan 2016 02:10:50 +0100 Subject: [PATCH 204/459] Add logging --- .../igotyou/FactoryMod/ConfigParser.java | 3 +- .../igotyou/FactoryMod/FactoryModManager.java | 7 +++- .../igotyou/FactoryMod/factories/Factory.java | 4 ++ .../factories/FurnCraftChestFactory.java | 18 +++++--- .../igotyou/FactoryMod/factories/Pipe.java | 18 ++++++++ .../igotyou/FactoryMod/factories/Sorter.java | 34 +++++++++++++-- .../FactoryMod/recipes/CompactingRecipe.java | 2 + .../recipes/DecompactingRecipe.java | 3 +- .../DeterministicEnchantingRecipe.java | 3 ++ .../FactoryMod/recipes/InputRecipe.java | 20 ++++++--- .../FactoryMod/recipes/ProductionRecipe.java | 7 ++-- .../recipes/RandomEnchantingRecipe.java | 2 + .../FactoryMod/recipes/RepairRecipe.java | 10 ++++- .../FactoryMod/recipes/Upgraderecipe.java | 14 ++++--- .../FactoryMod/utility/LoggingUtils.java | 41 +++++++++++++++++++ 15 files changed, 160 insertions(+), 26 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 298d4aea..8c8cec0f 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -62,6 +62,7 @@ public FactoryModManager parse() { FileConfiguration config = plugin.getConfig(); boolean citadelEnabled = plugin.getServer().getPluginManager() .isPluginEnabled("Citadel"); + boolean logInventories = config.getBoolean("log_inventories",true); Material factoryInteractionMaterial = Material.getMaterial(config .getString("factory_interaction_material", "STICK")); boolean disableNether = config.getBoolean("disable_nether", false); @@ -79,7 +80,7 @@ public FactoryModManager parse() { int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); manager = new FactoryModManager(plugin, factoryInteractionMaterial, - citadelEnabled, redstonePowerOn, redstoneRecipeChange); + citadelEnabled, redstonePowerOn, redstoneRecipeChange, logInventories); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); upgradeEggs = new HashMap(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 93e93030..5c2b93c1 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -41,13 +41,14 @@ public class FactoryModManager { private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; private boolean citadelEnabled; + private boolean logInventories; private int redstonePowerOn; private int redstoneRecipeChange; private String compactLore; public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, - int redstonePowerOn, int redstoneRecipeChange) { + int redstonePowerOn, int redstoneRecipeChange, boolean logInventories) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; @@ -89,6 +90,10 @@ public FactoryModManager(FactoryMod plugin, public void setCompactLore(String lore) { compactLore = lore; } + + public boolean logInventories() { + return logInventories; + } /** * @return Lore given to compacted items diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 83334aec..8bce6210 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -149,6 +149,10 @@ public void turnFurnaceOn(Block f) { furnace.setBurnTime(Short.MAX_VALUE); furnace.getInventory().setContents(oldContents); } + + public String getLogData() { + return name+" at " + mbs.getCenter().toString(); + } public void turnFurnaceOff(Block f) { Furnace furnace = (Furnace) f.getState(); diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index ca4f83ce..79ff9bee 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -25,6 +25,7 @@ import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; /** * Represents a "classic" factory, which consists of a furnace as powersource, a @@ -47,7 +48,7 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, this.active = false; this.recipes = recipes; this.runCount = new HashMap(); - for(IRecipe rec:recipes) { + for (IRecipe rec : recipes) { runCount.put(rec, 0); } if (pylonFactories == null) { @@ -91,8 +92,11 @@ public FurnaceInventory getFurnaceInventory() { * that the factory is allowed to turn on */ public void attemptToActivate(Player p) { + LoggingUtils.log((p != null ? p.getName() : "Redstone") + + "is attempting to activate " + getLogData()); // TODO Citadel stuff mbs.recheckComplete(); + if (active) { return; } @@ -132,8 +136,7 @@ public void attemptToActivate(Player p) { + "Not enough materials available"); } } - } - else { + } else { rm.breakIt(); } } @@ -144,6 +147,7 @@ public void attemptToActivate(Player p) { * is allowed to turn on */ public void activate() { + LoggingUtils.log("Activating " + getLogData()); active = true; pm.setPowerCounter(0); turnFurnaceOn(getFurnace()); @@ -156,6 +160,7 @@ public void activate() { * Turns the factory off. */ public void deactivate() { + LoggingUtils.log("Deactivating " + getLogData()); if (active) { turnFurnaceOff(getFurnace()); active = false; @@ -234,6 +239,9 @@ public void run() { // time remove input from chest, and add output material else if (currentProductionTimer >= currentRecipe .getProductionTime()) { + LoggingUtils.log("Executing recipe " + + currentRecipe.getRecipeName() + " for " + + getLogData()); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of @@ -298,7 +306,7 @@ public void setRecipe(IRecipe pr) { currentRecipe = pr; } } - + public int getRunCount(IRecipe r) { return runCount.get(r); } @@ -335,7 +343,7 @@ public void upgrade(String name, List recipes, ItemStack fuel, currentRecipe = null; } runCount = new HashMap(); - for(IRecipe rec:recipes) { + for (IRecipe rec : recipes) { runCount.put(rec, 0); } } diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index fe67c91f..9347dfa0 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -18,6 +18,7 @@ import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class Pipe extends Factory { private List allowedMaterials; @@ -37,6 +38,8 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, public void attemptToActivate(Player p) { // TODO Citadel stuff + LoggingUtils.log((p != null ? p.getName() : "Redstone") + + "is attempting to activate " + getLogData()); mbs.recheckComplete(); if (mbs.isComplete()) { if (transferMaterialsAvailable()) { @@ -65,6 +68,7 @@ public void attemptToActivate(Player p) { } public void activate() { + LoggingUtils.log("Activating " + getLogData()); active = true; pm.setPowerCounter(0); turnFurnaceOn(((PipeStructure) mbs).getFurnace()); @@ -74,6 +78,7 @@ public void activate() { } public void deactivate() { + LoggingUtils.log("Deactivating " + getLogData()); active = false; turnFurnaceOff(((PipeStructure) mbs).getFurnace()); runTime = 0; @@ -115,6 +120,7 @@ && transferMaterialsAvailable()) { } public void transfer() { + LoggingUtils.log("Attempting to transfer for " + getLogData()); if (mbs.isComplete()) { Inventory sourceInventory = ((InventoryHolder) (((PipeStructure) mbs) .getStart().getState())).getInventory(); @@ -131,8 +137,20 @@ public void transfer() { removing.setAmount(removeAmount); ItemMap removeMap = new ItemMap(removing); if (removeMap.fitsIn(targetInventory)) { + LoggingUtils.logInventory(sourceInventory, + "Origin inventory before transfer for " + + getLogData()); + LoggingUtils.logInventory(targetInventory, + "Target inventory before transfer for " + + getLogData()); sourceInventory.removeItem(removing); targetInventory.addItem(removing); + LoggingUtils.logInventory(sourceInventory, + "Origin inventory after transfer for " + + getLogData()); + LoggingUtils.logInventory(targetInventory, + "Target inventory after transfer for " + + getLogData()); leftToRemove -= removeAmount; } else { break; diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 2303fef1..1c7599e1 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -20,6 +20,7 @@ import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class Sorter extends Factory { private Map assignedMaterials; @@ -40,10 +41,13 @@ public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, for (BlockFace bf : MultiBlockStructure.allBlockSides) { assignedMaterials.put(bf, new ItemMap()); } - assignedMaterials.remove(mbs.getCenter().getBlock().getFace(((BlockFurnaceStructure)mbs).getFurnace())); + assignedMaterials.remove(mbs.getCenter().getBlock() + .getFace(((BlockFurnaceStructure) mbs).getFurnace())); } public void attemptToActivate(Player p) { + LoggingUtils.log((p != null ? p.getName() : "Redstone") + + "is attempting to activate " + getLogData()); mbs.recheckComplete(); if (mbs.isComplete()) { activate(); @@ -71,12 +75,16 @@ public void setAssignments(Map assigns) { } public void activate() { + LoggingUtils.log("Activating " + getLogData()); + LoggingUtils.logInventory(mbs.getCenter().getBlock()); turnFurnaceOn(((BlockFurnaceStructure) mbs).getFurnace()); active = true; run(); } public void deactivate() { + LoggingUtils.log("Deactivating " + getLogData()); + LoggingUtils.logInventory(mbs.getCenter().getBlock()); turnFurnaceOff(((BlockFurnaceStructure) mbs).getFurnace()); active = false; } @@ -129,7 +137,7 @@ public BlockFace getSide(ItemStack is) { public void addAssignment(BlockFace bf, ItemStack is) { assignedMaterials.get(bf).addItemStack(is.clone()); } - + public ItemMap getItemsForSide(BlockFace face) { return assignedMaterials.get(face); } @@ -144,6 +152,7 @@ public void removeAssignment(ItemStack is) { } public void sortStack() { + LoggingUtils.log("Attempting to sort " + getLogData()); Block center = mbs.getCenter().getBlock(); Inventory inv = getCenterInventory(); int leftToSort = sortAmount; @@ -159,9 +168,28 @@ public void sortStack() { ItemStack rem = is.clone(); rem.setAmount(removeAmount); if (new ItemMap(is).fitsIn(relInv)) { + LoggingUtils.log("Moving " + + rem.toString() + + " from " + + mbs.getCenter().toString() + + " to " + + center.getRelative(bf).getLocation() + .toString()); + LoggingUtils.logInventory(inv, + "Origin inventory before transfer for " + + getLogData()); + LoggingUtils.logInventory(relInv, + "Target inventory before transfer for " + + getLogData()); inv.removeItem(rem); relInv.addItem(rem); - leftToSort -=removeAmount; + LoggingUtils.logInventory(inv, + "Origin inventory after transfer for " + + getLogData()); + LoggingUtils.logInventory(relInv, + "Target inventory after transfer for " + + getLogData()); + leftToSort -= removeAmount; break; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 664ece94..13b6789b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -54,6 +54,7 @@ public String getRecipeName() { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { @@ -69,6 +70,7 @@ public void applyEffect(Inventory i, Factory f) { } } } + logAfterRecipeRun(i, f); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 4cd6c805..f0a0b60d 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -43,6 +43,7 @@ public boolean enoughMaterialAvailable(Inventory i) { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { @@ -71,7 +72,7 @@ public void applyEffect(Inventory i, Factory f) { } } } - + logAfterRecipeRun(i, f); } public List getInputRepresentation(Inventory i) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index ef5cec06..df0a2d66 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -13,6 +13,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; @@ -79,6 +80,7 @@ public List getInputRepresentation(Inventory i) { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); for(ItemStack is:input.getItemStackRepresentation()) { i.removeItem(is); } @@ -89,6 +91,7 @@ public void applyEffect(Inventory i, Factory f) { break; } } + logAfterRecipeRun(i, f); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 0e70887d..66b0de83 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -8,6 +8,9 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; + import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -108,14 +111,21 @@ protected List createLoredStacksForInfo(Inventory i) { } for (ItemStack is : input.getItemStackRepresentation()) { - ISUtils.addLore( - is, - ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns.getAmount(is)) - + " runs"); + ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns.getAmount(is)) + " runs"); result.add(is); } return result; } + protected void logBeforeRecipeRun(Inventory i, Factory f) { + LoggingUtils.logInventory(i, "Before executing recipe " + name + + " for " + f.getLogData()); + } + + protected void logAfterRecipeRun(Inventory i, Factory f) { + LoggingUtils.logInventory(i, "After executing recipe " + name + " for " + + f.getLogData()); + } + } diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 3d36daa9..40263405 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -47,9 +47,8 @@ public List getOutputRepresentation(Inventory i) { } int possibleRuns = input.getMultiplesContainedIn(i); for (ItemStack is : stacks) { - ISUtils.addLore(is, ChatColor.GREEN - + "Enough materials for " + String.valueOf(possibleRuns) - + " runs"); + ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + + String.valueOf(possibleRuns) + " runs"); } return stacks; } @@ -62,6 +61,7 @@ public List getInputRepresentation(Inventory i) { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); ItemMap toRemove = input.clone(); ItemMap toAdd = output.clone(); if (toRemove.isContainedIn(i)) { @@ -72,6 +72,7 @@ public void applyEffect(Inventory i, Factory f) { i.addItem(is); } } + logAfterRecipeRun(i, f); } public ItemStack getRecipeRepresentation() { diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index f956d915..b0284edb 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -95,6 +95,7 @@ public List getOutputRepresentation(Inventory i) { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } @@ -114,6 +115,7 @@ public void applyEffect(Inventory i, Factory f) { break; } } + logAfterRecipeRun(i, f); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 41b531f4..e8069274 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -12,6 +12,7 @@ import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; /** * Used to repair FurnCraftChest factories. Once one of those factories is in @@ -30,8 +31,7 @@ public RepairRecipe(String name, int productionTime, ItemMap input, public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); - ISUtils.setLore(furn, "+" + String.valueOf(healthPerRun) - + " health"); + ISUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); result.add(furn); return result; } @@ -44,13 +44,19 @@ public List getInputRepresentation(Inventory i) { } public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); if (enoughMaterialAvailable(i)) { for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } ((PercentageHealthRepairManager) (f.getRepairManager())) .repair(healthPerRun); + LoggingUtils.log(((PercentageHealthRepairManager) (f + .getRepairManager())).getHealth() + + " for " + + f.getLogData() + " after repairing"); } + logAfterRecipeRun(i, f); } public ItemStack getRecipeRepresentation() { diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 0a217712..f144c586 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -20,12 +20,14 @@ public class Upgraderecipe extends InputRecipe { private IFactoryEgg egg; - public Upgraderecipe(String name, int productionTime, ItemMap input, IFactoryEgg egg) { + public Upgraderecipe(String name, int productionTime, ItemMap input, + IFactoryEgg egg) { super(name, productionTime, input); this.egg = egg; } public void applyEffect(Inventory i, Factory f) { + logAfterRecipeRun(i, f); if (input.isContainedIn(i) && f instanceof FurnCraftChestFactory) { for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); @@ -35,7 +37,7 @@ public void applyEffect(Inventory i, Factory f) { e.getFuel(), e.getFuelConsumptionIntervall(), e.getUpdateTime()); } - + logAfterRecipeRun(i, f); } public ItemStack getRecipeRepresentation() { @@ -78,17 +80,19 @@ public List getOutputRepresentation(Inventory i) { List res = new LinkedList(); ItemStack cr = new ItemStack(Material.WORKBENCH); ISUtils.setName(cr, egg.getName()); - ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE+ "Upgrade to get new and better recipes"); + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + + "Upgrade to get new and better recipes"); res.add(cr); ItemStack fur = new ItemStack(Material.FURNACE); ISUtils.setName(fur, egg.getName()); ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Recipes:"); - for(IRecipe rec : ((FurnCraftChestEgg)egg).getRecipes()) { + for (IRecipe rec : ((FurnCraftChestEgg) egg).getRecipes()) { ISUtils.addLore(fur, ChatColor.YELLOW + rec.getRecipeName()); } res.add(fur); ItemStack che = new ItemStack(Material.CHEST); - ISUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Careful, you can not",ChatColor.LIGHT_PURPLE+ "revert upgrades!"); + ISUtils.setLore(che, ChatColor.LIGHT_PURPLE + "Careful, you can not", + ChatColor.LIGHT_PURPLE + "revert upgrades!"); ISUtils.setName(che, egg.getName()); res.add(che); return res; diff --git a/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java b/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java new file mode 100644 index 00000000..a687aced --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java @@ -0,0 +1,41 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.logging.Level; + +import org.bukkit.block.Block; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; + +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +import com.github.igotyou.FactoryMod.FactoryMod; + +public class LoggingUtils { + + public static void log(String msg) { + FactoryMod.getPlugin().getLogger().log(Level.FINE, msg); + } + + private static String serializeInventory(Inventory i) { + return new ItemMap(i).toString(); + } + + public static void logInventory(Block b) { + if (FactoryMod.getManager().logInventories() + && b.getState() instanceof InventoryHolder) { + log("Contents of " + + b.getType().toString() + + " at " + + b.getLocation().toString() + + " contains: " + + serializeInventory(((InventoryHolder) b.getState()) + .getInventory())); + } + } + + public static void logInventory(Inventory i, String msg) { + if (FactoryMod.getManager().logInventories()) { + log(msg + serializeInventory(i)); + } + } +} From 76d624e478cc75785f1e1fa34b66550ca2b10397 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 22 Jan 2016 02:12:39 +0100 Subject: [PATCH 205/459] Remove unused ruby script --- validate_config.rb | 54 ---------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 validate_config.rb diff --git a/validate_config.rb b/validate_config.rb deleted file mode 100644 index 7f511191..00000000 --- a/validate_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -require 'yaml' - -ok = true - -raw = File.read('config.yml') - -if raw[/\t/] - ok = false - puts "Contains tabs" -end - -data = YAML.load(raw) - -factories = data['production_factories'] -recipes = data['production_recipes'] - -referenced_recipes = factories.values.map {|e| e['recipes']}.flatten.uniq - -missing_recipes = referenced_recipes - recipes.keys -if missing_recipes.length > 0 - ok = false - puts "Missing recipes:" - puts " " + missing_recipes.inspect -end - -unused_recipes = recipes.keys - referenced_recipes -if unused_recipes.length > 0 - ok = false - puts "Unused recipes:" - puts " " + unused_recipes.inspect -end - -factory_build_materials = factories.values.map {|e| e['inputs']} -factory_repair_materials = factories.values.map {|e| e['repair_inputs']} -recipe_input_materials = recipes.values.map {|e| e['inputs']} -recipe_output_materials = recipes.values.map {|e| e['outputs']} - -BukkitMaterials = ["ACACIA_STAIRS", "ACTIVATOR_RAIL", "AIR", "ANVIL", "APPLE", "ARROW", "BAKED_POTATO", "BEACON", "BED", "BED_BLOCK", "BEDROCK", "BIRCH_WOOD_STAIRS", "BLAZE_POWDER", "BLAZE_ROD", "BOAT", "BONE", "BOOK", "BOOK_AND_QUILL", "BOOKSHELF", "BOW", "BOWL", "BREAD", "BREWING_STAND", "BREWING_STAND_ITEM", "BRICK", "BRICK_STAIRS", "BROWN_MUSHROOM", "BUCKET", "BURNING_FURNACE", "CACTUS", "CAKE", "CAKE_BLOCK", "CARPET", "CARROT", "CARROT_ITEM", "CARROT_STICK", "CAULDRON", "CAULDRON_ITEM", "CHAINMAIL_BOOTS", "CHAINMAIL_CHESTPLATE", "CHAINMAIL_HELMET", "CHAINMAIL_LEGGINGS", "CHEST", "CLAY", "CLAY_BALL", "CLAY_BRICK", "COAL", "COAL_BLOCK", "COAL_ORE", "COBBLE_WALL", "COBBLESTONE", "COBBLESTONE_STAIRS", "COCOA", "COMMAND", "COMMAND_MINECART", "COMPASS", "COOKED_BEEF", "COOKED_CHICKEN", "COOKED_FISH", "COOKIE", "CROPS", "DARK_OAK_STAIRS", "DAYLIGHT_DETECTOR", "DEAD_BUSH", "DETECTOR_RAIL", "DIAMOND", "DIAMOND_AXE", "DIAMOND_BARDING", "DIAMOND_BLOCK", "DIAMOND_BOOTS", "DIAMOND_CHESTPLATE", "DIAMOND_HELMET", "DIAMOND_HOE", "DIAMOND_LEGGINGS", "DIAMOND_ORE", "DIAMOND_PICKAXE", "DIAMOND_SPADE", "DIAMOND_SWORD", "DIODE", "DIODE_BLOCK_OFF", "DIODE_BLOCK_ON", "DIRT", "DISPENSER", "DOUBLE_PLANT", "DOUBLE_STEP", "DRAGON_EGG", "DROPPER", "EGG", "EMERALD", "EMERALD_BLOCK", "EMERALD_ORE", "EMPTY_MAP", "ENCHANTED_BOOK", "ENCHANTMENT_TABLE", "ENDER_CHEST", "ENDER_PEARL", "ENDER_PORTAL", "ENDER_PORTAL_FRAME", "ENDER_STONE", "EXP_BOTTLE", "EXPLOSIVE_MINECART", "EYE_OF_ENDER", "FEATHER", "FENCE", "FENCE_GATE", "FERMENTED_SPIDER_EYE", "FIRE", "FIREBALL", "FIREWORK", "FIREWORK_CHARGE", "FISHING_ROD", "FLINT", "FLINT_AND_STEEL", "FLOWER_POT", "FLOWER_POT_ITEM", "FURNACE", "GHAST_TEAR", "GLASS", "GLASS_BOTTLE", "GLOWING_REDSTONE_ORE", "GLOWSTONE", "GLOWSTONE_DUST", "GOLD_AXE", "GOLD_BARDING", "GOLD_BLOCK", "GOLD_BOOTS", "GOLD_CHESTPLATE", "GOLD_HELMET", "GOLD_HOE", "GOLD_INGOT", "GOLD_LEGGINGS", "GOLD_NUGGET", "GOLD_ORE", "GOLD_PICKAXE", "GOLD_PLATE", "GOLD_RECORD", "GOLD_SPADE", "GOLD_SWORD", "GOLDEN_APPLE", "GOLDEN_CARROT", "GRASS", "GRAVEL", "GREEN_RECORD", "GRILLED_PORK", "HARD_CLAY", "HAY_BLOCK", "HOPPER", "HOPPER_MINECART", "HUGE_MUSHROOM_1", "HUGE_MUSHROOM_2", "ICE", "INK_SACK", "IRON_AXE", "IRON_BARDING", "IRON_BLOCK", "IRON_BOOTS", "IRON_CHESTPLATE", "IRON_DOOR", "IRON_DOOR_BLOCK", "IRON_FENCE", "IRON_HELMET", "IRON_HOE", "IRON_INGOT", "IRON_LEGGINGS", "IRON_ORE", "IRON_PICKAXE", "IRON_PLATE", "IRON_SPADE", "IRON_SWORD", "ITEM_FRAME", "JACK_O_LANTERN", "JUKEBOX", "JUNGLE_WOOD_STAIRS", "LADDER", "LAPIS_BLOCK", "LAPIS_ORE", "LAVA", "LAVA_BUCKET", "LEASH", "LEATHER", "LEATHER_BOOTS", "LEATHER_CHESTPLATE", "LEATHER_HELMET", "LEATHER_LEGGINGS", "LEAVES", "LEAVES_2", "LEVER", "LOCKED_CHEST", "Deprecated.", "LOG", "LOG_2", "LONG_GRASS", "MAGMA_CREAM", "MAP", "MELON", "MELON_BLOCK", "MELON_SEEDS", "MELON_STEM", "MILK_BUCKET", "MINECART", "MOB_SPAWNER", "MONSTER_EGG", "MONSTER_EGGS", "MOSSY_COBBLESTONE", "MUSHROOM_SOUP", "MYCEL", "NAME_TAG", "NETHER_BRICK", "NETHER_BRICK_ITEM", "NETHER_BRICK_STAIRS", "NETHER_FENCE", "NETHER_STALK", "NETHER_STAR", "NETHER_WARTS", "NETHERRACK", "NOTE_BLOCK", "OBSIDIAN", "PACKED_ICE", "PAINTING", "PAPER", "PISTON_BASE", "PISTON_EXTENSION", "PISTON_MOVING_PIECE", "PISTON_STICKY_BASE", "POISONOUS_POTATO", "PORK", "PORTAL", "POTATO", "POTATO_ITEM", "POTION", "POWERED_MINECART", "POWERED_RAIL", "PUMPKIN", "PUMPKIN_PIE", "PUMPKIN_SEEDS", "PUMPKIN_STEM", "QUARTZ", "QUARTZ_BLOCK", "QUARTZ_ORE", "QUARTZ_STAIRS", "RAILS", "RAW_BEEF", "RAW_CHICKEN", "RAW_FISH", "RECORD_10", "RECORD_11", "RECORD_12", "RECORD_3", "RECORD_4", "RECORD_5", "RECORD_6", "RECORD_7", "RECORD_8", "RECORD_9", "RED_MUSHROOM", "RED_ROSE", "REDSTONE", "REDSTONE_BLOCK", "REDSTONE_COMPARATOR", "REDSTONE_COMPARATOR_OFF", "REDSTONE_COMPARATOR_ON", "REDSTONE_LAMP_OFF", "REDSTONE_LAMP_ON", "REDSTONE_ORE", "REDSTONE_TORCH_OFF", "REDSTONE_TORCH_ON", "REDSTONE_WIRE", "ROTTEN_FLESH", "SADDLE", "SAND", "SANDSTONE", "SANDSTONE_STAIRS", "SAPLING", "SEEDS", "SHEARS", "SIGN", "SIGN_POST", "SKULL", "SKULL_ITEM", "SLIME_BALL", "SMOOTH_BRICK", "SMOOTH_STAIRS", "SNOW", "SNOW_BALL", "SNOW_BLOCK", "SOIL", "SOUL_SAND", "SPECKLED_MELON", "SPIDER_EYE", "SPONGE", "SPRUCE_WOOD_STAIRS", "STAINED_CLAY", "STAINED_GLASS", "STAINED_GLASS_PANE", "STATIONARY_LAVA", "STATIONARY_WATER", "STEP", "STICK", "STONE", "STONE_AXE", "STONE_BUTTON", "STONE_HOE", "STONE_PICKAXE", "STONE_PLATE", "STONE_SPADE", "STONE_SWORD", "STORAGE_MINECART", "STRING", "SUGAR", "SUGAR_CANE", "SUGAR_CANE_BLOCK", "SULPHUR", "THIN_GLASS", "TNT", "TORCH", "TRAP_DOOR", "TRAPPED_CHEST", "TRIPWIRE", "TRIPWIRE_HOOK", "VINE", "WALL_SIGN", "WATCH", "WATER", "WATER_BUCKET", "WATER_LILY", "WEB", "WHEAT", "WOOD", "WOOD_AXE", "WOOD_BUTTON", "WOOD_DOOR", "WOOD_DOUBLE_STEP", "WOOD_HOE", "WOOD_PICKAXE", "WOOD_PLATE", "WOOD_SPADE", "WOOD_STAIRS", "WOOD_STEP", "WOOD_SWORD", "WOODEN_DOOR", "WOOL", "WORKBENCH", "WRITTEN_BOOK", "YELLOW_FLOWER"] - -all_materials = ( - factory_build_materials.map {|i| i.values.map {|e| e['material']}} + - factory_repair_materials.map {|i| i.values.map {|e| e['material']}} + - recipe_input_materials.map {|i| i.values.map {|e| e['material']}} + - recipe_output_materials.map {|i| i.values.map {|e| e['material']}} -).flatten.uniq.sort - -unknown_materials = all_materials - BukkitMaterials -if unknown_materials.length > 0 - ok = false - puts "Unknown materials:" - puts " " + unknown_materials.inspect -end - -puts "OK" if ok From 29a1caf490974c7eb2f507e79ef5533b0432bed0 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 25 Jan 2016 02:34:34 +0100 Subject: [PATCH 206/459] Fixing minor bugs and reworking save/load to use yaml --- .../github/igotyou/FactoryMod/FactoryMod.java | 18 +- .../igotyou/FactoryMod/FactoryModManager.java | 155 ++++++----- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../igotyou/FactoryMod/eggs/PipeEgg.java | 2 + .../igotyou/FactoryMod/eggs/SorterEgg.java | 2 + .../igotyou/FactoryMod/factories/Factory.java | 31 +-- .../factories/FurnCraftChestFactory.java | 18 -- .../igotyou/FactoryMod/factories/Pipe.java | 30 +-- .../igotyou/FactoryMod/factories/Sorter.java | 35 +-- .../FurnCraftChestInteractionManager.java | 28 +- .../SorterInteractionManager.java | 4 + .../listeners/FactoryModListener.java | 4 - .../structures/BlockFurnaceStructure.java | 4 + .../structures/FurnCraftChestStructure.java | 4 + .../structures/MultiBlockStructure.java | 5 + .../FactoryMod/structures/PipeStructure.java | 7 + .../FactoryMod/utility/FileHandler.java | 241 +++++++++--------- .../FactoryMod/utility/LoggingUtils.java | 2 +- 18 files changed, 296 insertions(+), 296 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index a5f09800..5886498f 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -1,5 +1,7 @@ package com.github.igotyou.FactoryMod; +import org.bukkit.entity.Player; + import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; @@ -7,6 +9,7 @@ import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; +import vg.civcraft.mc.civmenu.guides.ResponseManager; import vg.civcraft.mc.civmodcore.ACivMod; import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; @@ -14,6 +17,7 @@ public class FactoryMod extends ACivMod { private static FactoryModManager manager; private static FactoryMod plugin; private static MenuBuilder mb; + private static ResponseManager rm; public void onEnable() { handle = new FactoryModCommandHandler(); @@ -27,6 +31,9 @@ public void onEnable() { manager.loadFactories(); registerListeners(); FurnCraftChestInteractionManager.prep(); + if (getServer().getPluginManager().isPluginEnabled("CivMenu")) { + rm = ResponseManager.getResponseManager(this); + } new NiceNames().loadNames(); info("Successfully enabled"); } @@ -57,8 +64,17 @@ private void registerListeners() { new CompactItemListener(manager.getCompactLore()), plugin); } - + public static MenuBuilder getMenuBuilder() { return mb; } + + /** + * Sends a CivMenu response + */ + public static void sendResponse(String event, Player p) { + if (rm != null) { + rm.sendMessageForEvent(event, p); + } + } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 5c2b93c1..1d05aab6 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -48,7 +48,8 @@ public class FactoryModManager { public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, - int redstonePowerOn, int redstoneRecipeChange, boolean logInventories) { + int redstonePowerOn, int redstoneRecipeChange, + boolean logInventories) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; @@ -90,7 +91,7 @@ public FactoryModManager(FactoryMod plugin, public void setCompactLore(String lore) { compactLore = lore; } - + public boolean logInventories() { return logInventories; } @@ -129,7 +130,7 @@ public ItemMap getSetupCost(Class c, String name) { */ public void addFactory(Factory f) { factories.add(f); - for (Block b : f.getMultiBlockStructure().getAllBlocks()) { + for (Block b : f.getMultiBlockStructure().getRelevantBlocks()) { locations.put(b.getLocation(), f); } } @@ -218,81 +219,103 @@ public boolean factoryExistsAt(Location loc) { public void attemptCreation(Block b, Player p) { if (!factoryExistsAt(b.getLocation())) { // Cycle through possible structures here - FurnCraftChestStructure fccs = new FurnCraftChestStructure(b); - if (fccs.isComplete()) { - HashMap eggs = factoryCreationRecipes - .get(FurnCraftChestStructure.class); - if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Chest) (fccs - .getChest().getState())).getInventory())); - if (egg != null) { - Factory f = egg.hatch(fccs, p); - if (f != null) { - ((Chest) (fccs.getChest().getState())) - .getInventory().clear(); - addFactory(f); - p.sendMessage(ChatColor.GREEN - + "Successfully created " + f.getName()); + if (b.getType() == Material.WORKBENCH) { + FurnCraftChestStructure fccs = new FurnCraftChestStructure(b); + if (fccs.isComplete()) { + HashMap eggs = factoryCreationRecipes + .get(FurnCraftChestStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs.get(new ItemMap(((Chest) (fccs + .getChest().getState())).getInventory())); + if (egg != null) { + Factory f = egg.hatch(fccs, p); + if (f != null) { + ((Chest) (fccs.getChest().getState())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + FactoryMod.sendResponse("FactoryCreation", p); + } + } else { + p.sendMessage(ChatColor.RED + + "There is no factory with the given creation materials"); + FactoryMod.sendResponse("WrongFactoryCreationItems", p); } - } else { - p.sendMessage(ChatColor.RED - + "There is no factory with the given creation materials"); } + return; + } + else { + FactoryMod.sendResponse("WrongFactoryBlockSetup", p); } - return; } - PipeStructure ps = new PipeStructure(b); - if (ps.isComplete()) { - HashMap eggs = factoryCreationRecipes - .get(PipeStructure.class); - if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Dispenser) (ps - .getStart().getState())).getInventory())); - if (egg != null) { - if (ps.getGlassColor() != ((PipeEgg) egg).getColor()) { + if (b.getType() == Material.DISPENSER) { + PipeStructure ps = new PipeStructure(b); + if (ps.isComplete()) { + HashMap eggs = factoryCreationRecipes + .get(PipeStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs.get(new ItemMap(((Dispenser) (ps + .getStart().getState())).getInventory())); + if (egg != null) { + if (ps.getGlassColor() != ((PipeEgg) egg) + .getColor()) { + p.sendMessage(ChatColor.RED + + "You dont have the right color of glass for this pipe"); + return; + } + Factory f = egg.hatch(ps, p); + if (f != null) { + ((Dispenser) (ps.getStart().getState())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + FactoryMod.sendResponse("PipeCreation", p); + } + + } else { p.sendMessage(ChatColor.RED - + "You dont have the right color of glass for this pipe"); - return; - } - Factory f = egg.hatch(ps, p); - if (f != null) { - ((Dispenser) (ps.getStart().getState())) - .getInventory().clear(); - addFactory(f); - p.sendMessage(ChatColor.GREEN - + "Successfully created " + f.getName()); + + "There is no pipe with the given creation materials"); + FactoryMod.sendResponse("WrongPipeCreationItems", p); } - - } else { - p.sendMessage(ChatColor.RED - + "There is no pipe with the given creation materials"); } + return; + } + else { + FactoryMod.sendResponse("WrongPipeBlockSetup", p); } - return; } - BlockFurnaceStructure bfs = new BlockFurnaceStructure(b); - if (bfs.isComplete()) { - HashMap eggs = factoryCreationRecipes - .get(BlockFurnaceStructure.class); - if (eggs != null) { - IFactoryEgg egg = eggs - .get(new ItemMap(((Dropper) (bfs.getCenter() - .getBlock().getState())).getInventory())); - if (egg != null) { - Factory f = egg.hatch(bfs, p); - if (f != null) { - ((Dropper) (bfs.getCenter().getBlock().getState())) - .getInventory().clear(); - addFactory(f); - p.sendMessage(ChatColor.GREEN - + "Successfully created " + f.getName()); + if (b.getType() == Material.DROPPER) { + BlockFurnaceStructure bfs = new BlockFurnaceStructure(b); + if (bfs.isComplete()) { + HashMap eggs = factoryCreationRecipes + .get(BlockFurnaceStructure.class); + if (eggs != null) { + IFactoryEgg egg = eggs.get(new ItemMap(((Dropper) (bfs + .getCenter().getBlock().getState())) + .getInventory())); + if (egg != null) { + Factory f = egg.hatch(bfs, p); + if (f != null) { + ((Dropper) (bfs.getCenter().getBlock() + .getState())).getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + FactoryMod.sendResponse("SorterCreation", p); + } + + } else { + p.sendMessage(ChatColor.RED + + "There is no sorter with the given creation materials"); + FactoryMod.sendResponse("WrongSorterCreationItems", p); } - - } else { - p.sendMessage(ChatColor.RED - + "There is no sorter with the given creation materials"); } } + else { + FactoryMod.sendResponse("WrongSorterBlockSetup", p); + } } } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 80525c46..360a9444 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -82,7 +82,7 @@ public Factory revive(List blocks, int health, String selectedRecipe, int fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); for (IRecipe recipe : recipes) { - if (recipe.getRecipeName() == selectedRecipe) { + if (recipe.getRecipeName().equals(selectedRecipe)) { fccf.setRecipe(recipe); } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index 2eafb31a..fb04d894 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -82,6 +82,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { Pipe pipe = new Pipe(im, rm, pm, mbs, updateTime, name, transferTimeMultiplier, transferAmount); ((PipeInteractionManager) im).setPipe(pipe); + ((NoRepairDestroyOnBreakManager)rm).setFactory(pipe); return pipe; } @@ -96,6 +97,7 @@ public Factory revive(List blocks, List allowedMaterials, Pipe pipe = new Pipe(im, rm, pm, ps, updateTime, name, transferTimeMultiplier, transferAmount); ((PipeInteractionManager) im).setPipe(pipe); + ((NoRepairDestroyOnBreakManager)rm).setFactory(pipe); pipe.setAllowedMaterials(allowedMaterials); if (runTime != 0) { pipe.attemptToActivate(null); diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index 9de49241..dc807455 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -50,6 +50,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { fuelConsumptionIntervall); Sorter sorter = new Sorter(im, rm, pm, mbs, updateTime, name, sortTime, matsPerSide, sortAmount); + ((NoRepairDestroyOnBreakManager)rm).setFactory(sorter); ((SorterInteractionManager) im).setSorter(sorter); return sorter; } @@ -65,6 +66,7 @@ public Factory revive(List blocks, Sorter sorter = new Sorter(im, rm, pm, ps, updateTime, name, sortTime, matsPerSide, sortAmount); ((SorterInteractionManager) im).setSorter(sorter); + ((NoRepairDestroyOnBreakManager)rm).setFactory(sorter); sorter.setAssignments(assignments); if (runTime != 0) { sorter.attemptToActivate(null); diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 8bce6210..8ca6d3dc 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -116,15 +116,6 @@ public String getName() { */ public abstract void attemptToActivate(Player p); - /** - * Gets all the information needed to recreate this factory at a later - * point. The implementation of this method should be in line with the egg - * of the factory type to ensure persistence past restarts without problems - * - * @return Everything needed to recreate this factory - */ - public abstract String serialize(); - public void scheduleUpdate() { FactoryMod .getPlugin() @@ -135,10 +126,12 @@ public void scheduleUpdate() { } public void turnFurnaceOn(Block f) { + if (f.getType() != Material.FURNACE) { + return; + } Furnace furnace = (Furnace) f.getState(); ItemStack[] oldContents = furnace.getInventory().getContents(); BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); - System.out.println(facing); furnace.getInventory().clear(); f.setType(Material.BURNING_FURNACE); furnace = (Furnace) f.getState(); @@ -155,10 +148,12 @@ public String getLogData() { } public void turnFurnaceOff(Block f) { + if (f.getType() != Material.FURNACE) { + return; + } Furnace furnace = (Furnace) f.getState(); ItemStack[] oldContents = furnace.getInventory().getContents(); BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); - System.out.println(facing); furnace.getInventory().clear(); f.setType(Material.FURNACE); furnace = (Furnace) f.getState(); @@ -168,18 +163,4 @@ public void turnFurnaceOff(Block f) { furnace.update(); furnace.getInventory().setContents(oldContents); } - - public String serializeBlock(Block b) { - StringBuilder sb = new StringBuilder(); - sb.append(separator); - sb.append(b.getWorld().getName()); - sb.append(separator); - sb.append(b.getX()); - sb.append(separator); - sb.append(b.getY()); - sb.append(separator); - sb.append(b.getZ()); - return sb.toString(); - } - } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 79ff9bee..b8261aa8 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -347,22 +347,4 @@ public void upgrade(String name, List recipes, ItemStack fuel, runCount.put(rec, 0); } } - - public String serialize() { - StringBuilder sb = new StringBuilder(); - sb.append("FCC"); - sb.append(separator); - sb.append(getName()); - sb.append(separator); - sb.append(((PercentageHealthRepairManager) rm).getRawHealth()); - sb.append(separator); - sb.append(currentProductionTimer); - sb.append(separator); - sb.append(currentRecipe.getRecipeName()); - for (Block b : mbs.getAllBlocks()) { - sb.append(serializeBlock(b)); - } - return sb.toString(); - } - } diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 9347dfa0..385f9d59 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -35,7 +35,7 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, allowedMaterials = null; runTime = 0; } - + public void attemptToActivate(Player p) { // TODO Citadel stuff LoggingUtils.log((p != null ? p.getName() : "Redstone") @@ -61,8 +61,7 @@ public void attemptToActivate(Player p) { + "No items available to transfer"); } } - } - else { + } else { rm.breakIt(); } } @@ -208,28 +207,7 @@ public void removeAllowedMaterial(Material m) { } } - public String serialize() { - StringBuilder sb = new StringBuilder(); - sb.append("PIPE"); - sb.append(separator); - sb.append(name); - sb.append(separator); - sb.append(runTime); - if (allowedMaterials == null) { - sb.append(separator); - sb.append("NONE"); - } else { - for (Material m : allowedMaterials) { - sb.append(separator); - sb.append(m.toString()); - } - } - sb.append(separator); - sb.append("BLOCKS"); - for (Block b : mbs.getAllBlocks()) { - sb.append(serializeBlock(b)); - } - return sb.toString(); + public int getRunTime() { + return runTime; } - } diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 1c7599e1..f39067fd 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -41,8 +41,6 @@ public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, for (BlockFace bf : MultiBlockStructure.allBlockSides) { assignedMaterials.put(bf, new ItemMap()); } - assignedMaterials.remove(mbs.getCenter().getBlock() - .getFace(((BlockFurnaceStructure) mbs).getFurnace())); } public void attemptToActivate(Player p) { @@ -50,7 +48,6 @@ public void attemptToActivate(Player p) { + "is attempting to activate " + getLogData()); mbs.recheckComplete(); if (mbs.isComplete()) { - activate(); if (pm.powerAvailable()) { if (sortableMaterialsAvailable()) { activate(); @@ -163,7 +160,7 @@ public void sortStack() { ItemMap im = assignedMaterials.get(bf); for (ItemStack is : inv.getContents()) { if (is != null && is.getType() != Material.AIR - && im.getAmount(is) != 0) { + && im != null && im.getAmount(is) != 0) { int removeAmount = Math.min(leftToSort, is.getAmount()); ItemStack rem = is.clone(); rem.setAmount(removeAmount); @@ -207,6 +204,10 @@ public void sortStack() { public void setRunTime(int runtime) { this.runTime = runtime; } + + public int getRunTime() { + return runTime; + } public Inventory getCenterInventory() { return ((InventoryHolder) mbs.getCenter().getBlock().getState()) @@ -232,30 +233,4 @@ private boolean sortableMaterialsAvailable() { public int getMatsPerSide() { return matsPerSide; } - - public String serialize() { - StringBuilder sb = new StringBuilder(); - sb.append("SORTER"); - sb.append(separator); - sb.append(name); - sb.append(separator); - sb.append(runTime); - for (Entry entry : assignedMaterials.entrySet()) { - sb.append(separator); - sb.append(entry.getKey().toString()); - for (ItemStack is : entry.getValue().getItemStackRepresentation()) { - sb.append(separator); - sb.append(is.getType().toString()); - sb.append(separator); - sb.append(is.getDurability()); - } - sb.append(separator); - sb.append("STOP"); - } - for (Block b : mbs.getAllBlocks()) { - sb.append(serializeBlock(b)); - } - return sb.toString(); - } - } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 6b37e75c..4cf229a4 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,7 +1,6 @@ package com.github.igotyou.FactoryMod.interactionManager; import java.util.HashMap; -import java.util.List; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -16,7 +15,6 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; -import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; @@ -55,16 +53,19 @@ public static void prep() { public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { int threshold = FactoryMod.getManager().getRedstonePowerOn(); - if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { + if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold && fccf.isActive()) { - if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e.getBlock()))) { - fccf.deactivate(); + if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock()))) { + fccf.deactivate(); } } else if (e.getOldCurrent() < threshold && e.getNewCurrent() >= threshold && !fccf.isActive()) { - if (rm == null || MultiBlockStructure.citadelRedstoneChecks(e.getBlock())) { - fccf.attemptToActivate(null); + if (rm == null + || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock())) { + fccf.attemptToActivate(null); } } else { return; @@ -74,7 +75,8 @@ public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { public void blockBreak(Player p, Block b) { fccf.getRepairManager().breakIt(); - if (p != null) { + if (p != null && !fccf.getRepairManager().inDisrepair()) { + FactoryMod.sendResponse("FactoryBreak", p); p.sendMessage(ChatColor.DARK_RED + "You broke the factory, it is in disrepair now"); } @@ -172,8 +174,11 @@ public void clicked(Player arg0) { for (IRecipe rec : fccf.getRecipes()) { InputRecipe recipe = (InputRecipe) (rec); ItemStack recStack = recipe.getRecipeRepresentation(); - ISUtils.addLore(recStack, ChatColor.GOLD + "Ran " - + String.valueOf(fccf.getRunCount(recipe)) + " times"); + ISUtils.addLore( + recStack, + ChatColor.GOLD + "Ran " + + String.valueOf(fccf.getRunCount(recipe)) + + " times"); Clickable c = new Clickable(recStack) { @Override @@ -186,6 +191,7 @@ public void clicked(Player p) { p.sendMessage(ChatColor.GREEN + "Switched recipe to " + recipes.get(this).getRecipeName()); + FactoryMod.sendResponse("RecipeSwitch", p); } } @@ -212,8 +218,10 @@ public void clicked(Player arg0) { if (fccf.isActive()) { fccf.deactivate(); p.sendMessage(ChatColor.RED + "Deactivated " + fccf.getName()); + FactoryMod.sendResponse("FactoryActivation", p); } else { fccf.attemptToActivate(p); + FactoryMod.sendResponse("FactoryDeactivation", p); } } } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index fcc0d962..6f2e4228 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -65,6 +65,10 @@ public void leftClick(Player p, Block b, BlockFace bf) { return; } ItemStack is = p.getItemInHand(); + if (is == null) { + return; + //no item in hand + } BlockFace side = sorter.getSide(is); if (side == null) { sorter.addAssignment(bf, is); diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index e6fa8650..a26e3563 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -56,12 +56,8 @@ public void blockBreakEvent(BlockBreakEvent e) { @EventHandler public void redstoneChange(BlockRedstoneEvent e) { if (e.getOldCurrent() == e.getNewCurrent()) { - System.out.println(e.getBlock().getLocation() + " unchanged at " - + e.getOldCurrent()); return; } - System.out.println("Switching " + e.getBlock().getLocation().toString() - + " from " + e.getOldCurrent() + " to " + e.getNewCurrent()); for (BlockFace face : MultiBlockStructure.allBlockSides) { Factory f = manager.getFactoryAt(e.getBlock().getRelative(face)); if (f != null) { diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java index 6c6addb6..93c30837 100644 --- a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -52,5 +52,9 @@ public void recheckComplete() { complete = (center.getType() == Material.DROPPER && (furnace .getType() == Material.FURNACE || furnace.getType() == Material.BURNING_FURNACE)); } + + public List getRelevantBlocks() { + return getAllBlocks(); + } } diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index d219c694..7d56910b 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -97,6 +97,10 @@ public Block getFurnace() { public Block getChest() { return Chest; } + + public List getRelevantBlocks() { + return getAllBlocks(); + } public List getAllBlocks() { LinkedList result = new LinkedList(); diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 10f908c2..275e9c15 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -94,6 +94,11 @@ public static void initializeBlockFaceMap() { * @return center block of the factory which it was created from */ public abstract Location getCenter(); + + /** + * @return All interaction blocks and blocks that are not allowed to be used in two factories at once + */ + public abstract List getRelevantBlocks(); public static List getAdjacentBlocks(Block b) { List blocks = new LinkedList(); diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 267e845f..5226b63d 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -103,6 +103,13 @@ public List getAllBlocks() { res.add(end); return res; } + + public List getRelevantBlocks() { + List res = new LinkedList(); + res.add(start); + res.add(furnace); + return res; + } public void recheckComplete() { if (start == null diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index cc735dbb..e0c3b39a 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -1,21 +1,20 @@ package com.github.igotyou.FactoryMod.utility; -import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.inventory.ItemStack; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -27,6 +26,11 @@ import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.eggs.SorterEgg; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.factories.Pipe; +import com.github.igotyou.FactoryMod.factories.Sorter; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; public class FileHandler { private FactoryMod plugin; @@ -38,9 +42,9 @@ public FileHandler(FactoryModManager manager) { plugin = FactoryMod.getPlugin(); this.manager = manager; saveFile = new File(plugin.getDataFolder().getAbsolutePath() - + File.separator + "factoryData.txt"); + + File.separator + "factoryData.yml"); backup = new File(plugin.getDataFolder().getAbsolutePath() - + File.separator + "factoryDataPreviousSave.txt"); + + File.separator + "factoryDataPreviousSave.yml"); } public void save(Collection factories) { @@ -53,14 +57,50 @@ public void save(Collection factories) { } try { saveFile.createNewFile(); - FileWriter fw = new FileWriter(saveFile); - BufferedWriter buff = new BufferedWriter(fw); + YamlConfiguration config = YamlConfiguration + .loadConfiguration(saveFile); for (Factory f : factories) { - buff.write(f.serialize()); - buff.newLine(); + String current = serializeLocation(f.getMultiBlockStructure() + .getCenter()); + config.set(current + ".name", f.getName()); + config.getConfigurationSection(current).createSection("blocks"); + for (Block b : f.getMultiBlockStructure().getAllBlocks()) { + configureLocation(config.getConfigurationSection(current) + .getConfigurationSection("blocks"), b.getLocation()); + } + if (f instanceof FurnCraftChestFactory) { + FurnCraftChestFactory fccf = (FurnCraftChestFactory) f; + config.set(current + ".type", "FCC"); + config.set(current + ".health", + ((PercentageHealthRepairManager) fccf + .getRepairManager()).getRawHealth()); + config.set(current + ".runtime", fccf.getRunningTime()); + config.set(current + ".selectedRecipe", fccf + .getCurrentRecipe().getRecipeName()); + } else if (f instanceof Pipe) { + Pipe p = (Pipe) f; + config.set(current + ".type", "PIPE"); + config.set(current + ".runtime", p.getRunTime()); + List mats = new LinkedList(); + List materials = p.getAllowedMaterials(); + if (materials != null) { + for (Material m : materials) { + mats.add(m.toString()); + } + } + config.set(current + ".materials", mats); + } else if (f instanceof Sorter) { + Sorter s = (Sorter) f; + config.set(current + ".runtime", s.getRunTime()); + config.set(current + ".type", "SORTER"); + for (BlockFace face : MultiBlockStructure.allBlockSides) { + config.set(current + ".faces." + face.toString(), s + .getItemsForSide(face) + .getItemStackRepresentation().toArray()); + } + } } - buff.flush(); - buff.close(); + config.save(saveFile); } catch (Exception e) { // In case anything goes wrong while saving we always keep the // latest valid backup @@ -70,6 +110,19 @@ public void save(Collection factories) { } } + private void configureLocation(ConfigurationSection config, Location loc) { + String identifier = serializeLocation(loc); + config.set(identifier + ".world", loc.getWorld().getName()); + config.set(identifier + ".x", loc.getBlockX()); + config.set(identifier + ".y", loc.getBlockY()); + config.set(identifier + ".z", loc.getBlockZ()); + } + + private String serializeLocation(Location loc) { + return loc.getWorld().getName() + "#" + loc.getBlockX() + "#" + + loc.getBlockY() + "#" + loc.getBlockZ(); + } + public void load(Map eggs) { if (saveFile.exists()) { loadFromFile(saveFile, eggs); @@ -86,111 +139,71 @@ public void load(Map eggs) { private void loadFromFile(File f, Map eggs) { int counter = 0; - try { - FileReader fr = new FileReader(f); - BufferedReader reader = new BufferedReader(fr); - String line = reader.readLine(); - while (line != null) { - String[] content = line.split("#"); - switch (content[0]) { - case "FCC": - FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs - .get(content[1]); - if (egg == null) { - plugin.warning("Save file contained factory named " - + content[1] - + " , but no factory with this name was found in the config"); - line = reader.readLine(); - continue; - } - int health = Integer.parseInt(content[2]); - int productionTimer = Integer.parseInt(content[3]); - String selectedRecipe = content[4]; - List blocks = new LinkedList(); - for (int i = 5; i < 17; i += 4) { - World w = plugin.getServer().getWorld(content[i]); - int x = Integer.parseInt(content[i + 1]); - int y = Integer.parseInt(content[i + 2]); - int z = Integer.parseInt(content[i + 3]); - blocks.add(new Location(w, x, y, z).getBlock()); - } - Factory fac = egg.revive(blocks, health, selectedRecipe, - productionTimer); - manager.addFactory(fac); - counter++; - break; - case "PIPE": - PipeEgg pipeEgg = (PipeEgg) eggs.get(content[1]); - int runTime = Integer.parseInt(content[2]); - List mats = new LinkedList(); - int i = 3; - for (; i < content.length; i++) { - if (content[i].equals("NONE")) { - mats = null; - i += 2; - break; - } - if (content[i].equals("BLOCKS")) { - i++; - break; - } - Material m = Material.valueOf(content[i]); - mats.add(m); - } - List pipeBlocks = new LinkedList(); - for (; i < content.length; i += 4) { - World w = plugin.getServer().getWorld(content[i]); - int x = Integer.parseInt(content[i + 1]); - int y = Integer.parseInt(content[i + 2]); - int z = Integer.parseInt(content[i + 3]); - pipeBlocks.add(new Location(w, x, y, z).getBlock()); - } - Factory p = pipeEgg.revive(pipeBlocks, mats, runTime); - manager.addFactory(p); - counter++; - break; - case "SORTER": - Map assignments = new HashMap(); - SorterEgg sorterEgg = (SorterEgg) eggs.get(content[1]); - int runTimeSorter = Integer.valueOf(content[2]); - int index = 3; - for (int q = 0; q < 6; q++) { - BlockFace bf = BlockFace.valueOf(content[index++]); - ItemMap im = new ItemMap(); - while(true) { - if (content[index].equals("STOP")) { - index++; - break; - } - else { - Material m = Material.valueOf(content[index]); - int dura = Integer.valueOf(content[index+1]); - im.addItemStack(new ItemStack(m, 1, (short)dura)); - index +=2; - - } - } - assignments.put(bf, im); - } - List sorterBlocks = new LinkedList(); - for (; index < content.length; index += 4) { - World w = plugin.getServer().getWorld(content[index]); - int x = Integer.parseInt(content[index+1]); - int y = Integer.parseInt(content[index + 2]); - int z = Integer.parseInt(content[index + 3]); - sorterBlocks.add(new Location(w, x, y, z).getBlock()); + YamlConfiguration config = YamlConfiguration + .loadConfiguration(saveFile); + for (String key : config.getKeys(false)) { + ConfigurationSection current = config.getConfigurationSection(key); + String type = current.getString("type"); + String name = current.getString("name"); + int runtime = current.getInt("runtime"); + List blocks = new LinkedList(); + for (String blockKey : current.getConfigurationSection("blocks") + .getKeys(false)) { + ConfigurationSection currSec = current.getConfigurationSection( + "blocks").getConfigurationSection(blockKey); + String worldName = currSec.getString("world"); + int x = currSec.getInt("x"); + int y = currSec.getInt("y"); + int z = currSec.getInt("z"); + World w = Bukkit.getWorld(worldName); + blocks.add(new Location(w, x, y, z).getBlock()); + } + switch (type) { + case "FCC": + FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs.get(name); + if (egg == null) { + plugin.warning("Save file contained factory named " + + name + + " , but no factory with this name was found in the config"); + continue; + } + int health = current.getInt("health"); + String selectedRecipe = current.getString("selectedRecipe"); + Factory fac = egg.revive(blocks, health, selectedRecipe, + runtime); + manager.addFactory(fac); + counter++; + break; + case "PIPE": + PipeEgg pipeEgg = (PipeEgg) eggs.get(name); + List mats = new LinkedList(); + if (current.isSet("materials")) { + for (String mat : current.getStringList("materials")) { + mats.add(Material.valueOf(mat)); } - Factory s = sorterEgg.revive(sorterBlocks, assignments, runTimeSorter); - manager.addFactory(s); - counter++; - break; + } else { + mats = null; + } + Factory p = pipeEgg.revive(blocks, mats, runtime); + manager.addFactory(p); + counter++; + break; + case "SORTER": + Map assignments = new HashMap(); + SorterEgg sorterEgg = (SorterEgg) eggs.get(name); + for (String face : current.getConfigurationSection("faces") + .getKeys(false)) { + List stacks = (List) current + .getConfigurationSection("faces").get(face); + // it works, okay? + ItemMap map = new ItemMap(stacks); + assignments.put(BlockFace.valueOf(face), map); } - line = reader.readLine(); + Factory s = sorterEgg.revive(blocks, assignments, runtime); + manager.addFactory(s); + counter++; + break; } - reader.close(); - } catch (Exception e) { - plugin.severe("Fatal error while loading factory data"); - e.printStackTrace(); } plugin.info("Loaded " + counter + " factory from save file"); } diff --git a/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java b/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java index a687aced..4170283a 100644 --- a/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java +++ b/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java @@ -13,7 +13,7 @@ public class LoggingUtils { public static void log(String msg) { - FactoryMod.getPlugin().getLogger().log(Level.FINE, msg); + FactoryMod.getPlugin().getLogger().log(Level.INFO, msg); } private static String serializeInventory(Inventory i) { From 49f719177a1890f065da778f7c49a2cbd5b3923f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 25 Jan 2016 02:35:46 +0100 Subject: [PATCH 207/459] Removing name files which are now in CivModCore and random leftovers --- config.yml | 525 +++++++++++++++++++++++++++++++++++++++++++---- enchantments.csv | 22 -- materials.csv | 430 -------------------------------------- plugin.yml | 3 +- 4 files changed, 487 insertions(+), 493 deletions(-) delete mode 100644 enchantments.csv delete mode 100644 materials.csv diff --git a/config.yml b/config.yml index 69e30e53..ad88977c 100644 --- a/config.yml +++ b/config.yml @@ -1,46 +1,491 @@ #FactoryMod configuration file -citadel_enabled: true -factory_interaction_material: STICK -disable_nether: true -default_update_time: 4 -redstone_power_on: 7 -redstone_recipe_change: 2 +#FactoryMod is a Spigot plugin, which allows players to setup predefined factories for an item cost. There are various +#factories with different purposes and pretty much everything about them is configurable. Their configuration is +#handled within this file. Take great care to ensure that your configurations follow exactly the documentation provided +#here, otherwise unwanted effects/crashes and run time exceptions may occur. + +#---------------------------------------------------------------------------------------------------------------------- + +#Specifying items: + +#Very often in this config you will have to specify items for a configuration. All item specifications are lists of +#configurations, which contain information about the actual item, like this: + +#inputmaterials: +# inputmat1: +# material: STONE +# inputmat345FF: +# material: DIRT + +#Ensure that the identifer (here inputmat1 or inputmat345FF) all have the same intendation and never use duplicate +#identifers on the same level. Duplicate identifers which belong to a different configuration section are a bad habit, +#but should still work, while duplicate identifers on the same level will definitely not lead to the result you desire. +#This applies for every configuration option and not only for items. When you are required to specify a list of items +#you can also just put the option for it there, but not actually any identifers below it to list items and it will +#result in no cost/output. + +#An example item config utilizing all possiblities could look like this: + +#inputmat1: +# material: STONE +# durability: 3 +# amount: 456 +# name: SuperSpecialStone +# lore: +# - First lore line +# - Even more lore +# enchants: +# enchantidentifier1: +# enchant: SILK_TOUCH +# level: 1 +# enchantgharbbl: +# enchant: DAMAGE_ALL +# level: 5 + + +#material requires you to specify the type of the item. Use Spigot's official item identifers here, a full list of those +#can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html + +#durability allows you to specify the durability of the item. Note that this is not only limited to the durability of tools +#or armour, but instead the durability is also used to create different variations of the same material. For example orange +#wool is actually just white wool with a durability of 1. If this option is not specified it will default to 0, which is also +#minecraft's default durability for items. If you don't want to limit an item to a specific durability, but for example want to +#require any type of wool as an input, use -1 as durability. Make sure to only use this for inputs though, if you let a factory +#output an itemstack for players with a durability of -1, the item will be glitched. For a full list of all items and their +#durabilities use this site: http://minecraft-ids.grahamedgecombe.com/ + +#amount allows you to specify the amount of the item, this isn't limited to 64 or whatever the maximum stack size of that +#item is, it can be any number (assuming it fits into an int). If not specfied this option will default to 1 + +#name allows you to define a custom name for this item, if this option is not set the item will have its vanilla name + +#lore allows you to list lore which is added to the item. There is no limit to the lines of lore here, but after too many the +#minecraft client will stop display them properly. Defining lore is completly optional. + +#Finally enchants allows you to list all the enchants wanted on this item, each enchant requires it's own config identifer. + +#The two options requires per enchant are relatively straight forward, first of all you need to specify the enchantment type +#with it's spigot identifer. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html provides a +#full list of those. Second you will need to specify the level you want the desired enchantment to be, this may exceed the +#possibilites of vanilla without causing problems. + +#---------------------------------------------------------------------------------------------------------------------- +#General + +#This section allows you to define global default values and some general stuff. + +#First of all under the crafting option you can disable existing +#vanilla crafting recipes here and enable new custom recipes. + +#An example to disable recipes: + +#crafting: +# disabled: +# firstdisabledidentifer: +# material: TORCH +# crackedStoneBrick: +# material: SMOOTH_BRICK +# durability: 2 + +#Basically you only need to give a list of items here and all their crafting recipes will be disabled + +#To enable new crafting recipes + +#TODO TODO TODO TODO TODO + crafting: disabled: - dirt: - material: DIRT - enabled: - - -recipes: - test1: - type: PRODUCTION - input: - stone: - material: STONE - amount: 64 - output: - cobble: - material: DIRT - amount: 43 - name: TestRecipe1 - production_time: 200 - -factories: - test2: - type: FCC - name: smelter - recipes: - - TestRecipe1 - fuel: - char: - material: COAL - durability: 1 - fuel_consumption_intervall: 10 - setupcost: - dirt: - material: DIRT - amount: 64 + + +#Additionally you can specify default options here, which are applied to all factories which use this option, unless +#you chose to overwrite the default for a specific factory, in that case the option specified in the factories config +#will apply to it. + +#The first option here is default_update_time. The update time describes how often a factory is ticked, ergo how often +#it checks whether it still has enough fuel, enough other resources to run and so on. This is basically the smallest +#time unit within your factory can possibly react and all other time values your factory works with should be multiples +#of this value. If they are not a multiple of this value, their de-facto value will be the next higher multiple of the +#update time, simply because whatever effect they have can only be applied if the factory is actually ticked. Note that +#this value highly influences the performance of this plugin, if FactoryMod is consuming more server power than you want +#it to, the first step should be to make this value higher. Recommended value is 1 second + +default_update_time: 1s + + +#With the option default_fuel you can specify the default fuel for all factories which are consuming fuel in a furnace +#while running. This doesn't have to be a vanilla furnace fuel, but can be any item instead. A factory may chose to over +#write this option + +default_fuel: + charcoal: + material: COAL + durability: 1 + + +#default_fuel_consumption_intervall specifies a default for how often factories consume fuel. Basically every time a +#factory which consumes fuel has run for the time specified here, one fuel unit will be consumed. This value should +#always be a multiple of the updatetime and a factory may chose to specify it's own value and not use the default value + +default_fuel_consumption_intervall: 2s + +#As a debug mode or to prevent additional information when tracking down bugs this plugin can log all of its inventory +#interactions and the full inventories at that point, if desired. If this option is not specified it will default to true + +log_inventories: true + + +#Additionally this plugin can disable vanilla nether portals. This isn't really part of the plugin's core functionality, +#but it was picked up from the first implementation of FactoryMod and stayed here after it's rewrite. Deal with it. +disable_nether: false + + + + +#---------------------------------------------------------------------------------------------------------------------- +#Factories + +#The main part of this plugin's functionality will be defined by this section as it specifies most of the configuration +#for your factories. Under the option factories you will be required to specify each factories configuration, each factory +#needs it's own identifier here, an example could look like this: + +#factories: +# IAmAnIdentifer: +# type: FCC +# name: Stone Smelter +# SoAmI: +# type: PIPE +# name: Pipinator + +#All factories have in common that they require you to define a type and a name. The type must be one of the predefined +#options explained further below to specify the physical appearance and the broad functionality of the factory. +#The name can be any string, which will be used to identify this factory at a later point. There may be many different +#factories of the same type with different names with completly different configurations, but ingame factories with +#the same name are guaranteed to have the same functionality. Because of that NEVER EVER duplicate factory names, not +#even if their type is different. + +#Currently there are three different types of factories: + +#1. FCC + +#FCC is an acronym for FurnaceCraftingTableChest, which is the "classic" factory and what factories used to be in the first +#version of FactoryMod before its rewrite. As you might guess it consist of a crafting table, a furnace and a chest. The +#crafting table has to be in the middle between the furnace and the chest either vertical or horizontal. Those factories +#use an item which is burned in furnace as fuel to execute recipes, which usually use up some sort of item in the chest +#to produce another. A factory can have as many recipes as you want, the details for those are defined further down in the +#config. The identifier used for this type of factory in the config is FCC. An example config to explain every possible +#option for this factory: + +#smelteridentiferbla: +# type: FCC +# name: Smelter +# updatetime: 2s +# fuel: +# fuelidentifier: +# material: COAL +# durability: 1 +# fuel_consumption_intervall: 10s +# setupcost: +# dirt: +# material: DIRT +# amount: 64 +# stone: +# material: STONE +# amount: 64 +# recipes: +# - Smelt iron ore +# - Smelt diamond ore +# - Smelt stone +# - Upgrade smelter + +#type and name work as already described above + +#updatetime decides how often this factory is ticked to check whether it still has all the materials required, fuel etc. +#If this is not specified the default option which was specified above will be used. For more details on this option read +#the explaination next to the default updatetime above + +#fuel specifies which item is used in the furnace to power this factory. You will still need to give the fuel it's own +#sub identifer here, because it's techincally part of a list of items. If this option is not set, the default fuel specified +#above will be used. + +#fuel_consumption_intervall describes how often fuel is consumed if the factory is running with any recipe. If it is not set, +#the default fuel consumption intervall specified above will be used. + +#setupcost are the materials the player will need to create this factory. Two factories may not have the exact same setupcost, +#otherwise there is no way to determine which factory a player actually intended to setup. + +#recipes is the option which defines what this FCC actually does, but you are only supposed to list the names of the +#recipes this factory is meant to run here. The exact functionality of the recipes is defined further below, ensure that the +#names given to the recipes are identical with the ones used here, even the capitalization has to be the same. The same recipe +#may be used by multiple factories or exist in the config without being used by any factory. + + +#Additionally it is also possible to upgrade factories, which turns the factory into a completly different one after a specific +#recipe. To do so, the upgraded version must be added to the list of factories with FCCUPGRADE as the type identifier. Example: + +#upgradedsmelter: +# type: FCCUPGRADE +# name: Upgraded Smelter +# updatetime: 2s +# fuel: +# fuelidentifier: +# material: COAL +# durability: 1 +# fuel_consumption_intervall: 10s +# recipes: +# - Smelt emerald ore + +#As you can see this is pretty much identical to a normal factory aside from the type and the fact that an upgraded factory +#does not specify a setup cost. The actual upgrade cost will be contained in the recipe which is used to upgrade the factory + + +#2. Pipe + +#Pipes allow players to transport items over longer distances. This is meant to replace hopper chains, which can have heavy +#impact on the server performance. The pipes themselves consist of a dropper, which represents the start point of the pipe +#and it's pumper, a furnace to consume fuel while transporting, the actual pipe consisting of stained glass blocks and a target +#block with an inventory. + +#An example config for a pipe: + +#thisIsAPipeIdentifer123: +# type: PIPE +# name: Example Pipe +# updatetime: 2s +# setupcost: +# redstone: +# material: REDSTONE +# amount 64 +# fuel: +# normalcoal: +# material: COAL +# fuel_consumption_intervall: 5s +# transfer_time_multiplier: 1s +# transferamount: 16 +# glass_color: 1 + +#type for all pipes must be PIPE and name a unique identifer, standard stuff + +#update time specifies how often this factory is ticked, see default_update_time for a detailed description of updatetimes +#functionality + +#setupcost are the items required in the dropper when creating this factory + +#fuel specifies the fuel the pipe uses up while transferring, standard as described above + +#fuel_consumption_intervall specifies how often fuel is consumed, again this works exactly as described above + +#transfer_time_multiplier defines how long the pipe takes to transfer one load of items. The total transportation time scales +#directly with the length of the pipe and the value specified here multiplied with the length of the pipe (only counting +#glass blocks) results in the total transportation time per batch. For example if you set this value to one second, a pipe +#which is 10 blocks long will take 10 seconds to transport a batch of items. + +#transferamount is the total amount of items transferred per batch. + +#glass_color is the durability value of the glass this pipe is supposed to have. For a full list see: +#http://minecraft.gamepedia.com/Stained_Glass#Block_data + + +#3. Sorter + +#Sorters allow players to sort item from a single dispenser into different other containers. What gets sorted where is +#completly up to the player, the factory itself only consists of a dispenser and a furnace. The dispenser is the main block of +#the factory which contains the items which will be sorted and the blocks in which will be sorted have to be adjacent to it. +#The furnace simply consumes fuel to power the factory, like it's done for other factories as well. An example config: + +#fkIsGonnaLikeThis: +# type: SORTER +# name: The first sorter +# updatetime: 2s +# fuel: +# normalcoal: +# material: COAL +# fuel_consumption_intervall: 5s +# setupcost: +# redblocks: +# material: REDSTONE_BLOCK +# amount: 64 +# sort_time: 2s +# sort_amount: 32 +# maximum_materials_per_side: 20 + + +# type, name, updatetime, fuel and fuel_consumption_intervall work all exactly as described above + +#setupcost are the material requires when setting up this factory + +#sort_time is the amount of time it takes for the sorter to sort one batch of items, where one batch is the sort amount specified +#in the config. + +#sort_amount is the amount of items that gets sorted per run + +#maximum_materials_per_side is an amount that limits how many items you can assign to a specific side (so the sorter sorts them +#in this direction) + + +#----------------------------------------------------------------------------------------------------------------------------- + +#FCC recipes + +#FCCs have a wide variety of different recipes with different functionality they can run. Those will be listed under the config +#option recipes, like this: + +#recipes: +# smeltstone: +# name: well +# ... +# anotheridentifer: +# name: weg +# ... + +#Every recipe has two configurations values, that always have to be specified, those are name and production_time. + +#name can be any String, but it's not allowed to contain '#', because this is used internally. The name you give your recipe +#here has to be the same you used above to list a factorys recipes, even capitalization has to be the same. + +#production_time is simply how long this recipe takes to complete one run + + +#Now on to the actual recipes: + +#1. Productionrecipe + +#This is the standard recipe; you put in materials, run the factory and get others as an output. + +#An example: + +#identiferABC: +# type: PRODUCTION +# name: Productionrecipeexample +# production_time: 10s +# input: +# item1: +# material: STONE +# output: +# outputstuff: +# material: DIAMOND + + +#The type for recipes works exactly like the one for factories, each recipe has it's own unique identifer that has to be used. +#The one for production recipes is PRODUCTION. + +#input is a list of items that gets consumed when the recipe completes, those items are required to even activate a factory +#with this recipe + +#output is a list of items that will get returned after the the input materials were consumed. + + +#2. Compactionrecipe + +#Compaction allows players to store large amounts of items easily. Whole stacks of items get compacted into single items marked +#with lore and those items are stackable. This means a player can keep up to 4096 items in a single inventory slot! The recipe +#to add the lore and reduce the stack to a single one is this one, the decompation recipe is used to reverse this process. + +#An example: + +#compactIdentifier: +# type: COMPACT +# name: Compact item +# production_time 5s +# input: +# crate: +# material: CHEST +# lore: +# - Crate +# compact_lore: Compacted Item +# excluded_materials: +# - BOOK + + +#type always has to be COMPACT for this type of recipe + +#input specifies the compaction cost, ergo items that are consumed addtionally to the stack which is turned into a single item + +#compact_lore is the lore that will be added to the item to signalized that it's compacted + +#excluded_materials allows you to list materials, which will not be compactable. Per default anything that has a stack size of 1, +#has lore or enchants is not compactable, but if you also want to prevent other items from being compactable, you can do that here. + + +#3. Decompactionrecipe + +#Decompaction allows you to decompact items that were previously compacted. For a description of compaction see the compaction +#recipe. + +#Example: + +#decompactedIdentifier: +# type:DECOMPACT +# name: Decompaction recipe +# production_time: 5s +# input: +# compact_lore: Compact Item + + +#type always has to be DECOMPACT here. + +#input is a list of items that get consumed as decompaction cost + +#compact_lore is the lore that is required on the compacted item. Ensure that the lore here and the one in the compaction recipe +#are the same. + + +#4. Repairrecipe + +#Repair recipes allow repairing their factory. Once a factory is at 0% health, the only recipe that can be run is the repair +#recipe. + +#Example config: + +#hurryItsAboutToBreak: +# type: REPAIR +# name: Repair factory +# production_time: 20s +# input: +# diamonds: +# material: DIAMOND +# amount: 576 +# health_gained: 50 + + +#type always has to be REPAIR for this. + +#Input is as usual a list of items, which will be consumed when the recipe completes. + +#health_gained is the amount of health that will be restored by a successfull run. 100 means fully health here + + +#5. Upgraderecipe + +#Upgrades recipes allow you to upgrade one factory into another to completly change it's recipes and properties + +#Example: + +#upgrading: +# type: UPGRADE +# name: Upgrade to super duper factory +# input: +# diamond: +# material: DIAMOND +# amount: 64 +# factory: upgradedsmelter + +#type always has to be UPGRADE + +#input is again the list of items which are consumed + +#factory is the name of the factory it's supposed to be upgraded to. This factory must have been specified as FCCUPGRADE +#above and the name here and above has to be exactly the same. + + + +#CivMenu configuration + +#This plugin uses CivMenu (https://github.com/civcraft/CivMenu) to display additional information to players. You can specify +#the messages sent to the players here: + +CivMenu: + events: + diff --git a/enchantments.csv b/enchantments.csv deleted file mode 100644 index 13c5bb14..00000000 --- a/enchantments.csv +++ /dev/null @@ -1,22 +0,0 @@ -Power,ARROW_DAMAGE,Bow,,,,,,,,,,, -Flame,ARROW_FIRE,Bow,,,,,,,,,,, -Infinite,ARROW_INFINITE,Bow,,,,,,,,,,, -Arrow Knockback,ARROW_KNOCKBACK,Bow,,,,,,,,,,, -Sharpness,DAMAGE_ALL,Sword,Axe,,,,,,,,,, -Bane of the Anthropods,DAMAGE_ARTHROPODS,Sword,Axe,,,,,,,,,, -Smite,DAMAGE_UNDEAD,Sword,Axe,,,,,,,,,, -Efficiency,DIG_SPEED,Pick,Shovel,Axe,Shears,,,,,,,, -Unbreaking,DURABILITY,Helmet,Chest,Leggings,Boots,Sword,Axe,Bow,Pick,Shovel,Axe,Shears,Hoe -Fire Aspect,FIRE_ASPECT,Sword,Axe,,,,,,,,,, -Knockback,KNOCKBACK,Sword,Axe,,,,,,,,,, -Fortune,LOOT_BONUS_BLOCKS,Pick,Shovel,Axe,,,,,,,,, -Looting,LOOT_BONUS_MOBS,Sword,Axe,,,,,,,,,, -Respiration,OXYGEN,Helmet,,,,,,,,,,, -Protection,PROTECTION_ENVIRONMENTAL,Helmet,Chest,Leggings,Boots,,,,,,,, -Blast Protection,PROTECTION_EXPLOSIONS,Helmet,Chest,Leggings,Boots,,,,,,,, -Feather Falling,PROTECTION_FALL,Boots,,,,,,,,,,, -Fire Protection,PROTECTION_FIRE,Helmet,Chest,Leggings,Boots,,,,,,,, -Projectile Protection,PROTECTION_PROJECTILE,Helmet,Chest,Leggings,Boots,,,,,,,, -Silk Touch,SILK_TOUCH,Pick,Shovel,Axe,Shears,,,,,,,, -Thorns,THORNS,Helmet,Chest,Leggings,Boots,,,,,,,, -Aqua Affinity,WATER_WORKER,Helmet,,,,,,,,,,, diff --git a/materials.csv b/materials.csv deleted file mode 100644 index cc8adc5d..00000000 --- a/materials.csv +++ /dev/null @@ -1,430 +0,0 @@ -Stone,STONE,1,0 -Grass Block,GRASS,2,0 -Dirt,DIRT,3,0 -Grassless Dirt,DIRT,3,1 -Podzol,DIRT,3,2 -Cobblestone,COBBLESTONE,4,0 -Oak Wood Planks,WOOD,5,0 -Spruce Wood Planks,WOOD,5,1 -Birch Wood Planks,WOOD,5,2 -Jungle Wood Planks,WOOD,5,3 -Acacia Wood Planks,WOOD,5,4 -Dark Oak Wood Planks,WOOD,5,5 -Oak Sapling,SAPLING,6,0 -Spruce Sapling,SAPLING,6,1 -Birch Sapling,SAPLING,6,2 -Jungle Sapling,SAPLING,6,3 -Acacia Sapling,SAPLING,6,4 -Dark Oak Sapling,SAPLING,6,5 -Bedrock,BEDROCK,7,0 -Water,WATER,8,0 -Stationary Water,STATIONARY_WATER,9,0 -Lava,LAVA,10,0 -Stationary Lava,STATIONARY_LAVA,11,0 -Sand,SAND,12,0 -Gravel,GRAVEL,13,0 -Gold Ore,GOLD_ORE,14,0 -Iron Ore,IRON_ORE,15,0 -Coal Ore,COAL_ORE,16,0 -Oak Wood,LOG,17,0 -Spruce Wood,LOG,17,1 -Birch Wood,LOG,17,2 -Jungle Wood,LOG,17,3 -Leaves,LEAVES,18,0 -Sponge,SPONGE,19,0 -Glass,GLASS,20,0 -Lapis Ore,LAPIS_ORE,21,0 -Lapis Block,LAPIS_BLOCK,22,0 -Dispenser,DISPENSER,23,0 -Sandstone,SANDSTONE,24,0 -Note Block,NOTE_BLOCK,25,0 -Bed Block,BED_BLOCK,26,0 -Powered Rail,POWERED_RAIL,27,0 -Detector Rail,DETECTOR_RAIL,28,0 -Piston Sticky Base,PISTON_STICKY_BASE,29,0 -Web,WEB,30,0 -Shrub,LONG_GRASS,31,0 -Grass,LONG_GRASS,31,1 -Fern,LONG_GRASS,31,2 -Dead Bush,DEAD_BUSH,32,0 -Piston Base,PISTON_BASE,33,0 -Piston Extension,PISTON_EXTENSION,34,0 -White Wool,WOOL,35,0 -Orange Wool,WOOL,35,1 -Magenta Wool,WOOL,35,2 -Light Blue Wool,WOOL,35,3 -Yellow Wool,WOOL,35,4 -Lime Wool,WOOL,35,5 -Pink Wool,WOOL,35,6 -Gray Wool,WOOL,35,7 -Light Gray Wool,WOOL,35,8 -Cyan Wool,WOOL,35,9 -Purple Wool,WOOL,35,10 -Blue Wool,WOOL,35,11 -Brown Wool,WOOL,35,12 -Green Wool,WOOL,35,13 -Red Wool,WOOL,35,14 -Black Wool,WOOL,35,15 -Piston Moving Piece,PISTON_MOVING_PIECE,36,0 -Dandelion,YELLOW_FLOWER,37,0 -Poppy,RED_ROSE,38,0 -Blue Orchid,RED_ROSE,38,1 -Allium,RED_ROSE,38,2 -Azure Bluet,RED_ROSE,38,3 -Red Tulip,RED_ROSE,38,4 -Orange Tulip,RED_ROSE,38,5 -White Tulip,RED_ROSE,38,6 -Pink Tulip,RED_ROSE,38,7 -Oxeye Daisy,RED_ROSE,38,8 -Brown Mushroom,BROWN_MUSHROOM,39,0 -Red Mushroom,RED_MUSHROOM,40,0 -Gold Block,GOLD_BLOCK,41,0 -Iron Block,IRON_BLOCK,42,0 -Double Stone Slab,DOUBLE_STEP,43,0 -Nether Brick Slab,DOUBLE_STEP,43,6 -Stone Slab,STEP,44,0 -Brick,BRICK,45,0 -TNT,TNT,46,0 -Bookshelf,BOOKSHELF,47,0 -Mossy Cobblestone,MOSSY_COBBLESTONE,48,0 -Obsidian,OBSIDIAN,49,0 -Torch,TORCH,50,0 -Fire,FIRE,51,0 -Mob Spawner,MOB_SPAWNER,52,0 -Wood Stairs,WOOD_STAIRS,53,0 -Chest,CHEST,54,0 -Redstone Wire,REDSTONE_WIRE,55,0 -Diamond Ore,DIAMOND_ORE,56,0 -Diamond Block,DIAMOND_BLOCK,57,0 -Workbench,WORKBENCH,58,0 -Crops,CROPS,59,0 -Soil,SOIL,60,0 -Furnace,FURNACE,61,0 -Burning Furnace,BURNING_FURNACE,62,0 -Sign Post,SIGN_POST,63,0 -Wooden Door,WOODEN_DOOR,64,0 -Ladder,LADDER,65,0 -Rail,RAILS,66,0 -Cobblestone Stairs,COBBLESTONE_STAIRS,67,0 -Wall Sign,WALL_SIGN,68,0 -Lever,LEVER,69,0 -Stone Plate,STONE_PLATE,70,0 -Iron Door Block,IRON_DOOR_BLOCK,71,0 -Wood Plate,WOOD_PLATE,72,0 -Redstone Ore,REDSTONE_ORE,73,0 -Glowing Redstone Ore,GLOWING_REDSTONE_ORE,74,0 -Redstone Torch Off,REDSTONE_TORCH_OFF,75,0 -Redstone Torch On,REDSTONE_TORCH_ON,76,0 -Stone Button,STONE_BUTTON,77,0 -Snow,SNOW,78,0 -Ice,ICE,79,0 -Snow Block,SNOW_BLOCK,80,0 -Cactus,CACTUS,81,0 -Clay,CLAY,82,0 -Sugar Cane Block,SUGAR_CANE_BLOCK,83,0 -Jukebox,JUKEBOX,84,0 -Fence,FENCE,85,0 -Pumpkin,PUMPKIN,86,0 -Netherrack,NETHERRACK,87,0 -Soul Sand,SOUL_SAND,88,0 -Glowstone,GLOWSTONE,89,0 -Portal,PORTAL,90,0 -Jack O Lantern,JACK_O_LANTERN,91,0 -Cake Block,CAKE_BLOCK,92,0 -Diode Block Off,DIODE_BLOCK_OFF,93,0 -Diode Block On,DIODE_BLOCK_ON,94,0 -White Stained Glass,STAINED_GLASS,95,0 -Orange Stained Glass,STAINED_GLASS,95,1 -Magenta Stained Glass,STAINED_GLASS,95,2 -Light Blue Stained Glass,STAINED_GLASS,95,3 -Yellow Stained Glass,STAINED_GLASS,95,4 -Lime Stained Glass,STAINED_GLASS,95,5 -Pink Stained Glass,STAINED_GLASS,95,6 -Gray Stained Glass,STAINED_GLASS,95,7 -Light Gray Stained Glass,STAINED_GLASS,95,8 -Cyan Stained Glass,STAINED_GLASS,95,9 -Purple Stained Glass,STAINED_GLASS,95,10 -Blue Stained Glass,STAINED_GLASS,95,11 -Brown Stained Glass,STAINED_GLASS,95,12 -Green Stained Glass,STAINED_GLASS,95,13 -Red Stained Glass,STAINED_GLASS,95,14 -Black Stained Glass,STAINED_GLASS,95,15 -Trap Door,TRAP_DOOR,96,0 -Monster Eggs,MONSTER_EGGS,97,0 -Stone Brick,SMOOTH_BRICK,98,0 -Mossy Stone Brick,SMOOTH_BRICK,98,1 -Cracked Stone Brick,SMOOTH_BRICK,98,2 -Chiseled Stone Brick,SMOOTH_BRICK,98,3 -Huge Mushroom 1,HUGE_MUSHROOM_1,99,0 -Huge Mushroom 2,HUGE_MUSHROOM_2,100,0 -Iron Fence,IRON_FENCE,101,0 -Thin Glass,THIN_GLASS,102,0 -Melon Block,MELON_BLOCK,103,0 -Pumpkin Stem,PUMPKIN_STEM,104,0 -Melon Stem,MELON_STEM,105,0 -Vine,VINE,106,0 -Fence Gate,FENCE_GATE,107,0 -Brick Stairs,BRICK_STAIRS,108,0 -Smooth Stairs,SMOOTH_STAIRS,109,0 -Mycel,MYCEL,110,0 -Water Lily,WATER_LILY,111,0 -Nether Brick,NETHER_BRICK,112,0 -Nether Fence,NETHER_FENCE,113,0 -Nether Brick Stairs,NETHER_BRICK_STAIRS,114,0 -Nether Wart Block,NETHER_WARTS,115,0 -Enchantment Table,ENCHANTMENT_TABLE,116,0 -Brewing Stand,BREWING_STAND,117,0 -Cauldron,CAULDRON,118,0 -Ender Portal,ENDER_PORTAL,119,0 -Ender Portal Frame,ENDER_PORTAL_FRAME,120,0 -Ender Stone,ENDER_STONE,121,0 -Dragon Egg,DRAGON_EGG,122,0 -Redstone Lamp Off,REDSTONE_LAMP_OFF,123,0 -Redstone Lamp On,REDSTONE_LAMP_ON,124,0 -Wood Double Step,WOOD_DOUBLE_STEP,125,0 -Wood Step,WOOD_STEP,126,0 -Cocoa Stalk,COCOA,127,0 -Sandstone Stairs,SANDSTONE_STAIRS,128,0 -Emerald Ore,EMERALD_ORE,129,0 -Ender Chest,ENDER_CHEST,130,0 -Tripwire Hook,TRIPWIRE_HOOK,131,0 -Tripwire,TRIPWIRE,132,0 -Emerald Block,EMERALD_BLOCK,133,0 -Spruce Wood Stairs,SPRUCE_WOOD_STAIRS,134,0 -Birch Wood Stairs,BIRCH_WOOD_STAIRS,135,0 -Jungle Wood Stairs,JUNGLE_WOOD_STAIRS,136,0 -Command,COMMAND,137,0 -Beacon,BEACON,138,0 -Cobble Wall,COBBLE_WALL,139,0 -Flower Pot,FLOWER_POT,140,0 -Carrot Crop,CARROT,141,0 -Potato Crop,POTATO,142,0 -Wood Button,WOOD_BUTTON,143,0 -Skull,SKULL,144,0 -Anvil,ANVIL,145,0 -Trapped Chest,TRAPPED_CHEST,146,0 -Gold Plate,GOLD_PLATE,147,0 -Iron Plate,IRON_PLATE,148,0 -Redstone Comparator Off,REDSTONE_COMPARATOR_OFF,149,0 -Redstone Comparator On,REDSTONE_COMPARATOR_ON,150,0 -Daylight Detector,DAYLIGHT_DETECTOR,151,0 -Redstone Block,REDSTONE_BLOCK,152,0 -Quartz Ore,QUARTZ_ORE,153,0 -Hopper,HOPPER,154,0 -Quartz Block,QUARTZ_BLOCK,155,0 -Quartz Stairs,QUARTZ_STAIRS,156,0 -Activator Rail,ACTIVATOR_RAIL,157,0 -Dropper,DROPPER,158,0 -White Stained Glass Pane,STAINED_GLASS_PANE,160,0 -Orange Stained Glass Pane,STAINED_GLASS_PANE,160,1 -Magenta Stained Glass Pane,STAINED_GLASS_PANE,160,2 -Light Blue Stained Glass Pane,STAINED_GLASS_PANE,160,3 -Yellow Stained Glass Pane,STAINED_GLASS_PANE,160,4 -Lime Stained Glass Pane,STAINED_GLASS_PANE,160,5 -Pink Stained Glass Pane,STAINED_GLASS_PANE,160,6 -Gray Stained Glass Pane,STAINED_GLASS_PANE,160,7 -Light Gray Stained Glass Pane,STAINED_GLASS_PANE,160,8 -Cyan Stained Glass Pane,STAINED_GLASS_PANE,160,9 -Purple Stained Glass Pane,STAINED_GLASS_PANE,160,10 -Blue Stained Glass Pane,STAINED_GLASS_PANE,160,11 -Brown Stained Glass Pane,STAINED_GLASS_PANE,160,12 -Green Stained Glass Pane,STAINED_GLASS_PANE,160,13 -Red Stained Glass Pane,STAINED_GLASS_PANE,160,14 -Black Stained Glass Pane,STAINED_GLASS_PANE,160,15 -Acacia Wood,LOG_2,162,0 -Dark Oak Wood,LOG_2,162,1 -Packed Ice,PACKED_ICE,174,0 -Iron Spade,IRON_SPADE,256,0 -Iron Pickaxe,IRON_PICKAXE,257,0 -Iron Axe,IRON_AXE,258,0 -Flint And Steel,FLINT_AND_STEEL,259,0 -Apple,APPLE,260,0 -Bow,BOW,261,0 -Arrow,ARROW,262,0 -Coal,COAL,263,0 -Charcoal,COAL,263,1 -Diamond,DIAMOND,264,0 -Iron Ingot,IRON_INGOT,265,0 -Gold Ingot,GOLD_INGOT,266,0 -Iron Sword,IRON_SWORD,267,0 -Wood Sword,WOOD_SWORD,268,0 -Wood Spade,WOOD_SPADE,269,0 -Wood Pickaxe,WOOD_PICKAXE,270,0 -Wood Axe,WOOD_AXE,271,0 -Stone Sword,STONE_SWORD,272,0 -Stone Spade,STONE_SPADE,273,0 -Stone Pickaxe,STONE_PICKAXE,274,0 -Stone Axe,STONE_AXE,275,0 -Diamond Sword,DIAMOND_SWORD,276,0 -Diamond Spade,DIAMOND_SPADE,277,0 -Diamond Pickaxe,DIAMOND_PICKAXE,278,0 -Diamond Axe,DIAMOND_AXE,279,0 -Stick,STICK,280,0 -Bowl,BOWL,281,0 -Mushroom Soup,MUSHROOM_SOUP,282,0 -Gold Sword,GOLD_SWORD,283,0 -Gold Spade,GOLD_SPADE,284,0 -Gold Pickaxe,GOLD_PICKAXE,285,0 -Gold Axe,GOLD_AXE,286,0 -String,STRING,287,0 -Feather,FEATHER,288,0 -Sulphur,SULPHUR,289,0 -Wood Hoe,WOOD_HOE,290,0 -Stone Hoe,STONE_HOE,291,0 -Iron Hoe,IRON_HOE,292,0 -Diamond Hoe,DIAMOND_HOE,293,0 -Gold Hoe,GOLD_HOE,294,0 -Seeds,SEEDS,295,0 -Wheat,WHEAT,296,0 -Bread,BREAD,297,0 -Leather Helmet,LEATHER_HELMET,298,0 -Leather Chestplate,LEATHER_CHESTPLATE,299,0 -Leather Leggings,LEATHER_LEGGINGS,300,0 -Leather Boots,LEATHER_BOOTS,301,0 -Chainmail Helmet,CHAINMAIL_HELMET,302,0 -Chainmail Chestplate,CHAINMAIL_CHESTPLATE,303,0 -Chainmail Leggings,CHAINMAIL_LEGGINGS,304,0 -Chainmail Boots,CHAINMAIL_BOOTS,305,0 -Iron Helmet,IRON_HELMET,306,0 -Iron Chestplate,IRON_CHESTPLATE,307,0 -Iron Leggings,IRON_LEGGINGS,308,0 -Iron Boots,IRON_BOOTS,309,0 -Diamond Helmet,DIAMOND_HELMET,310,0 -Diamond Chestplate,DIAMOND_CHESTPLATE,311,0 -Diamond Leggings,DIAMOND_LEGGINGS,312,0 -Diamond Boots,DIAMOND_BOOTS,313,0 -Gold Helmet,GOLD_HELMET,314,-218 -Gold Chestplate,GOLD_CHESTPLATE,315,-218 -Gold Leggings,GOLD_LEGGINGS,316,-218 -Gold Boots,GOLD_BOOTS,317,-218 -Flint,FLINT,318,0 -Pork,PORK,319,0 -Grilled Pork,GRILLED_PORK,320,0 -Painting,PAINTING,321,0 -Golden Apple,GOLDEN_APPLE,322,0 -Sign,SIGN,323,0 -Wood Door,WOOD_DOOR,324,0 -Bucket,BUCKET,325,0 -Water Bucket,WATER_BUCKET,326,0 -Lava Bucket,LAVA_BUCKET,327,0 -Minecart,MINECART,328,0 -Saddle,SADDLE,329,0 -Iron Door,IRON_DOOR,330,0 -Redstone,REDSTONE,331,0 -Snow Ball,SNOW_BALL,332,0 -Boat,BOAT,333,0 -Leather,LEATHER,334,0 -Milk Bucket,MILK_BUCKET,335,0 -Clay Brick,CLAY_BRICK,336,0 -Clay Ball,CLAY_BALL,337,0 -Sugar Cane,SUGAR_CANE,338,0 -Paper,PAPER,339,0 -Book,BOOK,340,0 -Slime Ball,SLIME_BALL,341,0 -Storage Minecart,STORAGE_MINECART,342,0 -Powered Minecart,POWERED_MINECART,343,0 -Egg,EGG,344,0 -Compass,COMPASS,345,0 -Fishing Rod,FISHING_ROD,346,0 -Watch,WATCH,347,0 -Glowstone Dust,GLOWSTONE_DUST,348,0 -Raw Fish,RAW_FISH,349,0 -Raw Salmon,RAW_FISH,349,1 -Cooked Fish,COOKED_FISH,350,0 -Cooked Salmon,RAW_FISH,350,1 -Ink Sack,INK_SACK,351,0 -Rose Red,INK_SACK,351,1 -Cactus Green,INK_SACK,351,2 -Cocoa,INK_SACK,351,3 -Lapis Lazuli,INK_SACK,351,4 -Purple Dye,INK_SACK,351,5 -Cyan Dye,INK_SACK,351,6 -Light Gray Dye,INK_SACK,351,7 -Gray Dye,INK_SACK,351,8 -Pink Dye,INK_SACK,351,9 -Lime Dye,INK_SACK,351,10 -Dandelion Yellow,INK_SACK,351,11 -Light Blue Dye,INK_SACK,351,12 -Magenta Dye,INK_SACK,351,13 -Orange Dye,INK_SACK,351,14 -Bone Meal,INK_SACK,351,15 -Bone,BONE,352,0 -Sugar,SUGAR,353,0 -Cake,CAKE,354,0 -Bed,BED,355,0 -Diode,DIODE,356,0 -Cookie,COOKIE,357,0 -Map,MAP,358,0 -Shears,SHEARS,359,0 -Melon,MELON,360,0 -Pumpkin Seeds,PUMPKIN_SEEDS,361,0 -Melon Seeds,MELON_SEEDS,362,0 -Raw Beef,RAW_BEEF,363,0 -Cooked Beef,COOKED_BEEF,364,0 -Raw Chicken,RAW_CHICKEN,365,0 -Cooked Chicken,COOKED_CHICKEN,366,0 -Rotten Flesh,ROTTEN_FLESH,367,0 -Ender Pearl,ENDER_PEARL,368,0 -Blaze Rod,BLAZE_ROD,369,0 -Ghast Tear,GHAST_TEAR,370,0 -Gold Nugget,GOLD_NUGGET,371,0 -Nether Wart,NETHER_STALK,372,0 -Clear Potion,POTION,373,7 -Diffuse Potion,POTION,373,11 -Artless Potion,POTION,373,13 -Bungling Potion,POTION,373,23 -Suave Potion,POTION,373,29 -Smooth Potion,POTION,373,91 -Refined Potion,POTION,373,107 -Cordial Potion,POTION,373,109 -Potent Potion,POTION,373,112 -Acrid Potion,POTION,373,123 -Gross Potion,POTION,373,125 -Potion,POTION,373,0 -Glass Bottle,GLASS_BOTTLE,374,0 -Spider Eye,SPIDER_EYE,375,0 -Fermented Spider Eye,FERMENTED_SPIDER_EYE,376,0 -Blaze Powder,BLAZE_POWDER,377,0 -Magma Cream,MAGMA_CREAM,378,0 -Brewing Stand Item,BREWING_STAND_ITEM,379,0 -Cauldron Item,CAULDRON_ITEM,380,0 -Eye Of Ender,EYE_OF_ENDER,381,0 -Speckled Melon,SPECKLED_MELON,382,0 -Monster Egg,MONSTER_EGG,383,0 -Exp Bottle,EXP_BOTTLE,384,0 -Fireball,FIREBALL,385,0 -Book And Quill,BOOK_AND_QUILL,386,0 -Written Book,WRITTEN_BOOK,387,0 -Emerald,EMERALD,388,0 -Item Frame,ITEM_FRAME,389,0 -Flower Pot Item,FLOWER_POT_ITEM,390,0 -Carrot,CARROT_ITEM,391,0 -Potato,POTATO_ITEM,392,0 -Baked Potato,BAKED_POTATO,393,0 -Poisonous Potato,POISONOUS_POTATO,394,0 -Empty Map,EMPTY_MAP,395,0 -Golden Carrot,GOLDEN_CARROT,396,0 -Skull Item,SKULL_ITEM,397,0 -Carrot Stick,CARROT_STICK,398,0 -Nether Star,NETHER_STAR,399,0 -Pumpkin Pie,PUMPKIN_PIE,400,0 -Firework,FIREWORK,401,0 -Firework Charge,FIREWORK_CHARGE,402,0 -Enchanted Book,ENCHANTED_BOOK,403,0 -Redstone Comparator,REDSTONE_COMPARATOR,404,0 -Nether Brick Item,NETHER_BRICK_ITEM,405,0 -Quartz,QUARTZ,406,0 -Explosive Minecart,EXPLOSIVE_MINECART,407,0 -Hopper Minecart,HOPPER_MINECART,408,0 -Gold Record,GOLD_RECORD,2256,0 -Green Record,GREEN_RECORD,2257,0 -Record 3,RECORD_3,2258,0 -Record 4,RECORD_4,2259,0 -Record 5,RECORD_5,2260,0 -Record 6,RECORD_6,2261,0 -Record 7,RECORD_7,2262,0 -Record 8,RECORD_8,2263,0 -Record 9,RECORD_9,2264,0 -Record 10,RECORD_10,2265,0 -Record 11,RECORD_11,2266,0 -Record 12,RECORD_12,2267,0 diff --git a/plugin.yml b/plugin.yml index c16a3917..f52d52bc 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,7 +2,8 @@ name: ${project.name} main: com.github.igotyou.FactoryMod.FactoryMod author: igotyou version: ${project.version} -depend: [NameLayer, Citadel] +depend: [NameLayer, Citadel, CivModCore] +softdepend: [CivMenu] commands: fm: permission: fm.public From 2f327f7aa46bd019c64049081f3dc772b5ce4073 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 25 Jan 2016 02:40:02 +0100 Subject: [PATCH 208/459] Fix pom --- pom.xml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 62e529ff..415495b8 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 com.github.igotyou @@ -33,38 +32,45 @@ org.spigotmc - Spigot1.8.7 - 1.8.7 + spigot-api + 1.8.8-R0.1-SNAPSHOT provided vg.civcraft.mc.namelayer NameLayer - 2.5.13 + 2.5.4 provided vg.civcraft.mc.citadel Citadel - 3.3.9 + 3.4.34 provided vg.civcraft.mc.civmodcore CivModCore - [1.0.8] + 1.1.91 provided + + vg.civcraft.mc + CivMenu + 1.2.2 + provided + + spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ Jenkins-repo http://build.civcraft.co:8080/plugin/repository/everything/ - \ No newline at end of file + From cac9aa943f4b3ddc51967e8ddbad452e963f5c48 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 25 Jan 2016 14:51:02 +0100 Subject: [PATCH 209/459] Ensure that structures cant share blocks --- .../igotyou/FactoryMod/FactoryModManager.java | 33 ++++++++++++++----- .../structures/MultiBlockStructure.java | 27 ++++++++++----- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 1d05aab6..c974d463 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -222,6 +222,11 @@ public void attemptCreation(Block b, Player p) { if (b.getType() == Material.WORKBENCH) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(b); if (fccs.isComplete()) { + if (fccs.blockedByExistingFactory()) { + p.sendMessage(ChatColor.RED + + "At least one of the blocks of this factory is already part of another factory"); + return; + } HashMap eggs = factoryCreationRecipes .get(FurnCraftChestStructure.class); if (eggs != null) { @@ -240,18 +245,23 @@ public void attemptCreation(Block b, Player p) { } else { p.sendMessage(ChatColor.RED + "There is no factory with the given creation materials"); - FactoryMod.sendResponse("WrongFactoryCreationItems", p); + FactoryMod.sendResponse( + "WrongFactoryCreationItems", p); } } return; - } - else { + } else { FactoryMod.sendResponse("WrongFactoryBlockSetup", p); } } if (b.getType() == Material.DISPENSER) { PipeStructure ps = new PipeStructure(b); if (ps.isComplete()) { + if (ps.blockedByExistingFactory()) { + p.sendMessage(ChatColor.RED + + "At least one of the blocks of this factory is already part of another factory"); + return; + } HashMap eggs = factoryCreationRecipes .get(PipeStructure.class); if (eggs != null) { @@ -277,18 +287,23 @@ public void attemptCreation(Block b, Player p) { } else { p.sendMessage(ChatColor.RED + "There is no pipe with the given creation materials"); - FactoryMod.sendResponse("WrongPipeCreationItems", p); + FactoryMod + .sendResponse("WrongPipeCreationItems", p); } } return; - } - else { + } else { FactoryMod.sendResponse("WrongPipeBlockSetup", p); } } if (b.getType() == Material.DROPPER) { BlockFurnaceStructure bfs = new BlockFurnaceStructure(b); if (bfs.isComplete()) { + if (bfs.blockedByExistingFactory()) { + p.sendMessage(ChatColor.RED + + "At least one of the blocks of this factory is already part of another factory"); + return; + } HashMap eggs = factoryCreationRecipes .get(BlockFurnaceStructure.class); if (eggs != null) { @@ -309,11 +324,11 @@ public void attemptCreation(Block b, Player p) { } else { p.sendMessage(ChatColor.RED + "There is no sorter with the given creation materials"); - FactoryMod.sendResponse("WrongSorterCreationItems", p); + FactoryMod.sendResponse("WrongSorterCreationItems", + p); } } - } - else { + } else { FactoryMod.sendResponse("WrongSorterBlockSetup", p); } } diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 275e9c15..dede829d 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -22,9 +22,9 @@ * */ public abstract class MultiBlockStructure { - public static BlockFace[] allBlockSides = new BlockFace[] { - BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, - BlockFace.SOUTH, BlockFace.NORTH }; + public static BlockFace[] allBlockSides = new BlockFace[] { BlockFace.UP, + BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, + BlockFace.NORTH }; public static BlockFace[] northEastWestSouthSides = new BlockFace[] { BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; @@ -94,11 +94,12 @@ public static void initializeBlockFaceMap() { * @return center block of the factory which it was created from */ public abstract Location getCenter(); - + /** - * @return All interaction blocks and blocks that are not allowed to be used in two factories at once + * @return All interaction blocks and blocks that are not allowed to be used + * in two factories at once */ - public abstract List getRelevantBlocks(); + public abstract List getRelevantBlocks(); public static List getAdjacentBlocks(Block b) { List blocks = new LinkedList(); @@ -107,7 +108,7 @@ public static List getAdjacentBlocks(Block b) { } return blocks; } - + /** * Only deals with directly powered redstone interactions, not indirect * power. If all blocks powering this block are on the same group or if the @@ -122,8 +123,7 @@ public static boolean citadelRedstoneChecks(Block here) { ReinforcementManager rm; if (FactoryMod.getManager().isCitadelEnabled()) { rm = Citadel.getReinforcementManager(); - } - else { + } else { return true; } PlayerReinforcement pr = (rm != null) ? (PlayerReinforcement) rm @@ -145,4 +145,13 @@ public static boolean citadelRedstoneChecks(Block here) { return true; } + public boolean blockedByExistingFactory() { + for (Block b : getRelevantBlocks()) { + if (FactoryMod.getManager().factoryExistsAt(b.getLocation())) { + return true; + } + } + return false; + } + } From b55ed65c48b725efdbc3f4f50b67d63d8887845e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 29 Jan 2016 22:39:58 +0100 Subject: [PATCH 210/459] Everything dies if completly destroyed and fixing 2 things the build server compiler didnt like --- .../igotyou/FactoryMod/FactoryModManager.java | 5 +++++ .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 ++ .../DeterministicEnchantingRecipe.java | 3 +-- .../recipes/RandomEnchantingRecipe.java | 2 +- .../NoRepairDestroyOnBreakManager.java | 6 +++--- .../PercentageHealthRepairManager.java | 11 ++++++++++ .../structures/BlockFurnaceStructure.java | 20 ++++++++++++------- .../structures/FurnCraftChestStructure.java | 16 ++++++++++----- .../structures/MultiBlockStructure.java | 8 ++++++++ .../FactoryMod/structures/PipeStructure.java | 10 ++++++++-- 10 files changed, 63 insertions(+), 20 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index c974d463..ded9e993 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -164,6 +164,9 @@ public Material getFactoryInteractionMaterial() { * Factory to remove */ public void removeFactory(Factory f) { + if (f.isActive()) { + f.deactivate(); + } factories.remove(f); for (Block b : f.getMultiBlockStructure().getAllBlocks()) { locations.remove(b.getLocation()); @@ -293,6 +296,7 @@ public void attemptCreation(Block b, Player p) { } return; } else { + p.sendMessage(ChatColor.RED + "This pipe is not set up the right way"); FactoryMod.sendResponse("WrongPipeBlockSetup", p); } } @@ -329,6 +333,7 @@ public void attemptCreation(Block b, Player p) { } } } else { + p.sendMessage(ChatColor.RED + "This sorter is not set up the right way"); FactoryMod.sendResponse("WrongSorterBlockSetup", p); } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 360a9444..c512046b 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -41,6 +41,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); + phrm.setFactory(fccf); if (recipes.size() != 0) { fccf.setRecipe(recipes.get(0)); } @@ -81,6 +82,7 @@ public Factory revive(List blocks, int health, String selectedRecipe, int FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); + phrm.setFactory(fccf); for (IRecipe recipe : recipes) { if (recipe.getRecipeName().equals(selectedRecipe)) { fccf.setRecipe(recipe); diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index df0a2d66..4ecaf230 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -13,7 +13,6 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; @@ -55,7 +54,7 @@ public List getOutputRepresentation(Inventory i) { is, ChatColor.GREEN + "Enough materials for " - + String.valueOf(Integer.max(new ItemMap( + + String.valueOf(Math.max(new ItemMap( new ItemStack(tool)) .getMultiplesContainedIn(i), input .getMultiplesContainedIn(i))) + " runs"); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index b0284edb..2575af10 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -76,7 +76,7 @@ public List getOutputRepresentation(Inventory i) { is, ChatColor.GREEN + "Enough materials for " - + String.valueOf(Integer.max(new ItemMap( + + String.valueOf(Math.max(new ItemMap( new ItemStack(tool)) .getMultiplesContainedIn(i), input .getMultiplesContainedIn(i))) + " runs"); diff --git a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java index 015e3676..05c4896c 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java @@ -1,7 +1,6 @@ package com.github.igotyou.FactoryMod.repairManager; import com.github.igotyou.FactoryMod.FactoryMod; -import com.github.igotyou.FactoryMod.FactoryModManager; import com.github.igotyou.FactoryMod.factories.Factory; public class NoRepairDestroyOnBreakManager implements IRepairManager { @@ -21,8 +20,9 @@ public void setFactory(Factory factory) { } public void breakIt() { - FactoryModManager manager = FactoryMod.getManager(); - manager.removeFactory(factory); + if (factory.getMultiBlockStructure().relevantBlocksDestroyed()) { + FactoryMod.getManager().removeFactory(factory); + } } public boolean atFullHealth() { diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 5b22bbb3..5472599f 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -1,7 +1,11 @@ package com.github.igotyou.FactoryMod.repairManager; +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.factories.Factory; + public class PercentageHealthRepairManager implements IRepairManager { private int health; + private Factory factory; public PercentageHealthRepairManager(int initialHealth) { health = initialHealth; @@ -14,6 +18,10 @@ public boolean atFullHealth() { public boolean inDisrepair() { return health <= 0; } + + public void setFactory(Factory factory) { + this.factory = factory; + } public String getHealth() { return String.valueOf(health) + " %"; @@ -25,6 +33,9 @@ public void repair(int amount) { public void breakIt() { health = 0; + if (factory.getMultiBlockStructure().relevantBlocksDestroyed()) { + FactoryMod.getManager().removeFactory(factory); + } } public int getRawHealth() { diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java index 93c30837..dde82d2d 100644 --- a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -23,16 +23,22 @@ public BlockFurnaceStructure(Block center) { } } } - - public BlockFurnaceStructure(List blocks) { + + public BlockFurnaceStructure(List blocks) { this.center = blocks.get(0); this.furnace = blocks.get(1); } + public boolean relevantBlocksDestroyed() { + return center.getType() != Material.DROPPER + && furnace.getType() != Material.FURNACE + && furnace.getType() != Material.BURNING_FURNACE; + } + public Location getCenter() { return center.getLocation(); } - + public Block getFurnace() { return furnace; } @@ -49,11 +55,11 @@ public boolean isComplete() { } public void recheckComplete() { - complete = (center.getType() == Material.DROPPER && (furnace - .getType() == Material.FURNACE || furnace.getType() == Material.BURNING_FURNACE)); + complete = (center.getType() == Material.DROPPER && (furnace.getType() == Material.FURNACE || furnace + .getType() == Material.BURNING_FURNACE)); } - - public List getRelevantBlocks() { + + public List getRelevantBlocks() { return getAllBlocks(); } diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index 7d56910b..ed0ac4c9 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -62,12 +62,11 @@ public FurnCraftChestStructure(Block center) { } if (Chest != null && Furnace != null) { complete = true; - } - else { + } else { complete = false; } } - + public void recheckComplete() { complete = CraftingTable != null && CraftingTable.getType() == Material.WORKBENCH @@ -97,8 +96,15 @@ public Block getFurnace() { public Block getChest() { return Chest; } - - public List getRelevantBlocks() { + + public boolean relevantBlocksDestroyed() { + return CraftingTable.getType() != Material.WORKBENCH + && Furnace.getType() != Material.FURNACE + && Furnace.getType() != Material.BURNING_FURNACE + && Chest.getType() != Material.CHEST; + } + + public List getRelevantBlocks() { return getAllBlocks(); } diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index dede829d..9dc4b5b3 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -154,4 +154,12 @@ public boolean blockedByExistingFactory() { return false; } + /** + * Checks whether all relevant/interaction blocks of this factory were + * completly destroyed/replaced by other blocks + * + * @return True if the structure is completly destroyed, false if not + */ + public abstract boolean relevantBlocksDestroyed(); + } diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 5226b63d..618f214c 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -95,6 +95,12 @@ public Location getCenter() { return start.getLocation(); } + public boolean relevantBlocksDestroyed() { + return start.getType() != Material.DISPENSER + && furnace.getType() != Material.FURNACE + && furnace.getType() != Material.BURNING_FURNACE; + } + public List getAllBlocks() { List res = new LinkedList(); res.add(start); @@ -103,8 +109,8 @@ public List getAllBlocks() { res.add(end); return res; } - - public List getRelevantBlocks() { + + public List getRelevantBlocks() { List res = new LinkedList(); res.add(start); res.add(furnace); From bccc9509f26dad2ba2f1a16efd21e7cac327599a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 29 Jan 2016 22:42:33 +0100 Subject: [PATCH 211/459] Add config docu for civmenu events --- config.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 2c8ca705..6d603285 100644 --- a/config.yml +++ b/config.yml @@ -484,8 +484,38 @@ disable_nether: false #CivMenu configuration #This plugin uses CivMenu (https://github.com/civcraft/CivMenu) to display additional information to players. You can specify -#the messages sent to the players here: +#the messages sent to the players here. Note that for all those events a short message to sum it up will already be displayed, +#this is only meant to provide messages to teach the game mechanic as a whole. CivMenu: events: + #Called when a FCC factory is successfully created + FactoryCreation: + + #Called when a player attempt to create a FCC factory with invalid materials + WrongFactoryCreationItems: + + #Called when a player attempts to create a FCC factory with a wrong block setup + WrongFactoryBlockSetup: + + #Called when a pipe is successfully created + PipeCreation: + + #Called when a player attempt to create a pipe with invalid materials + WrongPipeCreationItems: + + #Called when a player attempts to create a pipe with a wrong block setup + WrongPipeBlockSetup: + + #Called when a sorter is successfully created + SorterCreation: + + #Called when a player attempt to create a sorter with invalid materials + WrongSorterCreationItems: + + #Called when a player attempts to create a sorter with a wrong block setup + WrongSorterBlockSetup: + + + \ No newline at end of file From b1edfdb70ba898d1e50a884db98d1bd6a9be8396 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 30 Jan 2016 23:07:23 +0100 Subject: [PATCH 212/459] Let structures use coords instead of block reference and add Citadel support for factory interaction --- config.yml | 3 + .../igotyou/FactoryMod/ConfigParser.java | 36 ++++++-- .../igotyou/FactoryMod/FactoryModManager.java | 64 +++++++++++++- .../FactoryMod/eggs/FurnCraftChestEgg.java | 30 +++++-- .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 17 ++++ .../igotyou/FactoryMod/eggs/PipeEgg.java | 15 +++- .../igotyou/FactoryMod/eggs/SorterEgg.java | 22 +++-- .../factories/FurnCraftChestFactory.java | 3 +- .../FurnCraftChestInteractionManager.java | 15 +++- .../PipeInteractionManager.java | 11 +++ .../SorterInteractionManager.java | 11 +++ .../listeners/FactoryModListener.java | 6 +- .../NoRepairDestroyOnBreakManager.java | 25 +++++- .../PercentageHealthRepairManager.java | 57 +++++++++++-- .../structures/BlockFurnaceStructure.java | 32 +++---- .../structures/FurnCraftChestStructure.java | 84 ++++++++++--------- .../structures/MultiBlockStructure.java | 2 +- .../FactoryMod/structures/PipeStructure.java | 61 +++++++------- .../FactoryMod/utility/FileHandler.java | 8 +- 19 files changed, 370 insertions(+), 132 deletions(-) diff --git a/config.yml b/config.yml index 6d603285..bd2b3512 100644 --- a/config.yml +++ b/config.yml @@ -516,6 +516,9 @@ CivMenu: #Called when a player attempts to create a sorter with a wrong block setup WrongSorterBlockSetup: + #Called when someone attempts to interact with any type of factory, but doesnt have the correct permissions + FactoryNoPermission: + \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 8c8cec0f..b2e45084 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -43,6 +43,7 @@ public class ConfigParser { private int defaultUpdateTime; private ItemStack defaultFuel; private int defaultFuelConsumptionTime; + private double defaultReturnRate; private HashMap upgradeEggs; private HashMap> recipeLists; @@ -62,7 +63,7 @@ public FactoryModManager parse() { FileConfiguration config = plugin.getConfig(); boolean citadelEnabled = plugin.getServer().getPluginManager() .isPluginEnabled("Citadel"); - boolean logInventories = config.getBoolean("log_inventories",true); + boolean logInventories = config.getBoolean("log_inventories", true); Material factoryInteractionMaterial = Material.getMaterial(config .getString("factory_interaction_material", "STICK")); boolean disableNether = config.getBoolean("disable_nether", false); @@ -77,10 +78,12 @@ public FactoryModManager parse() { .getItemStackRepresentation().get(0); defaultFuelConsumptionTime = (int) parseTime(config.getString( "default_fuel_consumption_intervall", "20")); + defaultReturnRate = config.getDouble("default_return_rate", 0.0); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); manager = new FactoryModManager(plugin, factoryInteractionMaterial, - citadelEnabled, redstonePowerOn, redstoneRecipeChange, logInventories); + citadelEnabled, redstonePowerOn, redstoneRecipeChange, + logInventories); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); upgradeEggs = new HashMap(); @@ -88,6 +91,7 @@ public FactoryModManager parse() { parseFactories(config.getConfigurationSection("factories")); parseRecipes(config.getConfigurationSection("recipes")); assignRecipesToFactories(); + manager.calculateTotalSetupCosts(); // Some recipes need references to factories and all factories need // references to recipes, so we parse all factories first, set their // recipes to null, store the names of the recipes in a map here, parse @@ -147,6 +151,7 @@ private void parseFactory(ConfigurationSection config) { egg = parseFCCFactory(config); ItemMap setupCost = parseItemMap(config .getConfigurationSection("setupcost")); + System.out.println(setupCost.toString()); manager.addFactoryCreationEgg(FurnCraftChestStructure.class, setupCost, egg); break; @@ -179,6 +184,12 @@ private void parseFactory(ConfigurationSection config) { public SorterEgg parseSorter(ConfigurationSection config) { String name = config.getString("name"); + double returnRate; + if (config.contains("return_rate")) { + returnRate = config.getDouble("return_rate"); + } else { + returnRate = defaultReturnRate; + } int update; if (config.contains("updatetime")) { update = (int) parseTime(config.getString("updatetime")); @@ -203,11 +214,17 @@ public SorterEgg parseSorter(ConfigurationSection config) { int sortamount = config.getInt("sort_amount"); int matsPerSide = config.getInt("maximum_materials_per_side"); return new SorterEgg(name, update, fuel, fuelIntervall, sortTime, - matsPerSide, sortamount); + matsPerSide, sortamount, returnRate); } public PipeEgg parsePipe(ConfigurationSection config) { String name = config.getString("name"); + double returnRate; + if (config.contains("return_rate")) { + returnRate = config.getDouble("return_rate"); + } else { + returnRate = defaultReturnRate; + } int update; if (config.contains("updatetime")) { update = (int) parseTime(config.getString("updatetime")); @@ -233,11 +250,17 @@ public PipeEgg parsePipe(ConfigurationSection config) { int transferAmount = config.getInt("transferamount"); byte color = (byte) config.getInt("glass_color"); return new PipeEgg(name, update, fuel, fuelIntervall, null, - transferTimeMultiplier, transferAmount, color); + transferTimeMultiplier, transferAmount, color, returnRate); } public IFactoryEgg parseFCCFactory(ConfigurationSection config) { String name = config.getString("name"); + double returnRate; + if (config.contains("return_rate")) { + returnRate = config.getDouble("return_rate"); + } else { + returnRate = defaultReturnRate; + } int update; if (config.contains("updatetime")) { update = (int) parseTime(config.getString("updatetime")); @@ -259,7 +282,7 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { fuelIntervall = defaultFuelConsumptionTime; } FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, null, fuel, - fuelIntervall); + fuelIntervall, returnRate); recipeLists.put(egg, config.getStringList("recipes")); return egg; } @@ -363,7 +386,8 @@ private IRecipe parseRecipe(ConfigurationSection config) { .getItemStackRepresentation().get(0); int repPerEssence = config.getInt("repair_per_essence"); int range = config.getInt("range"); - result = new AOERepairRecipe(name, productionTime, essence, range, repPerEssence); + result = new AOERepairRecipe(name, productionTime, essence, range, + repPerEssence); break; default: plugin.severe("Could not identify type " + config.getString("type") diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index ded9e993..3d278473 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -17,14 +17,18 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.FileHandler; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; /** * Manager class which handles all factories, their locations and their creation @@ -34,6 +38,7 @@ public class FactoryModManager { protected FactoryMod plugin; private FileHandler fileHandler; private HashMap, HashMap> factoryCreationRecipes; + private HashMap totalSetupCosts; private HashMap locations; private HashMap eggs; private HashSet factories; @@ -64,6 +69,7 @@ public FactoryModManager(FactoryMod plugin, possibleCenterBlocks = new HashSet(); possibleInteractionBlock = new HashSet(); factories = new HashSet(); + totalSetupCosts = new HashMap(); // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); @@ -168,8 +174,8 @@ public void removeFactory(Factory f) { f.deactivate(); } factories.remove(f); - for (Block b : f.getMultiBlockStructure().getAllBlocks()) { - locations.remove(b.getLocation()); + for (Location b : f.getMultiBlockStructure().getAllBlocks()) { + locations.remove(b); } } @@ -243,6 +249,7 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); FactoryMod.sendResponse("FactoryCreation", p); } } else { @@ -284,6 +291,7 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); FactoryMod.sendResponse("PipeCreation", p); } @@ -296,7 +304,8 @@ public void attemptCreation(Block b, Player p) { } return; } else { - p.sendMessage(ChatColor.RED + "This pipe is not set up the right way"); + p.sendMessage(ChatColor.RED + + "This pipe is not set up the right way"); FactoryMod.sendResponse("WrongPipeBlockSetup", p); } } @@ -322,6 +331,7 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); FactoryMod.sendResponse("SorterCreation", p); } @@ -333,13 +343,51 @@ public void attemptCreation(Block b, Player p) { } } } else { - p.sendMessage(ChatColor.RED + "This sorter is not set up the right way"); + p.sendMessage(ChatColor.RED + + "This sorter is not set up the right way"); FactoryMod.sendResponse("WrongSorterBlockSetup", p); } } } } + public void calculateTotalSetupCosts() { + for (HashMap maps : factoryCreationRecipes + .values()) { + for (Entry entry : maps.entrySet()) { + totalSetupCosts.put(entry.getValue(), entry.getKey()); + } + } + for (IFactoryEgg egg : getAllEggs().values()) { + totalSetupCosts.put(egg, calculateTotalSetupCost(egg)); + } + } + + private ItemMap calculateTotalSetupCost(IFactoryEgg egg) { + ItemMap map = null; + map = totalSetupCosts.get(egg); + if (map != null) { + return map; + } + for (IFactoryEgg superEgg : getAllEggs().values()) { + if (superEgg instanceof FurnCraftChestEgg) { + for (IRecipe recipe : ((FurnCraftChestEgg) superEgg) + .getRecipes()) { + if (recipe instanceof Upgraderecipe + && ((Upgraderecipe) recipe).getEgg() == egg) { + map = calculateTotalSetupCost(superEgg); + map = map.clone(); // so we dont mess with the original + // setup costs + map.merge(((Upgraderecipe) recipe).getInput()); + return map; + } + } + + } + } + return map; + } + /** * Gets all the factories within a certain range of a given location * @@ -360,6 +408,14 @@ public List getNearbyFactories(Location l, int range) { return facs; } + public ItemMap getTotalSetupCost(Factory f) { + return getTotalSetupCost(getEgg(f.getName())); + } + + public ItemMap getTotalSetupCost(IFactoryEgg e) { + return totalSetupCosts.get(e); + } + /** * Adds a factory egg to the manager and associates it with a specific setup * cost in items and a specific MultiBlockStructure which is the physical diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index c512046b..052c6d02 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -2,7 +2,7 @@ import java.util.List; -import org.bukkit.block.Block; +import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -21,20 +21,23 @@ public class FurnCraftChestEgg implements IFactoryEgg { private List recipes; private ItemStack fuel; private int fuelConsumptionIntervall; + private double returnRateOnDestruction; public FurnCraftChestEgg(String name, int updateTime, - List recipes, ItemStack fuel, int fuelConsumptionIntervall) { + List recipes, ItemStack fuel, + int fuelConsumptionIntervall, double returnRateOnDestruction) { this.name = name; this.updateTime = updateTime; this.recipes = recipes; this.fuel = fuel; this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.returnRateOnDestruction = returnRateOnDestruction; } public Factory hatch(MultiBlockStructure mbs, Player p) { FurnCraftChestStructure fccs = (FurnCraftChestStructure) mbs; - FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, - fuelConsumptionIntervall); + FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), + fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( 100); @@ -63,19 +66,24 @@ public ItemStack getFuel() { public List getRecipes() { return recipes; } - - public void setRecipes(List recipes) { + + public void setRecipes(List recipes) { this.recipes = recipes; } + + public double getReturnRate() { + return returnRateOnDestruction; + } public int getFuelConsumptionIntervall() { return fuelConsumptionIntervall; } - public Factory revive(List blocks, int health, String selectedRecipe, int productionTimer) { + public Factory revive(List blocks, int health, + String selectedRecipe, int productionTimer) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); - FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, - fuelConsumptionIntervall); + FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), + fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( health); @@ -99,5 +107,9 @@ public Factory revive(List blocks, int health, String selectedRecipe, int } return fccf; } + + public Class getMultiBlockStructure() { + return FurnCraftChestStructure.class; + } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index 053be766..39184ccd 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -37,6 +37,23 @@ public interface IFactoryEgg { */ public String getName(); + /** + * When destroyed completly a factory may return a part of it's setup cost. + * This value specifies how much of the setup cost is returned (as a + * multiplier) + * + * @return Multiplier of the setupcost which is returned upon destruction + */ + public double getReturnRate(); + + /** + * All the factories created by a specific egg will be represented through a + * specific MultiBlockStructure and this is the getter for it + * + * @return Structure class of the factories created by this egg + */ + public Class getMultiBlockStructure(); + /** * Java wont let me specify a method here without specifying its parameters * so it's commented out, because parameters may vary for each diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index fb04d894..4981b903 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -2,8 +2,8 @@ import java.util.List; +import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -27,10 +27,11 @@ public class PipeEgg implements IFactoryEgg { private int transferTimeMultiplier; private int transferAmount; private byte color; + double returnRate; public PipeEgg(String name, int updateTime, ItemStack fuel, int fuelConsumptionIntervall, List allowedMaterials, - int transferTimeMultiplier, int transferAmount, byte color) { + int transferTimeMultiplier, int transferAmount, byte color, double returnRate) { this.name = name; this.fuel = fuel; this.updateTime = updateTime; @@ -39,6 +40,7 @@ public PipeEgg(String name, int updateTime, ItemStack fuel, this.transferAmount = transferAmount; this.allowedMaterials = allowedMaterials; this.color = color; + this.returnRate = returnRate; } public String getName() { @@ -60,6 +62,10 @@ public ItemStack getFuel() { public List getAllowedMaterials() { return allowedMaterials; } + + public double getReturnRate() { + return returnRate; + } public int getTransferAmount() { return transferAmount; @@ -86,7 +92,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { return pipe; } - public Factory revive(List blocks, List allowedMaterials, + public Factory revive(List blocks, List allowedMaterials, int runTime) { MultiBlockStructure ps = new PipeStructure(blocks); PipeInteractionManager im = new PipeInteractionManager(); @@ -108,4 +114,7 @@ public Factory revive(List blocks, List allowedMaterials, return pipe; } + public Class getMultiBlockStructure() { + return PipeStructure.class; + } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index dc807455..6f77e3ee 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.Map; -import org.bukkit.block.Block; +import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -29,16 +29,18 @@ public class SorterEgg implements IFactoryEgg { private int sortTime; private int matsPerSide; private int sortAmount; + private double returnRate; public SorterEgg(String name, int updateTime, ItemStack fuel, int fuelConsumptionIntervall, int sortTime, int matsPerSide, - int sortAmount) { + int sortAmount, double returnRate) { this.name = name; this.fuel = fuel; this.updateTime = updateTime; this.fuelConsumptionIntervall = fuelConsumptionIntervall; this.sortTime = sortTime; this.sortAmount = sortAmount; + this.returnRate = returnRate; this.matsPerSide = matsPerSide; } @@ -50,12 +52,12 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { fuelConsumptionIntervall); Sorter sorter = new Sorter(im, rm, pm, mbs, updateTime, name, sortTime, matsPerSide, sortAmount); - ((NoRepairDestroyOnBreakManager)rm).setFactory(sorter); + ((NoRepairDestroyOnBreakManager) rm).setFactory(sorter); ((SorterInteractionManager) im).setSorter(sorter); return sorter; } - public Factory revive(List blocks, + public Factory revive(List blocks, Map assignments, int runTime) { MultiBlockStructure ps = new BlockFurnaceStructure(blocks); SorterInteractionManager im = new SorterInteractionManager(); @@ -66,7 +68,7 @@ public Factory revive(List blocks, Sorter sorter = new Sorter(im, rm, pm, ps, updateTime, name, sortTime, matsPerSide, sortAmount); ((SorterInteractionManager) im).setSorter(sorter); - ((NoRepairDestroyOnBreakManager)rm).setFactory(sorter); + ((NoRepairDestroyOnBreakManager) rm).setFactory(sorter); sorter.setAssignments(assignments); if (runTime != 0) { sorter.attemptToActivate(null); @@ -89,6 +91,10 @@ public ItemStack getFuel() { return fuel; } + public double getReturnRate() { + return returnRate; + } + public int getFuelConsumptionIntervall() { return fuelConsumptionIntervall; } @@ -100,9 +106,13 @@ public int getSortTime() { public int getMaterialsPerSide() { return matsPerSide; } - + public int getSortAmount() { return sortAmount; } + public Class getMultiBlockStructure() { + return BlockFurnaceStructure.class; + } + } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index b8261aa8..87ae20f4 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -93,7 +93,7 @@ public FurnaceInventory getFurnaceInventory() { */ public void attemptToActivate(Player p) { LoggingUtils.log((p != null ? p.getName() : "Redstone") - + "is attempting to activate " + getLogData()); + + " is attempting to activate " + getLogData()); // TODO Citadel stuff mbs.recheckComplete(); @@ -331,6 +331,7 @@ public boolean hasInputMaterials() { public void upgrade(String name, List recipes, ItemStack fuel, int fuelConsumptionIntervall, int updateTime) { + deactivate(); this.name = name; this.recipes = recipes; this.updateTime = updateTime; diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 4cf229a4..24d9f8f4 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -15,6 +15,8 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; +import vg.civcraft.mc.citadel.reinforcement.Reinforcement; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; @@ -74,15 +76,15 @@ public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { } public void blockBreak(Player p, Block b) { - fccf.getRepairManager().breakIt(); if (p != null && !fccf.getRepairManager().inDisrepair()) { - FactoryMod.sendResponse("FactoryBreak", p); p.sendMessage(ChatColor.DARK_RED + "You broke the factory, it is in disrepair now"); + FactoryMod.sendResponse("FactoryBreak", p); } if (fccf.isActive()) { fccf.deactivate(); } + fccf.getRepairManager().breakIt(); } public void leftClick(Player p, Block b, BlockFace bf) { @@ -90,6 +92,15 @@ public void leftClick(Player p, Block b, BlockFace bf) { .getFactoryInteractionMaterial()) { return; } + if(FactoryMod.getManager().isCitadelEnabled()) { + //is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); + if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } + } if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getChest())) { // chest interaction if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index 653871e7..10060ab3 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -12,6 +12,7 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; @@ -41,6 +42,16 @@ public void rightClick(Player p, Block b, BlockFace bf) { public void leftClick(Player p, Block b, BlockFace bf) { ItemStack hand = p.getItemInHand(); + if(FactoryMod.getManager().isCitadelEnabled()) { + ReinforcementManager rm = Citadel.getReinforcementManager(); + //is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); + if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } + } if (b.equals(((PipeStructure) (pipe.getMultiBlockStructure())) .getStart())) { if (hand.getType() == manager.getFactoryInteractionMaterial()) { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index 6f2e4228..e96cb3e9 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -9,6 +9,7 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; import com.github.igotyou.FactoryMod.FactoryMod; @@ -48,6 +49,16 @@ public void rightClick(Player p, Block b, BlockFace bf) { } public void leftClick(Player p, Block b, BlockFace bf) { + if(FactoryMod.getManager().isCitadelEnabled()) { + ReinforcementManager rm = Citadel.getReinforcementManager(); + //is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); + if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } + } if (b.equals(bfs.getFurnace())) { if (p.getItemInHand() .getType() diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index a26e3563..81d4a3b9 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -41,7 +41,7 @@ public FactoryModListener(FactoryModManager manager) { * Called when a block is broken If the block that is destroyed is part of a * factory, call the required methods. */ - @EventHandler (ignoreCancelled = true, priority = EventPriority.MONITOR) + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) public void blockBreakEvent(BlockBreakEvent e) { Block block = e.getBlock(); if (manager.isPossibleInteractionBlock(block.getType())) { @@ -114,6 +114,7 @@ public void playerInteract(PlayerInteractEvent e) { if (c != null) { c.getInteractionManager().rightClick(player, block, bf); } else { + // check if chest is other half of double chest if (block.getType() == Material.CHEST) { for (Block b : MultiBlockStructure .searchForBlockOnSides(block, Material.CHEST)) { @@ -134,6 +135,7 @@ public void playerInteract(PlayerInteractEvent e) { manager.attemptCreation(block, player); } } else { + // check if chest is other half of double chest if (block.getType() == Material.CHEST) { for (Block b : MultiBlockStructure .searchForBlockOnSides(block, @@ -153,7 +155,7 @@ public void playerInteract(PlayerInteractEvent e) { } } } - + @EventHandler public void blockDispenser(BlockDispenseEvent e) { if (manager.getFactoryAt(e.getBlock()) != null) { diff --git a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java index 05c4896c..19f9bb2f 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java @@ -2,6 +2,7 @@ import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class NoRepairDestroyOnBreakManager implements IRepairManager { private Factory factory; @@ -20,9 +21,27 @@ public void setFactory(Factory factory) { } public void breakIt() { - if (factory.getMultiBlockStructure().relevantBlocksDestroyed()) { - FactoryMod.getManager().removeFactory(factory); - } + FactoryMod + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), + new Runnable() { + + @Override + public void run() { + if (factory.getMultiBlockStructure() + .relevantBlocksDestroyed()) { + LoggingUtils.log(factory.getLogData() + + " removed because blocks were destroyed"); + FactoryMod.getManager().removeFactory( + factory); + PercentageHealthRepairManager + .returnStuff(factory); + } + + } + }); } public boolean atFullHealth() { diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 5472599f..403d08e2 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -1,7 +1,14 @@ package com.github.igotyou.FactoryMod.repairManager; +import java.util.Map.Entry; + +import org.bukkit.inventory.ItemStack; + +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class PercentageHealthRepairManager implements IRepairManager { private int health; @@ -18,7 +25,7 @@ public boolean atFullHealth() { public boolean inDisrepair() { return health <= 0; } - + public void setFactory(Factory factory) { this.factory = factory; } @@ -33,16 +40,54 @@ public void repair(int amount) { public void breakIt() { health = 0; - if (factory.getMultiBlockStructure().relevantBlocksDestroyed()) { - FactoryMod.getManager().removeFactory(factory); - } + FactoryMod + .getPlugin() + .getServer() + .getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), + new Runnable() { + + @Override + public void run() { + if (factory.getMultiBlockStructure() + .relevantBlocksDestroyed()) { + LoggingUtils.log(factory.getLogData() + " removed because blocks were destroyed"); + FactoryMod.getManager().removeFactory( + factory); + returnStuff(factory); + } + + } + }); } - + public int getRawHealth() { return health; } - + public void setHealth(int health) { this.health = health; } + + public static void returnStuff(Factory factory) { + double rate = FactoryMod.getManager().getEgg(factory.getName()) + .getReturnRate(); + if (rate == 0.0) { + return; + } + for (Entry items : FactoryMod.getManager() + .getTotalSetupCost(factory).getEntrySet()) { + int returnAmount = (int) (items.getValue() * rate); + ItemMap im = new ItemMap(); + im.addItemAmount(items.getKey(), returnAmount); + for (ItemStack is : im.getItemStackRepresentation()) { + factory.getMultiBlockStructure() + .getCenter() + .getWorld() + .dropItemNaturally( + factory.getMultiBlockStructure().getCenter(), + is); + } + } + } } diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java index dde82d2d..6bd7ac6e 100644 --- a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -9,42 +9,42 @@ public class BlockFurnaceStructure extends MultiBlockStructure { - private Block center; - private Block furnace; + private Location center; + private Location furnace; private boolean complete = false; public BlockFurnaceStructure(Block center) { if (center.getType() == Material.DROPPER) { - this.center = center; + this.center = center.getLocation(); for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { - furnace = b; + furnace = b.getLocation(); complete = true; break; } } } - public BlockFurnaceStructure(List blocks) { + public BlockFurnaceStructure(List blocks) { this.center = blocks.get(0); this.furnace = blocks.get(1); } public boolean relevantBlocksDestroyed() { - return center.getType() != Material.DROPPER - && furnace.getType() != Material.FURNACE - && furnace.getType() != Material.BURNING_FURNACE; + return center.getBlock().getType() != Material.DROPPER + && furnace.getBlock().getType() != Material.FURNACE + && furnace.getBlock().getType() != Material.BURNING_FURNACE; } public Location getCenter() { - return center.getLocation(); + return center; } public Block getFurnace() { - return furnace; + return furnace.getBlock(); } - public List getAllBlocks() { - List blocks = new LinkedList(); + public List getAllBlocks() { + List blocks = new LinkedList(); blocks.add(center); blocks.add(furnace); return blocks; @@ -55,12 +55,16 @@ public boolean isComplete() { } public void recheckComplete() { - complete = (center.getType() == Material.DROPPER && (furnace.getType() == Material.FURNACE || furnace + complete = (center.getBlock().getType() == Material.DROPPER && (furnace + .getBlock().getType() == Material.FURNACE || furnace.getBlock() .getType() == Material.BURNING_FURNACE)); } public List getRelevantBlocks() { - return getAllBlocks(); + List blocks = new LinkedList(); + blocks.add(center.getBlock()); + blocks.add(furnace.getBlock()); + return blocks; } } diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index ed0ac4c9..1a58bd9d 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -16,51 +16,51 @@ * */ public class FurnCraftChestStructure extends MultiBlockStructure { - private Block CraftingTable; - private Block Furnace; - private Block Chest; + private Location craftingTable; + private Location furnace; + private Location chest; private boolean complete; public FurnCraftChestStructure(Block center) { if (center.getType() == Material.WORKBENCH) { - CraftingTable = center; + craftingTable = center.getLocation(); for (Block b : searchForBlockOnSides(center, Material.CHEST)) { switch (center.getFace(b)) { case SOUTH: if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.NORTH); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.NORTH).getLocation(); } case NORTH: if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.SOUTH); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.SOUTH).getLocation(); } case WEST: if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.EAST); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.EAST).getLocation(); } case EAST: if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.WEST); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.WEST).getLocation(); } case UP: if (center.getRelative(BlockFace.DOWN).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.DOWN); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.DOWN).getLocation(); } case DOWN: if (center.getRelative(BlockFace.UP).getType() == Material.FURNACE) { - Chest = b; - Furnace = center.getRelative(BlockFace.UP); + chest = b.getLocation(); + furnace = center.getRelative(BlockFace.UP).getLocation(); } } } } - if (Chest != null && Furnace != null) { + if (chest != null && furnace != null) { complete = true; } else { complete = false; @@ -68,17 +68,17 @@ public FurnCraftChestStructure(Block center) { } public void recheckComplete() { - complete = CraftingTable != null - && CraftingTable.getType() == Material.WORKBENCH - && Furnace != null - && (Furnace.getType() == Material.FURNACE || Furnace.getType() == Material.BURNING_FURNACE) - && Chest != null && Chest.getType() == Material.CHEST; + complete = craftingTable != null + && craftingTable.getBlock().getType() == Material.WORKBENCH + && furnace != null + && (furnace.getBlock().getType() == Material.FURNACE || furnace.getBlock().getType() == Material.BURNING_FURNACE) + && chest != null && chest.getBlock().getType() == Material.CHEST; } - public FurnCraftChestStructure(List blocks) { - CraftingTable = blocks.get(0); - Furnace = blocks.get(1); - Chest = blocks.get(2); + public FurnCraftChestStructure(List blocks) { + craftingTable = blocks.get(0); + furnace = blocks.get(1); + chest = blocks.get(2); } public boolean isComplete() { @@ -86,38 +86,42 @@ public boolean isComplete() { } public Block getCraftingTable() { - return CraftingTable; + return craftingTable.getBlock(); } public Block getFurnace() { - return Furnace; + return furnace.getBlock(); } public Block getChest() { - return Chest; + return chest.getBlock(); } public boolean relevantBlocksDestroyed() { - return CraftingTable.getType() != Material.WORKBENCH - && Furnace.getType() != Material.FURNACE - && Furnace.getType() != Material.BURNING_FURNACE - && Chest.getType() != Material.CHEST; + return craftingTable.getBlock().getType() != Material.WORKBENCH + && furnace.getBlock().getType() != Material.FURNACE + && furnace.getBlock().getType() != Material.BURNING_FURNACE + && chest.getBlock().getType() != Material.CHEST; } public List getRelevantBlocks() { - return getAllBlocks(); + LinkedList result = new LinkedList(); + result.add(getCraftingTable()); + result.add(getFurnace()); + result.add(getChest()); + return result; } - public List getAllBlocks() { - LinkedList result = new LinkedList(); - result.add(CraftingTable); - result.add(Furnace); - result.add(Chest); + public List getAllBlocks() { + LinkedList result = new LinkedList(); + result.add(craftingTable); + result.add(furnace); + result.add(chest); return result; } public Location getCenter() { - return Chest.getLocation(); + return chest; } } diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 9dc4b5b3..4be4b8d2 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -82,7 +82,7 @@ public static void initializeBlockFaceMap() { * * @return All blocks which are part of this factory */ - public abstract List getAllBlocks(); + public abstract List getAllBlocks(); /** * Rechecks whether all blocks of this factory exists and sets the variable diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 618f214c..10f00091 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -14,11 +14,11 @@ * */ public class PipeStructure extends MultiBlockStructure { - private Block start; - private Block furnace; - private Block end; + private Location start; + private Location furnace; + private Location end; private int length; - private List glassPipe; + private List glassPipe; private byte glassColor; private static Material pipeMaterial = Material.STAINED_GLASS; private static int maximumLength = 128; @@ -28,16 +28,16 @@ public PipeStructure(Block startBlock) { if (startBlock.getType() != Material.DISPENSER) { return; } - this.start = startBlock; + this.start = startBlock.getLocation(); for (Block b : MultiBlockStructure.searchForBlockOnSides(startBlock, Material.FURNACE)) { - furnace = b; + furnace = b.getLocation(); break; } if (furnace == null) { return; } - glassPipe = new LinkedList(); + glassPipe = new LinkedList(); Block currentBlock = startBlock.getRelative(dataBlockFaceConversion .get((int) (startBlock.getState().getRawData()))); Block previousBlock = null; @@ -45,7 +45,7 @@ public PipeStructure(Block startBlock) { return; } glassColor = currentBlock.getData(); - glassPipe.add(currentBlock); + glassPipe.add(currentBlock.getLocation()); int length = 1; while (length <= maximumLength) { List blocks = MultiBlockStructure @@ -54,7 +54,7 @@ public PipeStructure(Block startBlock) { boolean foundPipeBlock = false; for (Block b : blocks) { if (b.getState() instanceof InventoryHolder) { - end = b; + end = b.getLocation(); this.length = length; complete = true; foundEnd = true; @@ -62,7 +62,7 @@ public PipeStructure(Block startBlock) { } else if (b.getType() == pipeMaterial && b.getData() == glassColor && !b.equals(previousBlock)) { - glassPipe.add(b); + glassPipe.add(b.getLocation()); previousBlock = currentBlock; currentBlock = b; length++; @@ -76,15 +76,13 @@ public PipeStructure(Block startBlock) { } } - public PipeStructure(List blocks) { + public PipeStructure(List blocks) { this.start = blocks.get(0); this.furnace = blocks.get(1); this.end = blocks.get(blocks.size() - 1); - List glass = new LinkedList(); - for (Block b : blocks) { - if (b.getType() == pipeMaterial) { - glass.add(b); - } + List glass = new LinkedList(); + for (int i = 3; i< blocks.size()-1;i++) { + glass.add(blocks.get(i)); } this.glassPipe = glass; length = glassPipe.size(); @@ -92,17 +90,17 @@ public PipeStructure(List blocks) { } public Location getCenter() { - return start.getLocation(); + return start; } public boolean relevantBlocksDestroyed() { - return start.getType() != Material.DISPENSER - && furnace.getType() != Material.FURNACE - && furnace.getType() != Material.BURNING_FURNACE; + return start.getBlock().getType() != Material.DISPENSER + && furnace.getBlock().getType() != Material.FURNACE + && furnace.getBlock().getType() != Material.BURNING_FURNACE; } - public List getAllBlocks() { - List res = new LinkedList(); + public List getAllBlocks() { + List res = new LinkedList(); res.add(start); res.add(furnace); res.addAll(glassPipe); @@ -112,8 +110,8 @@ public List getAllBlocks() { public List getRelevantBlocks() { List res = new LinkedList(); - res.add(start); - res.add(furnace); + res.add(start.getBlock()); + res.add(furnace.getBlock()); return res; } @@ -121,13 +119,14 @@ public void recheckComplete() { if (start == null || furnace == null || end == null - || start.getType() != Material.DISPENSER - || (furnace.getType() != Material.FURNACE && furnace.getType() != Material.BURNING_FURNACE) - || !(end.getState() instanceof InventoryHolder)) { + || start.getBlock().getType() != Material.DISPENSER + || (furnace.getBlock().getType() != Material.FURNACE && furnace.getBlock().getType() != Material.BURNING_FURNACE) + || !(end.getBlock().getState() instanceof InventoryHolder)) { complete = false; return; } - for (Block b : glassPipe) { + for (Location loc : glassPipe) { + Block b = loc.getBlock(); if (b.getType() != pipeMaterial || b.getData() != glassColor) { complete = false; return; @@ -149,14 +148,14 @@ public int getLength() { } public Block getStart() { - return start; + return start.getBlock(); } public Block getEnd() { - return end; + return end.getBlock(); } public Block getFurnace() { - return furnace; + return furnace.getBlock(); } } diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index e0c3b39a..717affcf 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -64,9 +64,9 @@ public void save(Collection factories) { .getCenter()); config.set(current + ".name", f.getName()); config.getConfigurationSection(current).createSection("blocks"); - for (Block b : f.getMultiBlockStructure().getAllBlocks()) { + for (Location b : f.getMultiBlockStructure().getAllBlocks()) { configureLocation(config.getConfigurationSection(current) - .getConfigurationSection("blocks"), b.getLocation()); + .getConfigurationSection("blocks"), b); } if (f instanceof FurnCraftChestFactory) { FurnCraftChestFactory fccf = (FurnCraftChestFactory) f; @@ -146,7 +146,7 @@ private void loadFromFile(File f, Map eggs) { String type = current.getString("type"); String name = current.getString("name"); int runtime = current.getInt("runtime"); - List blocks = new LinkedList(); + List blocks = new LinkedList(); for (String blockKey : current.getConfigurationSection("blocks") .getKeys(false)) { ConfigurationSection currSec = current.getConfigurationSection( @@ -156,7 +156,7 @@ private void loadFromFile(File f, Map eggs) { int y = currSec.getInt("y"); int z = currSec.getInt("z"); World w = Bukkit.getWorld(worldName); - blocks.add(new Location(w, x, y, z).getBlock()); + blocks.add(new Location(w, x, y, z)); } switch (type) { case "FCC": From 2b34f90424b26b4d1b39329f11fc2c8a5f4d4c9a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 31 Jan 2016 05:50:10 +0100 Subject: [PATCH 213/459] Add decay runnable --- config.yml | 16 +++++++-- .../igotyou/FactoryMod/ConfigParser.java | 12 ++++++- .../github/igotyou/FactoryMod/FactoryMod.java | 2 -- .../igotyou/FactoryMod/FactoryModManager.java | 36 ++++++++++++++++--- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../FurnCraftChestInteractionManager.java | 30 +++++++++++++--- .../PercentageHealthRepairManager.java | 27 +++++++++++--- .../utility/FactoryGarbageCollector.java | 36 +++++++++++++++++++ 8 files changed, 141 insertions(+), 20 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java diff --git a/config.yml b/config.yml index bd2b3512..5605fa91 100644 --- a/config.yml +++ b/config.yml @@ -142,6 +142,15 @@ log_inventories: true disable_nether: false +#When FCCs are in disrepair they will be removed after a set amount of time, which can be specified here +break_grace_period: 7d + + +#How often factories are passively decayed +decay_intervall: 1h + +#How much health is decayed from factories +decay_amount: 21 #---------------------------------------------------------------------------------------------------------------------- @@ -434,7 +443,7 @@ disable_nether: false #4. Repairrecipe -#Repair recipes allow repairing their factory. Once a factory is at 0% health, the only recipe that can be run is the repair +#Repair recipes allow repairing their factory. Once a factory is at 0 health, the only recipe that can be run is the repair #recipe. #Example config: @@ -454,7 +463,7 @@ disable_nether: false #Input is as usual a list of items, which will be consumed when the recipe completes. -#health_gained is the amount of health that will be restored by a successfull run. 100 means fully health here +#health_gained is the amount of health that will be restored by a successfull run. 10000 means fully health here #5. Upgraderecipe @@ -481,6 +490,9 @@ disable_nether: false + + + #CivMenu configuration #This plugin uses CivMenu (https://github.com/civcraft/CivMenu) to display additional information to players. You can specify diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index b2e45084..e8b1ee1d 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -17,6 +17,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import vg.civcraft.mc.civmodcore.Config; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; @@ -34,6 +35,7 @@ import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.FactoryGarbageCollector; import com.google.common.collect.Lists; public class ConfigParser { @@ -81,9 +83,10 @@ public FactoryModManager parse() { defaultReturnRate = config.getDouble("default_return_rate", 0.0); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); + long gracePeriod = 50 * parseTime(config.getString("break_grace_period")); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, redstonePowerOn, redstoneRecipeChange, - logInventories); + logInventories, gracePeriod); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); upgradeEggs = new HashMap(); @@ -91,6 +94,7 @@ public FactoryModManager parse() { parseFactories(config.getConfigurationSection("factories")); parseRecipes(config.getConfigurationSection("recipes")); assignRecipesToFactories(); + enableFactoryDecay(config); manager.calculateTotalSetupCosts(); // Some recipes need references to factories and all factories need // references to recipes, so we parse all factories first, set their @@ -286,6 +290,12 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { recipeLists.put(egg, config.getStringList("recipes")); return egg; } + + public void enableFactoryDecay(ConfigurationSection config) { + long intervall = parseTime(config.getString("decay_intervall")); + int amount = config.getInt("decay_amount"); + plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new FactoryGarbageCollector(amount), intervall, intervall); + } /** * Disables and enables crafting recipes as specified in the config diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index 5886498f..91e76b23 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -11,7 +11,6 @@ import vg.civcraft.mc.civmenu.guides.ResponseManager; import vg.civcraft.mc.civmodcore.ACivMod; -import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; public class FactoryMod extends ACivMod { private static FactoryModManager manager; @@ -34,7 +33,6 @@ public void onEnable() { if (getServer().getPluginManager().isPluginEnabled("CivMenu")) { rm = ResponseManager.getResponseManager(this); } - new NiceNames().loadNames(); info("Successfully enabled"); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 3d278473..cffe5c5a 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -35,7 +35,7 @@ * */ public class FactoryModManager { - protected FactoryMod plugin; + private FactoryMod plugin; private FileHandler fileHandler; private HashMap, HashMap> factoryCreationRecipes; private HashMap totalSetupCosts; @@ -50,16 +50,18 @@ public class FactoryModManager { private int redstonePowerOn; private int redstoneRecipeChange; private String compactLore; + private long noHealthGracePeriod; public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, int redstonePowerOn, int redstoneRecipeChange, - boolean logInventories) { + boolean logInventories, long noHealthGracePeriod) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; + this.noHealthGracePeriod = noHealthGracePeriod; fileHandler = new FileHandler(this); @@ -249,7 +251,8 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); - LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.getName()); FactoryMod.sendResponse("FactoryCreation", p); } } else { @@ -291,7 +294,8 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); - LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.getName()); FactoryMod.sendResponse("PipeCreation", p); } @@ -331,7 +335,8 @@ public void attemptCreation(Block b, Player p) { addFactory(f); p.sendMessage(ChatColor.GREEN + "Successfully created " + f.getName()); - LoggingUtils.log(f.getLogData()+ " was created by " +p.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.getName()); FactoryMod.sendResponse("SorterCreation", p); } @@ -517,6 +522,17 @@ public int getRedstonePowerOn() { return this.redstonePowerOn; } + /** + * Gets how long factories using percentage health managers will stay alive + * after being broken. This is measure in milliseconds, because unix + * timestamps are used to track it + * + * @return How long a factory will be alive at 0 % health in milli seconds + */ + public long getNoHealthGracePeriod() { + return noHealthGracePeriod; + } + /** * Gets the Redstone power change necessary to alter the recipe setting of a * factory. Any change >= this level, either positive or negative, will @@ -528,4 +544,14 @@ public int getRedstonePowerOn() { public int getRedstoneRecipeChange() { return this.redstoneRecipeChange; } + + /** + * Gets all factories which currently exist. Do not mess with the hashset + * returned as it is used in other places + * + * @return All existing factory instances + */ + public HashSet getAllFactories() { + return factories; + } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 052c6d02..b5e4118b 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -40,7 +40,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( - 100); + PercentageHealthRepairManager.getMaximumHealth()); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 24d9f8f4..ce820fc6 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,5 +1,6 @@ package com.github.igotyou.FactoryMod.interactionManager; +import java.sql.Date; import java.util.HashMap; import org.bukkit.ChatColor; @@ -16,12 +17,12 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; -import vg.civcraft.mc.citadel.reinforcement.Reinforcement; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; import com.github.igotyou.FactoryMod.utility.MenuBuilder; @@ -92,11 +93,13 @@ public void leftClick(Player p, Block b, BlockFace bf) { .getFactoryInteractionMaterial()) { return; } - if(FactoryMod.getManager().isCitadelEnabled()) { - //is this cast safe? Let's just assume yes for now - PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); + if (FactoryMod.getManager().isCitadelEnabled()) { + // is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement) rm + .getReinforcement(b); if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { - p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); + p.sendMessage(ChatColor.RED + + "You dont have permission to interact with this factory"); FactoryMod.sendResponse("FactoryNoPermission", p); return; } @@ -174,6 +177,23 @@ public void clicked(Player arg0) { + fccf.getCurrentRecipe().getRecipeName()); p.sendMessage(ChatColor.GOLD + "Currently at " + fccf.getRepairManager().getHealth() + " health"); + if (fccf.getRepairManager().inDisrepair()) { + long breaktime = ((PercentageHealthRepairManager) fccf + .getRepairManager()).getBreakTime(); + long leftTime = FactoryMod.getManager() + .getNoHealthGracePeriod() + - (System.currentTimeMillis() - breaktime); + long months = leftTime % (60 * 60 * 24 * 30 * 1000); + long days = leftTime - (months * 60 * 60 * 24 * 30 * 1000) + % (60 * 60 * 24 * 1000); + long hours = leftTime - (months * 60 * 60 * 24 * 30 * 1000) + - (days * 60 * 60 * 24 * 1000) % (60 * 60 * 1000); + String time = (months != 0 ? months + " months, " : "") + + (days != 0 ? days + " days, " : "") + + (hours != 0 ? hours + " hours" : ""); + //p.sendMessage(ChatColor.GOLD + "It will break in " + time); + //TODO FIX THIS + } } return; diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 403d08e2..71a3fee9 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -13,13 +13,20 @@ public class PercentageHealthRepairManager implements IRepairManager { private int health; private Factory factory; + private long breakTime; + private static final int maximumHealth = 10000; public PercentageHealthRepairManager(int initialHealth) { health = initialHealth; + breakTime = 0; } public boolean atFullHealth() { - return health >= 100; + return health >= maximumHealth; + } + + public static int getMaximumHealth() { + return maximumHealth; } public boolean inDisrepair() { @@ -31,15 +38,18 @@ public void setFactory(Factory factory) { } public String getHealth() { - return String.valueOf(health) + " %"; + return String.valueOf(health / 100) + "." + + String.valueOf(health % 100) + " %"; } public void repair(int amount) { - health = Math.min(health + amount, 100); + health = Math.min(health + amount, maximumHealth); + breakTime = 0; } public void breakIt() { health = 0; + breakTime = System.currentTimeMillis(); FactoryMod .getPlugin() .getServer() @@ -51,7 +61,8 @@ public void breakIt() { public void run() { if (factory.getMultiBlockStructure() .relevantBlocksDestroyed()) { - LoggingUtils.log(factory.getLogData() + " removed because blocks were destroyed"); + LoggingUtils.log(factory.getLogData() + + " removed because blocks were destroyed"); FactoryMod.getManager().removeFactory( factory); returnStuff(factory); @@ -90,4 +101,12 @@ public static void returnStuff(Factory factory) { } } } + + public long getBreakTime() { + return breakTime; + } + + public void setBreakTime(long breakTime) { + this.breakTime = breakTime; + } } diff --git a/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java b/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java new file mode 100644 index 00000000..83fc432b --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java @@ -0,0 +1,36 @@ +package com.github.igotyou.FactoryMod.utility; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; + +public class FactoryGarbageCollector implements Runnable { + private int healthPerCall; + + public FactoryGarbageCollector(int healthPerCall) { + this.healthPerCall = healthPerCall; + } + + public void run() { + long graceTime = FactoryMod.getManager().getNoHealthGracePeriod(); + for(Factory f: FactoryMod.getManager().getAllFactories()) { + if (f.getRepairManager() instanceof PercentageHealthRepairManager) { + PercentageHealthRepairManager rm = (PercentageHealthRepairManager) f.getRepairManager(); + long broke = rm.getBreakTime(); + if (broke != 0) { + if (System.currentTimeMillis() - broke > graceTime) { + //grace period is over + LoggingUtils.log(f.getLogData() + " has been at no health for too long and is being removed"); + FactoryMod.getManager().removeFactory(f); + } + } + else { + rm.setHealth(rm.getRawHealth()-healthPerCall); + if (rm.getRawHealth() <= 0) { + rm.breakIt(); + } + } + } + } + } +} From e26598707dd07bff922a229f48175b9d2f529f0c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 2 Feb 2016 15:34:02 +0100 Subject: [PATCH 214/459] Remove config parsing stuff thats now in CivModCore --- pom.xml | 4 +- .../igotyou/FactoryMod/ConfigParser.java | 151 ++---------------- 2 files changed, 12 insertions(+), 143 deletions(-) diff --git a/pom.xml b/pom.xml index 415495b8..dcc2c5cd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.0 + 2.0.1 FactoryMod https://github.com/Civcraft/FactoryMod @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.1.91 + 1.1.92 provided diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index e8b1ee1d..82058c89 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -10,15 +10,12 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import vg.civcraft.mc.civmodcore.Config; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import static vg.civcraft.mc.civmodcore.util.ConfigParsing.parseItemMap; +import static vg.civcraft.mc.civmodcore.util.ConfigParsing.parseTime; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; @@ -83,7 +80,8 @@ public FactoryModManager parse() { defaultReturnRate = config.getDouble("default_return_rate", 0.0); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); - long gracePeriod = 50 * parseTime(config.getString("break_grace_period")); + long gracePeriod = 50 * parseTime(config + .getString("break_grace_period")); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, redstonePowerOn, redstoneRecipeChange, logInventories, gracePeriod); @@ -290,11 +288,15 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { recipeLists.put(egg, config.getStringList("recipes")); return egg; } - + public void enableFactoryDecay(ConfigurationSection config) { long intervall = parseTime(config.getString("decay_intervall")); int amount = config.getInt("decay_amount"); - plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new FactoryGarbageCollector(amount), intervall, intervall); + plugin.getServer() + .getScheduler() + .scheduleAsyncRepeatingTask(plugin, + new FactoryGarbageCollector(amount), intervall, + intervall); } /** @@ -419,137 +421,4 @@ public void assignRecipesToFactories() { } } } - - /** - * Creates an itemmap containing all the items listed in the given config - * section - * - * @param config - * ConfigurationSection to parse the items from - * @return The item map created - */ - private static ItemMap parseItemMap(ConfigurationSection config) { - ItemMap result = new ItemMap(); - if (config == null) { - return result; - } - for (String key : config.getKeys(false)) { - ConfigurationSection current = config.getConfigurationSection(key); - Material m = Material.valueOf(current.getString("material")); - ItemStack toAdd = new ItemStack(m); - int amount = current.getInt("amount", 1); - toAdd.setAmount(amount); - int durability = current.getInt("durability", 0); - toAdd.setDurability((short) durability); - ItemMeta im = toAdd.getItemMeta(); - String name = current.getString("name"); - if (name != null) { - im.setDisplayName(name); - } - List lore = current.getStringList("lore"); - if (lore != null) { - im.setLore(lore); - } - if (current.contains("enchants")) { - for (String enchantKey : current.getConfigurationSection( - "enchants").getKeys(false)) { - ConfigurationSection enchantConfig = current - .getConfigurationSection("enchants") - .getConfigurationSection(enchantKey); - Enchantment enchant = Enchantment.getByName(enchantConfig - .getString("enchant")); - int level = enchantConfig.getInt("level", 1); - im.addEnchant(enchant, level, true); - } - } - toAdd.setItemMeta(im); - result.addItemStack(toAdd); - } - return result; - } - - /** - * Parses a potion effect - * - * @param configurationSection - * ConfigurationSection to parse the effect from - * @return The potion effect parsed - */ - private static List parsePotionEffects( - ConfigurationSection configurationSection) { - List potionEffects = Lists.newArrayList(); - if (configurationSection != null) { - for (String name : configurationSection.getKeys(false)) { - ConfigurationSection configEffect = configurationSection - .getConfigurationSection(name); - String type = configEffect.getString("type"); - PotionEffectType effect = PotionEffectType.getByName(type); - int duration = configEffect.getInt("duration", 200); - int amplifier = configEffect.getInt("amplifier", 0); - potionEffects - .add(new PotionEffect(effect, duration, amplifier)); - } - } - return potionEffects; - } - - private long parseTime(String arg) { - long result = 0; - boolean set = true; - try { - result += Long.parseLong(arg); - } catch (NumberFormatException e) { - set = false; - } - if (set) { - return result; - } - while (!arg.equals("")) { - int length = 0; - switch (arg.charAt(arg.length() - 1)) { - case 't': // ticks - long ticks = getLastNumber(arg); - result += ticks; - length = String.valueOf(ticks).length() + 1; - break; - case 's': // seconds - long seconds = getLastNumber(arg); - result += 20 * seconds; // 20 ticks in a second - length = String.valueOf(seconds).length() + 1; - break; - case 'm': // minutes - long minutes = getLastNumber(arg); - result += 20 * 60 * minutes; - length = String.valueOf(minutes).length() + 1; - break; - case 'h': // hours - long hours = getLastNumber(arg); - result += 20 * 3600 * hours; - length = String.valueOf(hours).length() + 1; - break; - case 'd': // days, mostly here to define a 'never' - long days = getLastNumber(arg); - result += 20 * 3600 * 24 * days; - length = String.valueOf(days).length() + 1; - default: - plugin.severe("Invalid time value in config:" + arg); - } - arg = arg.substring(0, arg.length() - length); - } - return result; - } - - private long getLastNumber(String arg) { - StringBuilder number = new StringBuilder(); - for (int i = arg.length() - 2; i >= 0; i--) { - if (Character.isDigit(arg.charAt(i))) { - number.insert(0, arg.substring(i, i + 1)); - } else { - break; - } - } - long result = Long.parseLong(number.toString()); - return result; - } - } From 8c69355c6a5bc230cc6411324eac07905325b849 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 5 Feb 2016 16:11:48 -0500 Subject: [PATCH 215/459] Adding some error checking, validity tests and the like to the config reader --- pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 137 +++++++++++++----- 2 files changed, 103 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index dcc2c5cd..3adaef30 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.1 + 2.0.2 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 82058c89..bd00fd35 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -63,8 +63,14 @@ public FactoryModManager parse() { boolean citadelEnabled = plugin.getServer().getPluginManager() .isPluginEnabled("Citadel"); boolean logInventories = config.getBoolean("log_inventories", true); - Material factoryInteractionMaterial = Material.getMaterial(config - .getString("factory_interaction_material", "STICK")); + Material factoryInteractionMaterial = Material.STICK; + try { + factoryInteractionMaterial = Material.getMaterial(config + .getString("factory_interaction_material", "STICK")); + } catch (IllegalArgumentException iae) { + plugin.warning(config.getString("factory_interaction_material") + + " is not a valid material for factory_interaction_material"); + } boolean disableNether = config.getBoolean("disable_nether", false); if (disableNether) { plugin.getServer().getPluginManager() @@ -72,9 +78,12 @@ public FactoryModManager parse() { } defaultUpdateTime = (int) parseTime(config.getString( "default_update_time", "5")); - defaultFuel = parseItemMap( - config.getConfigurationSection("default_fuel")) - .getItemStackRepresentation().get(0); + ItemMap dFuel = parseItemMap(config.getConfigurationSection("default_fuel")); + if (dFuel.getTotalUniqueItemAmount() > 0) { + defaultFuel = dFuel.getItemStackRepresentation().get(0); + } else { + plugin.warning("No default_fuel specified. Should be an ItemMap."); + } defaultFuelConsumptionTime = (int) parseTime(config.getString( "default_fuel_consumption_intervall", "20")); defaultReturnRate = config.getDouble("default_return_rate", 0.0); @@ -114,7 +123,11 @@ private void parseRecipes(ConfigurationSection config) { recipes = new HashMap(); for (String key : config.getKeys(false)) { IRecipe recipe = parseRecipe(config.getConfigurationSection(key)); - recipes.put(recipe.getRecipeName(), recipe); + if (recipe == null) { + plugin.warning(String.format("Recipe %s unable to be added.", key)); + } else { + recipes.put(recipe.getRecipeName(), recipe); + } } } @@ -151,36 +164,67 @@ private void parseFactory(ConfigurationSection config) { switch (config.getString("type")) { case "FCC": // Furnace, chest, craftingtable egg = parseFCCFactory(config); + if (egg == null) { + break; + } ItemMap setupCost = parseItemMap(config .getConfigurationSection("setupcost")); System.out.println(setupCost.toString()); - manager.addFactoryCreationEgg(FurnCraftChestStructure.class, - setupCost, egg); + if (setupCost.getTotalUniqueItemAmount() > 0) { + manager.addFactoryCreationEgg(FurnCraftChestStructure.class, + setupCost, egg); + } else { + plugin.warning(String.format("FCC %s specified with no setup cost, skipping", + egg.getName())); + } break; case "FCCUPGRADE": egg = parseFCCFactory(config); + if (egg == null) { + break; + } upgradeEggs.put(egg.getName(), egg); manager.addFactoryUpgradeEgg(egg); break; case "PIPE": egg = parsePipe(config); + if (egg == null) { + break; + } ItemMap pipeSetupCost = parseItemMap(config .getConfigurationSection("setupcost")); - manager.addFactoryCreationEgg(PipeStructure.class, pipeSetupCost, - egg); + if (pipeSetupCost.getTotalUniqueItemAmount() > 0) { + manager.addFactoryCreationEgg(PipeStructure.class, pipeSetupCost, + egg); + } else { + plugin.warning(String.format("PIPE %s specified with no setup cost, skipping", + egg.getName())); + } break; case "SORTER": egg = parseSorter(config); + if (egg == null) { + break; + } ItemMap sorterSetupCost = parseItemMap(config .getConfigurationSection("setupcost")); - manager.addFactoryCreationEgg(BlockFurnaceStructure.class, + if (sorterSetupCost.getTotalUniqueItemAmount() > 0) { + manager.addFactoryCreationEgg(BlockFurnaceStructure.class, sorterSetupCost, egg); + } else { + plugin.warning(String.format("SORTER %s specified with no setup cost, skipping", + egg.getName())); + } break; default: plugin.severe("Could not identify factory type " + config.getString("type")); } - plugin.info("Parsed factory " + egg.getName()); + if (egg != null) { + plugin.info("Parsed factory " + egg.getName()); + } else { + plugin.warning(String.format("Failed to set up factory %s", config.getCurrentPath())); + } } @@ -200,8 +244,13 @@ public SorterEgg parseSorter(ConfigurationSection config) { } ItemStack fuel; if (config.contains("fuel")) { - fuel = parseItemMap(config.getConfigurationSection("fuel")) - .getItemStackRepresentation().get(0); + ItemMap tfuel = parseItemMap(config.getConfigurationSection("fuel")); + if (tfuel.getTotalUniqueItemAmount() > 0) { + fuel = tfuel.getItemStackRepresentation().get(0); + } else { + plugin.warning("Custom fuel was specified incorrectly for " + name); + fuel = defaultFuel; + } } else { fuel = defaultFuel; } @@ -235,8 +284,13 @@ public PipeEgg parsePipe(ConfigurationSection config) { } ItemStack fuel; if (config.contains("fuel")) { - fuel = parseItemMap(config.getConfigurationSection("fuel")) - .getItemStackRepresentation().get(0); + ItemMap tfuel = parseItemMap(config.getConfigurationSection("fuel")); + if (tfuel.getTotalUniqueItemAmount() > 0) { + fuel = tfuel.getItemStackRepresentation().get(0); + } else { + plugin.warning("Custom fuel was specified incorrectly for " + name); + fuel = defaultFuel; + } } else { fuel = defaultFuel; } @@ -271,8 +325,13 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { } ItemStack fuel; if (config.contains("fuel")) { - fuel = parseItemMap(config.getConfigurationSection("fuel")) - .getItemStackRepresentation().get(0); + ItemMap tfuel = parseItemMap(config.getConfigurationSection("fuel")); + if (tfuel.getTotalUniqueItemAmount() > 0) { + fuel = tfuel.getItemStackRepresentation().get(0); + } else { + plugin.warning("Custom fuel was specified incorrectly for " + name); + fuel = defaultFuel; + } } else { fuel = defaultFuel; } @@ -290,13 +349,10 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { } public void enableFactoryDecay(ConfigurationSection config) { - long intervall = parseTime(config.getString("decay_intervall")); + long interval = parseTime(config.getString("decay_intervall")); int amount = config.getInt("decay_amount"); - plugin.getServer() - .getScheduler() - .scheduleAsyncRepeatingTask(plugin, - new FactoryGarbageCollector(amount), intervall, - intervall); + plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, + new FactoryGarbageCollector(amount), interval, interval); } /** @@ -328,8 +384,7 @@ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { for (Recipe disable : toDisable) { if (disable.getResult().isSimilar(recipe.getResult())) { it.remove(); - plugin.info("Disabling recipe " - + recipe.getResult().toString()); + plugin.info("Disabling recipe " + recipe.getResult().toString()); } } } @@ -364,7 +419,11 @@ private IRecipe parseRecipe(ConfigurationSection config) { manager.setCompactLore(compactedLore); List excluded = new LinkedList(); for (String mat : config.getStringList("excluded_materials")) { - excluded.add(Material.valueOf(mat)); + try { + excluded.add(Material.valueOf(mat)); + } catch (IllegalArgumentException iae) { + plugin.warning(mat + " is not a valid material to exclude: " + config.getCurrentPath()); + } } result = new CompactingRecipe(extraMats, excluded, name, productionTime, compactedLore); @@ -389,17 +448,25 @@ private IRecipe parseRecipe(ConfigurationSection config) { if (egg == null) { plugin.severe("Could not find factory " + upgradeName + " for upgrade recipe " + name); + result = null; + } else { + result = new Upgraderecipe(name, productionTime, upgradeCost, egg); } - result = new Upgraderecipe(name, productionTime, upgradeCost, egg); break; case "AOEREPAIR": - ItemStack essence = parseItemMap( - config.getConfigurationSection("essence")) - .getItemStackRepresentation().get(0); - int repPerEssence = config.getInt("repair_per_essence"); - int range = config.getInt("range"); - result = new AOERepairRecipe(name, productionTime, essence, range, - repPerEssence); + ItemMap tessence = parseItemMap( + config.getConfigurationSection("essence")); + if (tessence.getTotalUniqueItemAmount() > 0){ + ItemStack essence = tessence + .getItemStackRepresentation().get(0); + int repPerEssence = config.getInt("repair_per_essence"); + int range = config.getInt("range"); + result = new AOERepairRecipe(name, productionTime, essence, range, + repPerEssence); + } else { + plugin.severe("No essence specified for AOEREPAIR " + config.getCurrentPath()); + result = null; + } break; default: plugin.severe("Could not identify type " + config.getString("type") From 40ccb708e4a6d8ff652393dd2636659fe5fb472f Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Fri, 5 Feb 2016 22:24:17 -0500 Subject: [PATCH 216/459] Fixing some NPEs in the menu builder, altering some length title messages because of Bukkits 32 char limit. Adding some logging for exceptional failure states brought about by bad config --- .gitignore | 4 + .../FactoryMod/utility/MenuBuilder.java | 86 +++++++++++-------- 2 files changed, 54 insertions(+), 36 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3bc9eb8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/target/ +.classpath +.settings/** +.project diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index e48a18cd..964ed1df 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -96,6 +96,7 @@ public void openFactoryBrowser(Player p, String startingFac) { } } if (egg == null) { + FactoryMod.getPlugin().warning("There is no factory with name " + comp); p.sendMessage(ChatColor.RED + "There is no factory with the name you entered"); return; @@ -109,8 +110,8 @@ public void openFactoryBrowser(Player p, String startingFac) { // creation option ItemStack creationStack = new ItemStack(Material.CHEST); ISUtils.setName(creationStack, "Setup"); - ISUtils.addLore(creationStack, ChatColor.LIGHT_PURPLE - + "Click to display more information", + ISUtils.addLore(creationStack, + ChatColor.LIGHT_PURPLE + "Click to display more information", ChatColor.LIGHT_PURPLE + "on how to setup this factory"); Clickable creationClickable = new Clickable(creationStack) { @Override @@ -139,10 +140,9 @@ public void clicked(Player arg0) { // upgrade option ItemStack upgradeStack = new ItemStack(Material.FURNACE); ISUtils.setName(upgradeStack, "Upgrades"); - ISUtils.addLore(upgradeStack, ChatColor.LIGHT_PURPLE - + "Click to display more information about", - ChatColor.LIGHT_PURPLE - + "the possible upgrades to this factory"); + ISUtils.addLore(upgradeStack, + ChatColor.LIGHT_PURPLE + "Click to display more information about", + ChatColor.LIGHT_PURPLE + "the possible upgrades to this factory"); Clickable upgradeClickable = new Clickable(upgradeStack) { @Override public void clicked(Player arg0) { @@ -159,12 +159,16 @@ public void clicked(Player arg0) { private void openRecipeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); ClickableInventory recipeInventory = new ClickableInventory(36, - "All recipes for " + facName); + "Recipes for " + facName); // Bukkit has 32 char limit on inventory FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); List recipes = egg.getRecipes(); // put recipes + int j = 0; for (int i = 0; i < recipes.size(); i++) { + if (recipes.get(i) == null) { + continue; + } Clickable c = new Clickable( ((InputRecipe) recipes.get(i)).getRecipeRepresentation()) { @Override @@ -173,14 +177,14 @@ public void clicked(Player arg0) { ISUtils.getName(this.getItemStack())); } }; - recipeInventory.setSlot(c, i); + recipeInventory.setSlot(c, j++); } // back option ItemStack backStack = new ItemStack(Material.ARROW); ISUtils.setName(backStack, "Back to factory overview"); - ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE - + "Click to go back"); + ISUtils.addLore(backStack, + ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -197,21 +201,19 @@ private void openSetupBrowser(Player p, String facName) { FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); FurnCraftChestEgg parEgg = (FurnCraftChestEgg) manager .getEgg(parentFactories.get(facName)); - ClickableInventory ci = new ClickableInventory(54, "How to get a " - + egg.getName()); + ClickableInventory ci = new ClickableInventory(54, "Create a " + + egg.getName()); // Bukkit has 32 char limit on inventory ItemStack cr = new ItemStack(Material.WORKBENCH); ItemStack fur = new ItemStack(Material.FURNACE); ItemStack che = new ItemStack(Material.CHEST); if (parEgg == null) {// creation factory - ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE - + "This factory can be created with", - ChatColor.LIGHT_PURPLE - + "a normal crafting table, furnace and chest"); - ISUtils.setLore(che, ChatColor.LIGHT_PURPLE - + "Arrange the 3 blocks like this,", ChatColor.LIGHT_PURPLE - + "put the materials below in the chest", - ChatColor.LIGHT_PURPLE - + "and hit the craftingtable with a stick"); + ISUtils.setLore(cr, + ChatColor.LIGHT_PURPLE + "This factory can be created with", + ChatColor.LIGHT_PURPLE + "a normal crafting table, furnace and chest"); + ISUtils.setLore(che, + ChatColor.LIGHT_PURPLE + "Arrange the 3 blocks like this,", + ChatColor.LIGHT_PURPLE + "put the materials below in the chest", + ChatColor.LIGHT_PURPLE + "and hit the crafting table with a stick"); DecorationStack furnDec = new DecorationStack(fur); DecorationStack chestDec = new DecorationStack(che); DecorationStack craStack = new DecorationStack(cr); @@ -256,8 +258,9 @@ public void clicked(Player arg0) { } }; ci.setSlot(craCli, 4); - ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE - + "Click to display information", ChatColor.LIGHT_PURPLE + "on this factory"); + ISUtils.setLore(fur, + ChatColor.LIGHT_PURPLE + "Click to display information", + ChatColor.LIGHT_PURPLE + "on this factory"); Clickable furCli = new Clickable(fur) { @Override public void clicked(Player arg0) { @@ -296,8 +299,7 @@ public void clicked(Player arg0) { ci.setSlot(input, 22); ItemStack backStack = new ItemStack(Material.ARROW); ISUtils.setName(backStack, "Back to factory overview"); - ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE - + "Click to go back"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -312,18 +314,18 @@ private void openUpgradeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager .getEgg(factoryViewed.get(p.getUniqueId())); - ClickableInventory ci = new ClickableInventory(18, "Possible upgrades"); List upgrades = new LinkedList(); for (IRecipe recipe : egg.getRecipes()) { if (recipe instanceof Upgraderecipe) { upgrades.add(recipe); } } + ClickableInventory ci = new ClickableInventory( + Math.max(18, (upgrades.size() / 9) * 9), "Possible upgrades"); if (upgrades.size() == 0) { ItemStack bar = new ItemStack(Material.BARRIER); ISUtils.setName(bar, "No upgrades available"); - ISUtils.addLore(bar, ChatColor.LIGHT_PURPLE - + "Click to go back"); + ISUtils.addLore(bar, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable noUpgrades = new Clickable(bar) { @Override public void clicked(Player p) { @@ -335,8 +337,8 @@ public void clicked(Player p) { for (IRecipe recipe : upgrades) { ItemStack recStack = ((InputRecipe) recipe) .getRecipeRepresentation(); - ISUtils.setLore(recStack, ChatColor.LIGHT_PURPLE - + "Click to display more information"); + ISUtils.setLore(recStack, + ChatColor.LIGHT_PURPLE + "Click to display more information"); Clickable c = new Clickable( ((InputRecipe) recipe).getRecipeRepresentation()) { @Override @@ -350,8 +352,7 @@ public void clicked(Player p) { } ItemStack backStack = new ItemStack(Material.ARROW); ISUtils.setName(backStack, "Back to factory overview"); - ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE - + "Click to go back"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -364,15 +365,30 @@ public void clicked(Player arg0) { private void openDetailedRecipeBrowser(Player p, String recipeName) { ClickableInventory.forceCloseInventory(p); + if (recipeName == null){ + FactoryMod.getPlugin().warning("Recipe name cannot be null in openDetailedRecipeBrowser calls"); + return; + } FurnCraftChestEgg egg = (FurnCraftChestEgg) manager .getEgg(factoryViewed.get(p.getUniqueId())); InputRecipe rec = null; for (IRecipe recipe : egg.getRecipes()) { - if (recipe.getRecipeName().equals(recipeName)) { + if (recipe == null || recipe.getRecipeName() == null) { + FactoryMod.getPlugin().warning("Null recipe or recipe name registered with "+ + egg.getName()); + continue; + } + if (recipeName.equals(recipe.getRecipeName())) { rec = (InputRecipe) recipe; break; } } + if (rec == null) { + FactoryMod.getPlugin().warning("There is no recipe with name " + recipeName); + p.sendMessage(ChatColor.RED + + "There is no recipe that matches " + recipeName); + return; + } ClickableInventory ci = new ClickableInventory(54, recipeName); ItemStack inputStack = new ItemStack(Material.PAPER); ISUtils.setName(inputStack, "Input materials"); @@ -517,8 +533,7 @@ public void showSorterFace(Player p, Sorter s, BlockFace face) { ClickableInventory ci = new ClickableInventory(54, "Items for this side"); viewed.put(p.getUniqueId(), s); - for (ItemStack is : s.getItemsForSide(face) - .getItemStackRepresentation()) { + for (ItemStack is : s.getItemsForSide(face).getItemStackRepresentation()) { is.setAmount(1); ci.addSlot(new Clickable(is) { @Override @@ -531,7 +546,6 @@ public void clicked(Player arg0) { }); } ci.showInventory(p); - } } From aac828cabdac8940fbd5e8914eadc991ba8301f2 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 13 Feb 2016 17:42:45 +0100 Subject: [PATCH 217/459] Prevent null recipes due to bad configs --- pom.xml | 2 +- src/com/github/igotyou/FactoryMod/ConfigParser.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3adaef30..1661a595 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.2 + 2.0.3 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index bd00fd35..342d5aef 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -33,7 +33,6 @@ import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.FactoryGarbageCollector; -import com.google.common.collect.Lists; public class ConfigParser { private FactoryMod plugin; @@ -482,7 +481,14 @@ public void assignRecipesToFactories() { if (entry.getKey() instanceof FurnCraftChestEgg) { List recipeList = new LinkedList(); for (String recipeName : entry.getValue()) { - recipeList.add(recipes.get(recipeName)); + IRecipe rec = recipes.get(recipeName); + if (rec != null) { + recipeList.add(recipes.get(recipeName)); + } + else { + plugin.severe("Could not find specified recipe " + recipeName + + " for factory " + entry.getKey().getName()); + } } ((FurnCraftChestEgg) entry.getKey()).setRecipes(recipeList); } From 95f808eec47de664abefecafb6c0503b50b84f18 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 13 Feb 2016 17:56:21 +0100 Subject: [PATCH 218/459] Downgrade NameLayer and Citadel from hard to soft dependencies --- plugin.yml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.yml b/plugin.yml index f52d52bc..34ab9bb2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,8 +2,8 @@ name: ${project.name} main: com.github.igotyou.FactoryMod.FactoryMod author: igotyou version: ${project.version} -depend: [NameLayer, Citadel, CivModCore] -softdepend: [CivMenu] +depend: [CivModCore] +softdepend: [CivMenu, NameLayer, Citadel] commands: fm: permission: fm.public diff --git a/pom.xml b/pom.xml index 1661a595..f692a585 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.3 + 2.0.4 FactoryMod https://github.com/Civcraft/FactoryMod From 30c8e154cea70f42742f2063952523a44eb8403e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 13 Feb 2016 19:22:40 +0100 Subject: [PATCH 219/459] Prevent dupes due to repair tags on tools --- pom.xml | 4 ++-- .../FactoryMod/recipes/AOERepairRecipe.java | 20 ++++++++++--------- .../recipes/DecompactingRecipe.java | 15 +++++++------- .../FactoryMod/recipes/ProductionRecipe.java | 10 +++++----- .../FactoryMod/recipes/PylonRecipe.java | 9 ++++----- .../FactoryMod/recipes/RepairRecipe.java | 15 +++++++------- .../FactoryMod/recipes/Upgraderecipe.java | 11 +++++----- 7 files changed, 41 insertions(+), 43 deletions(-) diff --git a/pom.xml b/pom.xml index f692a585..44879114 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.4 + 2.0.5 FactoryMod https://github.com/Civcraft/FactoryMod @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.1.92 + 1.1.96 provided diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index ec9890e6..2cdff87a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -149,19 +149,21 @@ public void applyEffect(Inventory i, Factory f) { int rem = Math.min(essenceCount, diff / repairPerEssence); ItemStack remStack = essence.clone(); remStack.setAmount(rem); + ItemMap remMap = new ItemMap(remStack); Inventory targetInv = ((InventoryHolder) (fac.getChest() .getState())).getInventory(); - if (new ItemMap(remStack).fitsIn(targetInv)) { - i.removeItem(remStack); - targetInv.addItem(remStack); - for (IRecipe rec : fac.getRecipes()) { - if (rec instanceof RepairRecipe) { - fac.setRecipe(rec); - break; + if (remMap.fitsIn(targetInv)) { + if (remMap.removeSafelyFrom(i)) { + targetInv.addItem(remStack); + for (IRecipe rec : fac.getRecipes()) { + if (rec instanceof RepairRecipe) { + fac.setRecipe(rec); + break; + } } + fac.attemptToActivate(null); + break; } - fac.attemptToActivate(null); - break; } } if (essenceCount <= 0) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index f0a0b60d..e8bd2155 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -12,6 +12,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; + /** * Used to decompact itemstacks, which means a single item with compacted lore * is turned into a whole stack without lore. This reverses the functionality of @@ -58,14 +59,12 @@ public void applyEffect(Inventory i, Factory f) { // gives a copy decompatedStack.setItemMeta(im); if (new ItemMap(decompatedStack).fitsIn(i)) { - for (ItemStack toRemove : input - .getItemStackRepresentation()) { - i.removeItem(toRemove); + if (input.removeSafelyFrom(i)) { + ItemStack removeLoredStack = is.clone(); + removeLoredStack.setAmount(1); + i.removeItem(removeLoredStack); + i.addItem(decompatedStack); } - ItemStack removeLoredStack = is.clone(); - removeLoredStack.setAmount(1); - i.removeItem(removeLoredStack); - i.addItem(decompatedStack); } break; } @@ -111,7 +110,7 @@ public List getOutputRepresentation(Inventory i) { if (i == null) { result.add(new ItemStack(Material.STONE, 64)); return result; - } + } for (ItemStack is : i.getContents()) { if (is != null) { ItemMeta im = is.getItemMeta(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 40263405..e0c06d74 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -11,6 +11,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.utility.InventoryHandling; /** * Consumes a set of materials from a container and outputs another set of @@ -65,11 +66,10 @@ public void applyEffect(Inventory i, Factory f) { ItemMap toRemove = input.clone(); ItemMap toAdd = output.clone(); if (toRemove.isContainedIn(i)) { - for (ItemStack is : toRemove.getItemStackRepresentation()) { - i.removeItem(is); - } - for (ItemStack is : toAdd.getItemStackRepresentation()) { - i.addItem(is); + if (toRemove.removeSafelyFrom(i)) { + for(ItemStack is: toAdd.getItemStackRepresentation()) { + i.addItem(is); + } } } logAfterRecipeRun(i, f); diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 89a64649..93640ee0 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -37,11 +37,10 @@ public void applyEffect(Inventory i, Factory f) { if (!actualOutput.fitsIn(i)) { return; } - for (ItemStack is : input.getItemStackRepresentation()) { - i.removeItem(is); - } - for (ItemStack is : actualOutput.getItemStackRepresentation()) { - i.addItem(is); + if (input.removeSafelyFrom(i)) { + for (ItemStack is : actualOutput.getItemStackRepresentation()) { + i.addItem(is); + } } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index e8069274..fd1704bd 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -46,15 +46,14 @@ public List getInputRepresentation(Inventory i) { public void applyEffect(Inventory i, Factory f) { logBeforeRecipeRun(i, f); if (enoughMaterialAvailable(i)) { - for (ItemStack is : input.getItemStackRepresentation()) { - i.removeItem(is); + if (input.removeSafelyFrom(i)) { + ((PercentageHealthRepairManager) (f.getRepairManager())) + .repair(healthPerRun); + LoggingUtils.log(((PercentageHealthRepairManager) (f + .getRepairManager())).getHealth() + + " for " + + f.getLogData() + " after repairing"); } - ((PercentageHealthRepairManager) (f.getRepairManager())) - .repair(healthPerRun); - LoggingUtils.log(((PercentageHealthRepairManager) (f - .getRepairManager())).getHealth() - + " for " - + f.getLogData() + " after repairing"); } logAfterRecipeRun(i, f); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index f144c586..3aac7d4b 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -29,13 +29,12 @@ public Upgraderecipe(String name, int productionTime, ItemMap input, public void applyEffect(Inventory i, Factory f) { logAfterRecipeRun(i, f); if (input.isContainedIn(i) && f instanceof FurnCraftChestFactory) { - for (ItemStack is : input.getItemStackRepresentation()) { - i.removeItem(is); + if (input.removeSafelyFrom(i)) { + FurnCraftChestEgg e = (FurnCraftChestEgg) egg; + ((FurnCraftChestFactory) f).upgrade(e.getName(), + e.getRecipes(), e.getFuel(), + e.getFuelConsumptionIntervall(), e.getUpdateTime()); } - FurnCraftChestEgg e = (FurnCraftChestEgg) egg; - ((FurnCraftChestFactory) f).upgrade(e.getName(), e.getRecipes(), - e.getFuel(), e.getFuelConsumptionIntervall(), - e.getUpdateTime()); } logAfterRecipeRun(i, f); } From ba59268ed8971fad74c139e5085af793401c7f66 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 13 Feb 2016 19:32:29 +0100 Subject: [PATCH 220/459] Add config option to specify default for /fm --- config.yml | 4 + pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 6 ++ .../github/igotyou/FactoryMod/FactoryMod.java | 2 +- .../FactoryMod/commands/commands/Menu.java | 6 +- .../FactoryMod/utility/MenuBuilder.java | 96 ++++++++++++------- 6 files changed, 73 insertions(+), 43 deletions(-) diff --git a/config.yml b/config.yml index 5605fa91..2a00348f 100644 --- a/config.yml +++ b/config.yml @@ -131,6 +131,10 @@ default_fuel: default_fuel_consumption_intervall: 2s +#default_menu_factory allows you to specify the menu for which factory will be opened when a player runs /fm without +#specifying a factory. If this is not specified and the player runs "/fm" one will be picked randomly. +default_menu_factory: + #As a debug mode or to prevent additional information when tracking down bugs this plugin can log all of its inventory #interactions and the full inventories at that point, if desired. If this option is not specified it will default to true diff --git a/pom.xml b/pom.xml index 44879114..066e3b82 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.5 + 2.0.6 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 342d5aef..236ff0ba 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -44,6 +44,7 @@ public class ConfigParser { private double defaultReturnRate; private HashMap upgradeEggs; private HashMap> recipeLists; + private String defaultMenuFactory; public ConfigParser(FactoryMod plugin) { this.plugin = plugin; @@ -90,6 +91,7 @@ public FactoryModManager parse() { int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); long gracePeriod = 50 * parseTime(config .getString("break_grace_period")); + defaultMenuFactory = config.getString("default_menu_factory"); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, redstonePowerOn, redstoneRecipeChange, logInventories, gracePeriod); @@ -494,4 +496,8 @@ public void assignRecipesToFactories() { } } } + + public String getDefaultMenuFactory() { + return defaultMenuFactory; + } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index 91e76b23..71314cd9 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -26,7 +26,7 @@ public void onEnable() { MultiBlockStructure.initializeBlockFaceMap(); ConfigParser cp = new ConfigParser(this); manager = cp.parse(); - mb = new MenuBuilder(); + mb = new MenuBuilder(cp.getDefaultMenuFactory()); manager.loadFactories(); registerListeners(); FurnCraftChestInteractionManager.prep(); diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java index 4214bedd..164f054f 100644 --- a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -2,15 +2,12 @@ import java.util.LinkedList; import java.util.List; -import java.util.Map.Entry; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.FactoryMod; -import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; -import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.utility.MenuBuilder; import vg.civcraft.mc.civmodcore.command.PlayerCommand; @@ -34,8 +31,7 @@ public boolean execute(CommandSender sender, String[] args) { MenuBuilder mb = FactoryMod.getMenuBuilder(); Player p = (Player) sender; if (args.length == 0) { - mb.openFactoryBrowser(p, FactoryMod.getManager().getAllEggs() - .values().iterator().next().getName()); + mb.openFactoryBrowser(p, null); } else { mb.openFactoryBrowser(p, getFactoryName(args)); } diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 964ed1df..ac8c980f 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -46,8 +46,9 @@ public class MenuBuilder { // child is key, parent is value private Map parentFactories = new HashMap(); private DecorationStack input; + private IFactoryEgg defaultMenu; - public MenuBuilder() { + public MenuBuilder(String defaultFactory) { manager = FactoryMod.getManager(); for (IFactoryEgg egg : manager.getAllEggs().values()) { if (egg instanceof FurnCraftChestEgg) { @@ -69,6 +70,9 @@ public MenuBuilder() { ISUtils.setName(outp, "Output"); ISUtils.setLore(outp, ChatColor.LIGHT_PURPLE + "The output of this recipe"); + if (defaultFactory != null) { + defaultMenu = manager.getEgg(defaultFactory); + } } private DecorationStack createBannerDeco(PatternType... types) { @@ -84,7 +88,17 @@ private DecorationStack createBannerDeco(PatternType... types) { public void openFactoryBrowser(Player p, String startingFac) { ClickableInventory.forceCloseInventory(p); - IFactoryEgg egg = manager.getEgg(startingFac); + IFactoryEgg egg; + if (startingFac == null) { + egg = defaultMenu; + if (egg == null) { + egg = manager.getAllEggs().values().iterator().next(); + // no default in config and nothing specified, so just a pick + // any existing one + } + } else { + egg = manager.getEgg(startingFac); + } if (egg == null) { String comp = startingFac.toLowerCase(); // check for lower/uppercase miss spellings @@ -96,7 +110,8 @@ public void openFactoryBrowser(Player p, String startingFac) { } } if (egg == null) { - FactoryMod.getPlugin().warning("There is no factory with name " + comp); + FactoryMod.getPlugin().warning( + "There is no factory with name " + comp); p.sendMessage(ChatColor.RED + "There is no factory with the name you entered"); return; @@ -110,8 +125,8 @@ public void openFactoryBrowser(Player p, String startingFac) { // creation option ItemStack creationStack = new ItemStack(Material.CHEST); ISUtils.setName(creationStack, "Setup"); - ISUtils.addLore(creationStack, - ChatColor.LIGHT_PURPLE + "Click to display more information", + ISUtils.addLore(creationStack, ChatColor.LIGHT_PURPLE + + "Click to display more information", ChatColor.LIGHT_PURPLE + "on how to setup this factory"); Clickable creationClickable = new Clickable(creationStack) { @Override @@ -140,9 +155,10 @@ public void clicked(Player arg0) { // upgrade option ItemStack upgradeStack = new ItemStack(Material.FURNACE); ISUtils.setName(upgradeStack, "Upgrades"); - ISUtils.addLore(upgradeStack, - ChatColor.LIGHT_PURPLE + "Click to display more information about", - ChatColor.LIGHT_PURPLE + "the possible upgrades to this factory"); + ISUtils.addLore(upgradeStack, ChatColor.LIGHT_PURPLE + + "Click to display more information about", + ChatColor.LIGHT_PURPLE + + "the possible upgrades to this factory"); Clickable upgradeClickable = new Clickable(upgradeStack) { @Override public void clicked(Player arg0) { @@ -159,7 +175,8 @@ public void clicked(Player arg0) { private void openRecipeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); ClickableInventory recipeInventory = new ClickableInventory(36, - "Recipes for " + facName); // Bukkit has 32 char limit on inventory + "Recipes for " + facName); // Bukkit has 32 char limit on + // inventory FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); List recipes = egg.getRecipes(); @@ -183,8 +200,7 @@ public void clicked(Player arg0) { // back option ItemStack backStack = new ItemStack(Material.ARROW); ISUtils.setName(backStack, "Back to factory overview"); - ISUtils.addLore(backStack, - ChatColor.LIGHT_PURPLE + "Click to go back"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -207,13 +223,15 @@ private void openSetupBrowser(Player p, String facName) { ItemStack fur = new ItemStack(Material.FURNACE); ItemStack che = new ItemStack(Material.CHEST); if (parEgg == null) {// creation factory - ISUtils.setLore(cr, - ChatColor.LIGHT_PURPLE + "This factory can be created with", - ChatColor.LIGHT_PURPLE + "a normal crafting table, furnace and chest"); - ISUtils.setLore(che, - ChatColor.LIGHT_PURPLE + "Arrange the 3 blocks like this,", - ChatColor.LIGHT_PURPLE + "put the materials below in the chest", - ChatColor.LIGHT_PURPLE + "and hit the crafting table with a stick"); + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + + "This factory can be created with", + ChatColor.LIGHT_PURPLE + + "a normal crafting table, furnace and chest"); + ISUtils.setLore(che, ChatColor.LIGHT_PURPLE + + "Arrange the 3 blocks like this,", ChatColor.LIGHT_PURPLE + + "put the materials below in the chest", + ChatColor.LIGHT_PURPLE + + "and hit the crafting table with a stick"); DecorationStack furnDec = new DecorationStack(fur); DecorationStack chestDec = new DecorationStack(che); DecorationStack craStack = new DecorationStack(cr); @@ -249,7 +267,8 @@ private void openSetupBrowser(Player p, String facName) { } } - ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "Upgrade from a " + parEgg.getName()); + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "Upgrade from a " + + parEgg.getName()); Clickable craCli = new Clickable(cr) { @Override public void clicked(Player arg0) { @@ -258,9 +277,9 @@ public void clicked(Player arg0) { } }; ci.setSlot(craCli, 4); - ISUtils.setLore(fur, - ChatColor.LIGHT_PURPLE + "Click to display information", - ChatColor.LIGHT_PURPLE + "on this factory"); + ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE + + "Click to display information", ChatColor.LIGHT_PURPLE + + "on this factory"); Clickable furCli = new Clickable(fur) { @Override public void clicked(Player arg0) { @@ -320,8 +339,8 @@ private void openUpgradeBrowser(Player p, String facName) { upgrades.add(recipe); } } - ClickableInventory ci = new ClickableInventory( - Math.max(18, (upgrades.size() / 9) * 9), "Possible upgrades"); + ClickableInventory ci = new ClickableInventory(Math.max(18, + (upgrades.size() / 9) * 9), "Possible upgrades"); if (upgrades.size() == 0) { ItemStack bar = new ItemStack(Material.BARRIER); ISUtils.setName(bar, "No upgrades available"); @@ -337,8 +356,8 @@ public void clicked(Player p) { for (IRecipe recipe : upgrades) { ItemStack recStack = ((InputRecipe) recipe) .getRecipeRepresentation(); - ISUtils.setLore(recStack, - ChatColor.LIGHT_PURPLE + "Click to display more information"); + ISUtils.setLore(recStack, ChatColor.LIGHT_PURPLE + + "Click to display more information"); Clickable c = new Clickable( ((InputRecipe) recipe).getRecipeRepresentation()) { @Override @@ -365,8 +384,11 @@ public void clicked(Player arg0) { private void openDetailedRecipeBrowser(Player p, String recipeName) { ClickableInventory.forceCloseInventory(p); - if (recipeName == null){ - FactoryMod.getPlugin().warning("Recipe name cannot be null in openDetailedRecipeBrowser calls"); + if (recipeName == null) { + FactoryMod + .getPlugin() + .warning( + "Recipe name cannot be null in openDetailedRecipeBrowser calls"); return; } FurnCraftChestEgg egg = (FurnCraftChestEgg) manager @@ -374,8 +396,9 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { InputRecipe rec = null; for (IRecipe recipe : egg.getRecipes()) { if (recipe == null || recipe.getRecipeName() == null) { - FactoryMod.getPlugin().warning("Null recipe or recipe name registered with "+ - egg.getName()); + FactoryMod.getPlugin().warning( + "Null recipe or recipe name registered with " + + egg.getName()); continue; } if (recipeName.equals(recipe.getRecipeName())) { @@ -384,9 +407,10 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { } } if (rec == null) { - FactoryMod.getPlugin().warning("There is no recipe with name " + recipeName); - p.sendMessage(ChatColor.RED - + "There is no recipe that matches " + recipeName); + FactoryMod.getPlugin().warning( + "There is no recipe with name " + recipeName); + p.sendMessage(ChatColor.RED + "There is no recipe that matches " + + recipeName); return; } ClickableInventory ci = new ClickableInventory(54, recipeName); @@ -422,8 +446,7 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { DecorationStack outputClickable = new DecorationStack(outputStack); ItemStack backStack = new ItemStack(Material.ARROW); ISUtils.setName(backStack, "Back to recipe overview"); - ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE - + "Click to go back"); + ISUtils.addLore(backStack, ChatColor.LIGHT_PURPLE + "Click to go back"); Clickable backClickable = new Clickable(backStack) { @Override public void clicked(Player arg0) { @@ -533,7 +556,8 @@ public void showSorterFace(Player p, Sorter s, BlockFace face) { ClickableInventory ci = new ClickableInventory(54, "Items for this side"); viewed.put(p.getUniqueId(), s); - for (ItemStack is : s.getItemsForSide(face).getItemStackRepresentation()) { + for (ItemStack is : s.getItemsForSide(face) + .getItemStackRepresentation()) { is.setAmount(1); ci.addSlot(new Clickable(is) { @Override From e6b443af547d3df531ff4a4de9723d75100c6033 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 13 Feb 2016 21:46:11 +0100 Subject: [PATCH 221/459] Remove nonexistant import --- src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index e0c06d74..875dddd5 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -11,7 +11,6 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; -import com.github.igotyou.FactoryMod.utility.InventoryHandling; /** * Consumes a set of materials from a container and outputs another set of From a4ae31ca34fc0aede6f81a69585492625ec039f1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 18 Feb 2016 03:21:12 +0100 Subject: [PATCH 222/459] Include recipe & factory option in default config --- config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 2a00348f..e3deb172 100644 --- a/config.yml +++ b/config.yml @@ -337,6 +337,7 @@ decay_amount: 21 #maximum_materials_per_side is an amount that limits how many items you can assign to a specific side (so the sorter sorts them #in this direction) +factories: #----------------------------------------------------------------------------------------------------------------------------- @@ -492,7 +493,7 @@ decay_amount: 21 #factory is the name of the factory it's supposed to be upgraded to. This factory must have been specified as FCCUPGRADE #above and the name here and above has to be exactly the same. - +recipes: @@ -537,4 +538,4 @@ CivMenu: - \ No newline at end of file + From e59965fb7a5ecf37af8eff6db5de8e3696395cc0 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 26 Feb 2016 00:55:55 +0100 Subject: [PATCH 223/459] Add initial version of 3.0 config --- configCivcraft.yml | 3607 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3607 insertions(+) create mode 100644 configCivcraft.yml diff --git a/configCivcraft.yml b/configCivcraft.yml new file mode 100644 index 00000000..5e9b18aa --- /dev/null +++ b/configCivcraft.yml @@ -0,0 +1,3607 @@ +# +# inputmat1: +# material: STONE +# inputmat345FF: +# material: DIRT + +default_update_time: 1s +default_fuel: + charcoal: + material: COAL + durability: 1 +default_fuel_consumption_intervall: 2s +default_menu_factory: Basic Contraption +log_inventories: true +break_grace_period: 7d +decay_intervall: 1h +decay_amount: 21 +factories: + basiccontraption: + type: FCC + name: Basic Contraption + setupcost: + wood: + material: WOOD + amount: 64 + stone: + material: STONE + amount: 64 + bread: + material: BREAD + amount: 32 + recipes: + - Smelt_Stone_Basic + - Cut_any_type_of_Plank_Basic + - Bake_Bread_Basic + - Upgrade_to_Stone_Smelter + - Upgrade_to_Farmstead_Factory + - Upgrade_to_Blacksmith + - Upgrade_to_Laboratory + - Upgrade_to_Wood_Processor + stonesmelter: + type: FCCUPGRADE + name: Stone Smelter + recipes: + - Smelt_Stone_Advanced + - Smelt_Coal_Ore_Basic + - Smelt_Glass_Basic + - Upgrade_to_Ore_Smelter + - Upgrade_to_Sand_Smelter + - Upgrade_to_Brick_Smelter + - Upgrade_to_Kiln + oresmelter: + type: FCCUPGRADE + name: Ore Smelter + recipes: + - Smelt_Coal_Ore_Advanced + - Smelt_Iron_Ore_Basic + - Extract_Redstone_Basic + - Extract_Quartz_Basic + - Upgrade_to_Ore_Forge + - Upgrade_to_Gem_extractor + oresmelter2: + type: FCCUPGRADE + name: Ore Forge + recipes: + - Smelt_Coal_Ore_Expert + - Smelt_Iron_Ore_Advanced + - Smelt_Gold_Ore + gemextractor: + type: FCCUPGRADE + name: Gem Extractor + recipes: + - Extract_Diamonds + - Extract_Emeralds + - Extract_Quartz_Advanced + - Extract_Redstone_Advanced + - Extract_Lapis + sandsmelter: + type: FCCUPGRADE + name: Sand Smelter + recipes: + - Smelt_Glass_Advanced + - Smelt_Glass_Panes_Basic + - Smelt_Sandstone_Basic + - Smelt_Red_Sandstone_Basic + - Convert_Normal_Sand_to_Red_Sand + - Upgrade_to_Sand_Smelter_2 + - Upgrade_to_Sandstone_Smelter + - Upgrade_to_Glass_Dying + sandsmelter2: + type: FCCUPGRADE + name: Sand Smelter 2 + recipes: + - Smelt_Glass_Expert + - Smelt_Glass_Panes_Advanced + - Smelt_Glassbottles + sandstonesmelter: + type: FCCUPGRADE + name: Sandstone Smelter + recipes: + - Smelt_Sandstone_Advanced + - Smelt_Red_Sandstone_Advanced + - Smelt_Sandstone_Stairs + - Smelt_Red_Sandstone_Stairs + - Smelt_Sandstone_Slabs + - Smelt_Red_Sandstone_Slabs + - Smelt_Chiselled_Sandstone + - Smelt_Chiselled_Red_Sandstone + - Smelt_Smooth_Sandstone + - Smelt_Smooth_Red_Sandstone + bricksmelter: + type: FCCUPGRADE + name: Brick Smelter + recipes: + - Smelt_Stone_Advanced + - Craft_Stonebricks_Basic + - Craft_Prismarine_Basic + - Craft_Netherbrick_Basic + - Upgrade_to_Stonebrick_Smelter + - Upgrade_to_Netherbrick_Smelter + - Upgrade_to_Aquatic_Brick_Smelter + advancedstonesmelter: + type: FCCUPGRADE + name: Advanced Stone Smelter + recipes: + - Smelt_Stone_Expert + - Craft_Polished_Andesite + - Craft_Polished_Diorite + - Craft_Polished_Granite + stonebricksmelter: + type: FCCUPGRADE + name: Stone Brick Smelter + recipes: + - Craft_Stonebricks_Advanced + - Craft_Stonebrick_Stairs + - Craft_Stonebrick_Slabs + - Craft_Chiselled_Stonebrick + - Craft_Cracked_Stonebrick + - Craft_Mossy_Stonebrick + netherbricksmelter: + type: FCCUPGRADE + name: Nether Brick Smelter + recipes: + - Smelt_Netherbrick_Advanced + - Craft_Netherbrick_Fence + - Craft_Netherbrick_Slabs + - Craft_Netherbrick_Stairs + aquaticstonesmelter: + type: FCCUPGRADE + name: Aquatic Brick Smelter + recipes: + - Smelt_Prismarine + - Smelt_Dark_Prismarine + - Smelt_Prismarine_Bricks + - Craft_Sea_Lanterns + quartzfactory: + type: FCCUPGRADE + name: Quartz Factory + recipes: + - Craft_Quartz_Slabs + - Craft_Quartz_Blocks + - Craft_Chiselled_Quartz_Blocks + - Craft_Pillar_Quartz_Blocks + - Craft_Quartz_Stairs + kiln: + type: FCCUPGRADE + name: Kiln + recipes: + - Smelt_Clay_Bricks + - Harden_Clay_Basic + - Upgrade_to_Advanced_Kiln + advancedkiln: + type: FCCUPGRADE + name: Advanced Kiln + recipes: + - Smelt_Brickblocks + - Harden_Clay_Advanced + - Craft_Flowerpots + woodprocessor: + type: FCCUPGRADE + name: Wood Processor + recipes: + - Burn_Charcoal_from_Logs_Basic + - Craft_Oak_Fence + - Cut_any_type_of_Plank_Basic + - Upgrade_to_Carpentry + - Upgrade_to_Fine_Woodworking + - Upgrade_to_Coal_Burner + carpentry: + type: FCCUPGRADE + name: Carpentry + recipes: + - Craft_Boat + - Cut_any_type_of_Plank_Advanced + - Craft_any_type_of_wooden_stair + - Craft_any_type_of_wooden_slab + - Craft_any_type_of_wooden_door + finewoodworking: + type: FCCUPGRADE + name: Fine Woodworking + recipes: + - Craft_any_type_of_fence + - Craft_any_type_of_fence_gate + - Craft_ladder + - Craft_trap_door + coalburner: + type: FCCUPGRADE + name: Coal Burner + recipes: + - Burn_Charcoal_from_Coal + - Burn_Charcoal_from_Logs_Advanced + farmsteadfactory: + type: FCCUPGRADE + name: Farmstead Factory + recipes: + - Bake_Bread_Basic + - Grill_Steak_Basic + - Create_Poppy_Basic + - Upgrade_to_Bakery + - Upgrade_to_Grill + - Upgrade_to_Soup_kitchen + - Upgrade_to_Bio_Lab + - Upgrade_to_Animal_Husbandry_Factory_Basic + bakery: + type: FCCUPGRADE + name: Bakery + recipes: + - Bake_Potatoes + - Bake_Bread_Advanced + - Bake_Cookies + - Bake_Cake + - Bake_Pumpkin_Pie + grill: + type: FCCUPGRADE + name: Grill + recipes: + - Grill_Steak_Advanced + - Grill_Beef + - Fry_Chicken + - Cook_Salmon + - Cook_Fish + - Cook_Mutton + - Cook_Rabbit + stewmaker: + type: FCCUPGRADE + name: Soup kitchen + recipes: + - Make_Rabbit_Stew + - Make_Mushroom_Stew + animalhusbandryfactorybasic: + type: FCCUPGRADE + name: Animal Husbandry Factory Basic + recipes: + - Craft_Saddles_Basic + - Dye_Wool_to_Red_Wool + - Dye_Wool_to_Yellow_Wool + - Dye_Wool_to_Green_Wool + - Upgrade_to_Wool_Processing + - Upgrade_to_Animal_Husbandry_Factory_Advanced + animalhusbandryfactoryadvanced: + type: FCCUPGRADE + name: Animal Husbandry Factory Advanced + recipes: + - Craft_Saddles_Advanced + - Create_Nametags + - Create_Leads + biolab: + type: FCCUPGRADE + name: Bio Lab + recipes: + - Create_Poppy_Advanced + - Mutate_Tall_Grass Basic + - Take_friendly_mob_egg_apart + - Create_Podzol_Basic + - Upgrade_to_Grass_Gardening + - Upgrade_to_Flower_Gardening + - Upgrade_to_Tree_Mutator + - Upgrade_to_Mad_Scientist + - Upgrade_to_Organic_Block_Factory + grassgardening: + type: FCCUPGRADE + name: Grass Gardening + recipes: + - Mutate_Tall_Grass Advanced + - Mutate_Large_Fern + - Kill_Dead_Bush + - Grow_Grass + - Grow_Fern + - Grow_Vine + - Kill_Dead_Shrub + flowergardening: + type: FCCUPGRADE + name: Flower Gardening + recipes: + - Create_any_flower + treemutator: + type: FCCUPGRADE + name: Tree Mutator + recipes: + - Mutate_any_sapling_into_any_other + - Mutate_any_leaf_into_any_other + madscientist: + type: FCCUPGRADE + name: Mad Scientist + recipes: + - Create_any_hostile_mob_egg + - Take_any_mob_egg_apart + organicblockfactory: + type: FCCUPGRADE + name: Organic Block Factory + recipes: + - Create_Podzol_Advanced + - Create_Coarse_Dirt + - Create_Mycelium + blacksmith: + type: FCCUPGRADE + name: Blacksmith + recipes: + - Forge_Stone_Sword + - Forge_Stone_Pickaxe + - Forge_Stone_Shovel + - Forge_Stone_Hoe + - Forge_Stone_Axe + - Upgrade_to_Iron_Forge_Basic + - Upgrade_to_Iron_Equipment_Forge + ironforgebasic: + type: FCCUPGRADE + name: Iron Forge Basic + recipes: + - Craft_Rail_Basic + - Craft_Buckets_Basic + - Craft_Anvils_Basic + - Upgrade_to_Iron_Forge_Advanced + - Upgrade_to_Rail_Factory + ironforgeadvanced: + type: FCCUPGRADE + name: Iron Forge Advanced + recipes: + - Craft_Shears + - Craft_Anvils_Advanced + - Craft_Buckets_Advanced + - Craft_Iron_Bars + - Craft_Iron_Door + - Craft_Flint_and_Steel + railfactory: + type: FCCUPGRADE + name: Rail Factory + recipes: + - Create_Rail_Advanced + - Create_Powered_Rail + - Create_Detector_Rail + - Create_Activator_Rail + ironequipmentforge: + type: FCCUPGRADE + name: Iron Equipment Forge + recipes: + - Forge_Iron_Pickaxe + - Forge_Iron_Shovel + - Forge_Iron_Axe + - Forge_Iron_Hoe + - Forge_Iron_Sword + - Forge_Iron_Helmet + - Forge_Iron_Boots + - Forge_Iron_Breastplate + - Forge_Iron_Leggings + - Forge_Iron_Horse_Armour + - Upgrade_to_Gold_Equipment_Forge + - Upgrade_to_Diamond_Equipment_Forge + goldequipmentforge: + type: FCCUPGRADE + name: Gold Equipment Forge + recipes: + - Forge_Gold_Pickaxe + - Forge_Gold_Shovel + - Forge_Gold_Breastplate + - Forge_Gold_Leggings + - Upgrade_to_Gold_Armour_Forge + - Upgrade_to_Gold_Tools_Forge + diamondequipmentforge: + type: FCCUPGRADE + name: Diamond Equipment Forge + recipes: + - Forge_Diamond_Pickaxe + - Forge_Diamond_Shovel + - Forge_Diamond_Breastplate + - Forge_Diamond_Leggings + - Upgrade_to_Diamond_Armour_Forge + - Upgrade_to_Diamond_Tools_Forge + goldarmourforge: + type: FCCUPGRADE + name: Gold Armour Forge + recipes: + - Forge_Gold_Helmet + - Forge_Gold_Boots + - Forge_Gold_Breastplate + - Forge_Gold_Leggings + - Forge_Gold_Horse_Armour + goldtoolsforge: + type: FCCUPGRADE + name: Gold Tools Forge + recipes: + - Forge_Gold_Pickaxe + - Forge_Gold_Shovel + - Forge_Gold_Axe + - Forge_Gold_Hoe + - Forge_Gold_Sword + diamondarmourforge: + type: FCCUPGRADE + name: Diamond Armour Forge + recipes: + - Forge_Diamond_Helmet + - Forge_Diamond_Boots + - Forge_Diamond_Breastplate + - Forge_Diamond_Leggings + - Forge_Diamond_Horse_Armour + diamondtoolsforge: + type: FCCUPGRADE + name: Diamond Tools Forge + recipes: + - Forge_Diamond_Pickaxe + - Forge_Diamond_Shovel + - Forge_Diamond_Axe + - Forge_Diamond_Hoe + - Forge_Diamond_Sword + laboratory: + type: FCCUPGRADE + name: Laboratory + recipes: + - Craft_Redstone_Repeater_Basic + - Craft_Dispenser_Basic + - Enchant_Efficiency + - Random_Printing_Press_Recipe + - Upgrade_to_Bastion_Factory + - Upgrade_to_Compactor_Basic + - Upgrade_to_Enchanter_Basic + - Upgrade_to_Printing_Press + - Upgrade_to_Redstone_Factory_Basic + bastionfactory: + type: FCCUPGRADE + name: Bastion Factory + recipes: + - Create_Bastion + printingpress: + type: FCCUPGRADE + name: Printing Press + recipes: + - foo + compactorbasic: + type: FCCUPGRADE + name: Compactor Basic + recipes: + - Compact_Stack_Basic + - De-compact_Stack_Basic + - Upgrade_to_Dedicated_Compactor + - Upgrade_to_Dedicated_De-Compactor + dedicatedcompactor: + type: FCCUPGRADE + name: Dedicated Compactor + recipes: + - Compact_Stack_Advanced + dedicateddecompactor: + type: FCCUPGRADE + name: Dedicated De-Compactor + recipes: + - De-compact_Stack_Advanced + redstonefactorybasic: + type: FCCUPGRADE + name: Redstone Factory Basic + recipes: + - Craft_Redstone_Repeater_Advanced + - Craft_Redstone_Torch_Basic + - Craft_Noteblocks_Basic + - Craft_Dispenser_Basic + - Upgrade_to_Redstone_Circularity_Factory + - Upgrade_to_Redstone_Mechanics_Factory + redstonecircularityfactory: + type: FCCUPGRADE + name: Redstone Circularity Factory + recipes: + - Craft_Redstone_Repeater_Advanced + - Craft_Redstone_Torch_Advanced + - Craft_Redstone_Comparator + - Craft_Daylight_Sensor + redstonemechanicsfactory: + type: FCCUPGRADE + name: Redstone Mechanics Factory + recipes: + - Craft_Piston + - Craft_Sticky_Piston + - Craft_Noteblocks_Advanced + - Craft_Jukeboxes + - Craft_Dispenser_Advanced + - Craft_Droppers + - Craft_Redstone_Lamps + basicenchanter: + type: FCCUPGRADE + name: Basic Enchanter + recipes: + - Upgrade_to_Tool_Enchanter + - Upgrade_to_Weapon_Enchanter + - Upgrade_to_Armour_Enchanter +recipes: + Bake_Bread_Advanced: + type: PRODUCTION + name: Bake Bread + production_time: 5s + input: + wheat: + material: WHEAT + amount: 256 + output: + bread: + material: BREAD + amount: 1024 + Bake_Bread_Basic: + type: PRODUCTION + name: Bake Bread + production_time: 5s + input: + wheat: + material: WHEAT + amount: 256 + output: + bread: + material: BREAD + amount: 512 + Bake_Cake: + type: PRODUCTION + name: Bake Cake + production_time: 5s + input: + wheat: + material: WHEAT + amount: 192 + sugar: + material: SUGAR + amount: 128 + eggs: + material: EGG + amount: 64 + milk: + material: MILK_BUCKET + amount: 10 + output: + cake: + material: CAKE + amount: 64 + Bake_Cookies: + type: PRODUCTION + name: Bake Cookies + production_time: 5s + input: + cocoa: + material: INK_SACK + durability: 3 + amount: 64 + wheat: + material: WHEAT + amount: 128 + output: + cookie: + material: COOKIE + amount: 1024 + Bake_Potatoes: + type: PRODUCTION + name: Bake Potatoes + production_time: 5s + input: + potato: + material: POTATO_ITEM + amount: 512 + output: + baked potato: + material: BAKED_POTATO + amount: 1024 + Bake_Pumpkin_Pie: + type: PRODUCTION + name: Bake Pumpkin Pie + production_time: 5s + input: + pumpkin: + material: PUMPKIN + amount: 64 + egg: + material: EGG + amount: 64 + sugar: + material: SUGAR + amount: 64 + output: + pumpkin pie: + material: PUMPKIN_PIE + amount: 192 + Burn_Charcoal_from_Coal: + type: PRODUCTION + name: Burn Charcoal from Coal + production_time: 5s + input: + coal: + material: COAL + amount: 64 + output: + charcoal: + material: COAL + amount: 128 + durability: 1 + Compact_Stack_Advanced: + type: COMPACT + name: Compact Stack + production_time: 1s + input: + crate: + material: CHEST + lore: + - Crate + amount: 1 + compact_lore: Compacted Item + excluded_materials: -BOOK + Compact_Stack_Basic: + type: COMPACT + name: Compact Stack + production_time: 5s + input: + crate: + material: CHEST + lore: + - Crate + amount: 1 + compact_lore: Compacted Item + excluded_materials: -BOOK + Convert_Normal_Sand_to_Red_Sand: + type: PRODUCTION + name: Convert Normal Sand to Red Sand + production_time: 5s + input: + sand: + material: SAND + amount: 64 + output: + red sand: + material: SAND + durability: 1 + amount: 64 + Cook_Fish: + type: PRODUCTION + name: Cook Fish + production_time: 5s + input: + raw fish: + material: RAW_FISH + amount: 64 + output: + cooked fish: + material: COOKED_FISH + amount: 64 + Cook_Mutton: + type: PRODUCTION + name: Cook Mutton + production_time: 5s + input: + raw mutton: + material: MUTTON + amount: 64 + output: + cooked mutton: + material: COOKED_MUTTON + amount: 128 + Cook_Rabbit: + type: PRODUCTION + name: Cook Rabbit + production_time: 5s + input: + raw rabbit: + material: RABBIT + amount: 64 + output: + cooked rabbit: + material: COOKED_RABBIT + amount: 128 + Cook_Salmon: + type: PRODUCTION + name: Cook Salmon + production_time: 5s + input: + raw salmon: + material: RAW_FISH + durability: 1 + amount: 64 + output: + cooked salmon: + material: COOKED_FISH + durability: 1 + amount: 128 + Craft_Anvils_Advanced: + type: PRODUCTION + name: Craft Anvils + production_time: 5s + input: + iron blocks: + material: IRON_BLOCK + amount: 32 + output: + anvil: + material: ANVIL + amount: 16 + Craft_Anvils_Basic: + type: PRODUCTION + name: Craft Anvils + production_time: 5s + input: + iron blocks: + material: IRON_BLOCK + amount: 32 + output: + anvil: + material: ANVIL + amount: 10 + Craft_any_type_of_fence: + type: PRODUCTION + name: Craft any type of fence + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Craft_any_type_of_fence_gate: + type: PRODUCTION + name: Craft any type of fence gate + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Craft_any_type_of_wooden_door_: + type: PRODUCTION + name: Craft any type of wooden door + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Craft_any_type_of_wooden_slab: + type: PRODUCTION + name: Craft any type of wooden slab + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Craft_any_type_of_wooden_stair_: + type: PRODUCTION + name: Craft any type of wooden stair + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Craft_Boat: + type: PRODUCTION + name: Craft Boat + production_time: 5s + input: + wood: + material: WOOD + amount: 64 + output: + boat: + material: BOAT + amount: 18 + Craft_Buckets_Advanced: + type: PRODUCTION + name: Craft Buckets + production_time: 5s + input: + iron blocks: + material: IRON_BLOCK + amount: 4 + output: + bucket: + material: BUCKET + amount: 16 + Craft_Buckets_Basic: + type: PRODUCTION + name: Craft Buckets + production_time: 5s + input: + iron blocks: + material: IRON_BLOCK + amount: 5 + output: + bucket: + material: BUCKET + amount: 16 + Craft_Chiselled_Quartz_Blocks: + type: PRODUCTION + name: Craft Chiselled Quartz Blocks + production_time: 5s + input: + quartz blocks: + material: QUARTZ_BLOCK + amount: 32 + output: + chhiseled quartz blocks: + material: QUARTZ_BLOCK + durability: 1 + amount: 32 + Craft_Chiselled_Stonebrick: + type: PRODUCTION + name: Craft Chiselled Stonebrick + production_time: 5s + input: + stone brick: + material: SMOOTH_BRICK + amount: 16 + flint: + material: FLINT + amount: 2 + output: + chiseled stone brick: + material: SMOOTH_BRICK + durability: 3 + amount: 16 + Craft_Cracked_Stonebrick: + type: PRODUCTION + name: Craft Cracked Stonebrick + production_time: 5s + input: + stone brick: + material: SMOOTH_BRICK + amount: 16 + gravel: + material: GRAVEL + amount: 2 + output: + chiseled stone brick: + material: SMOOTH_BRICK + durability: 2 + amount: 16 + Craft_Daylight_Sensor: + type: PRODUCTION + name: Craft Daylight Sensor + production_time: 5s + input: + planks: + material: WOOD + durability: -1 + amount: 64 + glass: + material: GLASS + amount: 64 + quartz: + material: QUARTZ + amount: 64 + output: + daylight sensor: + material: DAYLIGHT_DETECTOR + amount: 32 + Craft_Dispenser_Advanced: + type: PRODUCTION + name: Craft Dispenser + production_time: 5s + input: + cobblestone: + material: COBBLESTONE + amount: 192 + string: + material: STRING + amount: 32 + stick: + material: STICK + amount: 32 + redstone: + material: REDSTONE + amount: 32 + output: + dispenser: + material: DISPENSER + amount: 64 + Craft_Dispenser_Basic: + type: PRODUCTION + name: Craft Dispenser + production_time: 5s + input: + cobblestone: + material: COBBLESTONE + amount: 192 + string: + material: STRING + amount: 32 + stick: + material: STICK + amount: 32 + redstone: + material: REDSTONE + amount: 32 + output: + dispenser: + material: DISPENSER + amount: 48 + Craft_Droppers: + type: PRODUCTION + name: Craft Droppers + production_time: 5s + input: + cobblestone: + material: COBBLESTONE + amount: 192 + redstone: + material: REDSTONE + amount: 32 + output: + dispenser: + material: DROPPER + amount: 48 + Craft_Flint_and_Steel: + type: PRODUCTION + name: Craft Flint and Steel + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 12 + flint: + material: FLINT + amount: 12 + output: + flint and steel: + material: FLINT_AND_STEEL + amount: 16 + Craft_Flowerpots: + type: PRODUCTION + name: Craft Flowerpots + production_time: 5s + input: + brick: + material: BRICK + amount: 32 + output: + flower pot: + material: FLOWER_POT_ITEM + amount: 64 + Craft_Iron_Bars: + type: PRODUCTION + name: Craft Iron Bars + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 16 + output: + iron bars: + material: IRON_FENCE + amount: 64 + Craft_Iron_Door: + type: PRODUCTION + name: Craft Iron Door + production_time: 5s + input: + iron: + material: IRON_FENCE + amount: 16 + output: + iron door: + material: IRON_DOOR + amount: 10 + Craft_Jukeboxes: + type: PRODUCTION + name: Craft Jukeboxes + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 48 + log: + material: LOG + durability: -1 + amount: 32 + output: + jukebox: + material: JUKEBOX + amount: 64 + Craft_ladder: + type: PRODUCTION + name: Craft ladder + production_time: 5s + input: + stick: + material: STICK + amount: 32 + output: + ladder: + material: LADDER + amount: 16 + Craft_Mossy_Stonebrick: + type: PRODUCTION + name: Craft Mossy Stonebrick + production_time: 5s + input: + stone brick: + material: SMOOTH_BRICK + amount: 16 + vine: + material: VINE + amount: 2 + output: + chiseled stone brick: + material: SMOOTH_BRICK + durability: 1 + amount: 16 + Craft_Netherbrick_Basic: + type: PRODUCTION + name: Craft Netherbrick + production_time: 5s + input: + netherrack: + material: NETHERRACK + amount: 64 + output: + netherbrick: + material: NETHER_BRICK + amount: 32 + Craft_Netherbrick_Fence: + type: PRODUCTION + name: Craft Netherbrick Fence + production_time: 5s + input: + nether brick: + material: NETHER_BRICK + amount: 48 + output: + nether brick fence: + material: NETHER_FENCE + amount: 64 + Craft_Netherbrick_Slabs: + type: PRODUCTION + name: Craft Netherbrick Slabs + production_time: 5s + input: + nether brick: + material: NETHER_BRICK + amount: 64 + output: + nether brick slabs: + material: STEP + durability: 6 + amount: 128 + Craft_Netherbrick_Stairs: + type: PRODUCTION + name: Craft Netherbrick Stairs + production_time: 5s + input: + nether brick: + material: NETHER_BRICK + amount: 64 + output: + nether brick stairs: + material: NETHER_BRICK_STAIRS + amount: 48 + Craft_Noteblocks_Advanced: + type: PRODUCTION + name: Craft Noteblocks + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 48 + planks: + material: WOOD + durability: -1 + amount: 128 + output: + note block: + material: NOTE_BLOCK + amount: 64 + Craft_Noteblocks_Basic: + type: PRODUCTION + name: Craft Noteblocks + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 64 + planks: + material: WOOD + durability: -1 + amount: 128 + output: + note block: + material: NOTE_BLOCK + amount: 64 + Craft_Oak_Fence: + type: PRODUCTION + name: Craft Oak Fence + production_time: 5s + input: + oak log: + material: LOG + amount: 16 + output: + identifiername: + material: STONE + amount: 48 + Craft_Pillar_Quartz_Blocks: + type: PRODUCTION + name: Craft Pillar Quartz Blocks + production_time: 5s + input: + quartz block: + material: QUARTZ_BLOCK + amount: 32 + output: + pillar quartz block: + material: QUARTZ_BLOCK + durability: 2 + amount: 32 + Craft_Piston: + type: PRODUCTION + name: Craft Piston + production_time: 5s + input: + cobblestone: + material: COBBLESTONE + amount: 128 + redstone: + material: REDSTONE + amount: 48 + iron: + material: IRON_INGOT + amount: 48 + planks: + material: WOOD + durability: -1 + amount: 192 + output: + piston: + material: PISTON_BASE + amount: 64 + Craft_Polished_Andesite: + type: PRODUCTION + name: Craft Polished Andesite + production_time: 5s + input: + andesite: + material: STONE + durability: 5 + amount: 64 + output: + polished andesite: + material: STONE + durability: 6 + amount: 64 + Craft_Polished_Diorite: + type: PRODUCTION + name: Craft Polished Diorite + production_time: 5s + input: + andesite: + material: STONE + durability: 3 + amount: 64 + output: + polished andesite: + material: STONE + durability: 4 + amount: 64 + Craft_Polished_Granite: + type: PRODUCTION + name: Craft Polished Granite + production_time: 5s + input: + andesite: + material: STONE + durability: 1 + amount: 64 + output: + polished andesite: + material: STONE + durability: 2 + amount: 64 + Craft_Prismarine_Basic: + type: PRODUCTION + name: Craft Prismarine + production_time: 5s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 64 + output: + orismarine: + material: PRISMARINE + amount: 32 + Craft_Quartz_Blocks: + type: PRODUCTION + name: Craft Quartz Blocks + production_time: 5s + input: + quartz: + material: QUARTZ + amount: 64 + output: + quartz block: + material: QUARTZ_BLOCK + amount: 32 + Craft_Quartz_Slabs: + type: PRODUCTION + name: Craft Quartz Slabs + production_time: 5s + input: + quartz block: + material: QUARTZ_BLOCK + amount: 64 + output: + quartz slab: + material: STEP + durability: 7 + amount: 128 + Craft_Quartz_Stairs: + type: PRODUCTION + name: Craft Quartz Stairs + production_time: 5s + input: + quartz block: + material: QUARTZ_BLOCK + amount: 64 + output: + quartz stairs: + material: QUARTZ_STAIRS + amount: 48 + Craft_Rail_Basic: + type: PRODUCTION + name: Craft Rail Basic + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 32 + stick: + material: STICK + amount: 4 + output: + rail: + material: RAILS + amount: 96 + Craft_Redstone_Comparator: + type: PRODUCTION + name: Craft Redstone Comparator + production_time: 5s + input: + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + quartz: + material: QUARTZ + amount: 32 + stone: + material: STONE + amount: 64 + output: + comparator: + material: REDSTONE_COMPARATOR + amount: 32 + Craft_Redstone_Lamps: + type: PRODUCTION + name: Craft Redstone Lamps + production_time: 5s + input: + glowstone: + material: GLOWSTONE + amount: 32 + redstone: + material: REDSTONE + amount: 128 + output: + redstone lamp: + material: REDSTONE_LAMP_OFF + amount: 48 + Craft_Redstone_Repeater_Advanced: + type: PRODUCTION + name: Craft Redstone Repeater + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 32 + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + stone: + material: STONE + amount: 96 + output: + redstone repeater: + material: DIODE + amount: 64 + Craft_Redstone_Repeater_Basic: + type: PRODUCTION + name: Craft Redstone Repeater + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 32 + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + stone: + material: STONE + amount: 96 + output: + redstone repeater: + material: DIODE + amount: 48 + Craft_Redstone_Torch_Advanced: + type: PRODUCTION + name: Craft Redstone Torch + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 32 + stick: + material: STICK + amount: 32 + output: + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + Craft_Redstone_Torch_Basic: + type: PRODUCTION + name: Craft Redstone Torch + production_time: 5s + input: + redstone: + material: REDSTONE + amount: 32 + stick: + material: STICK + amount: 32 + output: + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + Craft_Saddles_Advanced: + type: PRODUCTION + name: Craft Saddles + production_time: 5s + input: + leather: + material: LEATHER + amount: 32 + iron: + material: IRON_INGOT + amount: 16 + output: + saddle: + material: SADDLE + amount: 16 + Craft_Saddles_Basic: + type: PRODUCTION + name: Craft Saddles + production_time: 5s + input: + leather: + material: LEATHER + amount: 32 + iron: + material: IRON_INGOT + amount: 32 + output: + saddle: + material: SADDLE + amount: 16 + Craft_Sea_Lanterns: + type: PRODUCTION + name: Craft Sea Lanterns + production_time: 5s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 48 + prismarine crystal: + material: PRISMARINE_CRYSTALS + amount: 64 + output: + sea lantern: + material: SEA_LANTERN + amount: 16 + Craft_Shears: + type: PRODUCTION + name: Craft Shears + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 16 + output: + shears: + material: SHEARS + amount: 10 + Craft_Sticky_Piston: + type: PRODUCTION + name: Craft Sticky Piston + production_time: 5s + input: + cobblestone: + material: COBBLESTONE + amount: 128 + redstone: + material: REDSTONE + amount: 48 + iron: + material: IRON_INGOT + amount: 48 + planks: + material: WOOD + durability: -1 + amount: 192 + slime: + material: SLIME_BALL + amount: 48 + output: + piston: + material: PISTON_STICKY_BASE + amount: 64 + Craft_Stonebrick_Slabs: + type: PRODUCTION + name: Craft Stonebrick Slabs + production_time: 5s + input: + stone brick: + material: SMOOTH_BRICK + amount: 64 + output: + stone brick stairs: + material: STEP + durability: 5 + amount: 128 + Craft_Stonebrick_Stairs_: + type: PRODUCTION + name: Craft Stonebrick Stairs + production_time: 5s + input: + stone brick: + material: SMOOTH_BRICK + amount: 64 + output: + stone brick stair: + material: SMOOTH_STAIRS + amount: 48 + Craft_Stonebricks_Advanced: + type: PRODUCTION + name: Craft Stonebricks + production_time: 5s + input: + stone: + material: STONE + amount: 64 + output: + stone brick: + material: SMOOTH_BRICK + amount: 128 + Craft_Stonebricks_Basic: + type: PRODUCTION + name: Craft Stonebricks + production_time: 5s + input: + stone: + material: STONE + amount: 64 + output: + stone brick: + material: SMOOTH_BRICK + amount: 96 + Craft_trap_door: + type: PRODUCTION + name: Craft trap door + production_time: 5s + input: + planks: + material: WOOD + durability: -1 + amount: 64 + output: + trapdoor: + material: TRAP_DOOR + amount: 128 + Create_Activator_Rail: + type: PRODUCTION + name: Create Activator Rail + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 32 + stick: + material: STICK + amount: 8 + redstone torch: + material: REDSTONE_TORCH_ON + amount: 4 + output: + activator rail: + material: ACTIVATOR_RAIL + amount: 96 + Create_any_flower: + type: PRODUCTION + name: Create any flower + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Create_any_hostile_mob_egg: + type: PRODUCTION + name: Create any hostile mob egg + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Create_Bastion_: + type: PRODUCTION + name: Create Bastion + production_time: 5s + input: + admin tears: + material: GHAST_TEAR + amount: 4 + lore: + - Sadmins_are_sad + tealnerd is bae: + material: WOOL + durability: 9 + amount: 4 + lore: + - Teal_makes_great_configs + glitchwood: + material: LOG + amount: 1 + lore: + - All_hail_the_mighty_Glitchwood + - There_can_be_only_one! + output: + bastion: + material: SPONGE + amount: 16 + lore: + - A_bastion_block + Create_Coarse_Dirt: + type: PRODUCTION + name: Create Coarse Dirt + production_time: 5s + input: + dirt: + material: DIRT + amount: 64 + output: + coarse dirt: + material: DIRT + amount: 64 + durability: 1 + Create_Detector_Rail: + type: PRODUCTION + name: Create Detector Rail + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 32 + redstone: + material: REDSTONE + amount: 4 + output: + detector rail: + material: DETECTOR_RAIL + amount: 96 + Create_Leads: + type: PRODUCTION + name: Create Leads + production_time: 5s + input: + slime: + material: SLIME_BALL + amount: 12 + string: + material: STRING + amount: 48 + output: + lead: + material: LEASH + amount: 16 + Create_Mycelium_: + type: PRODUCTION + name: Create Mycelium + production_time: 5s + input: + grass: + material: GRASS + amount: 64 + output: + mycelium: + material: MYCEL + amount: 64 + Create_Nametags_: + type: PRODUCTION + name: Create Nametags + production_time: 5s + input: + paper: + material: PAPER + amount: 16 + string: + material: STRING + amount: 8 + slime: + material: SLIME_BALL + amount: 4 + output: + nametag: + material: NAME_TAG + amount: 8 + Create_Podzol_Advanced: + type: PRODUCTION + name: Create Podzol Advanced + production_time: 5s + input: + dirt: + material: DIRT + amount: 64 + output: + podzol: + material: DIRT + durability: 2 + amount: 128 + Create_Podzol_Basic: + type: PRODUCTION + name: Create Podzol Basic + production_time: 5s + input: + dirt: + material: DIRT + amount: 64 + output: + podzol: + material: DIRT + durability: 2 + amount: 64 + Create_Poppy_Advanced: + type: PRODUCTION + name: Create Poppy Advanced + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Create_Poppy_Basic: + type: PRODUCTION + name: Create Poppy Basic + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Create_Powered_Rail: + type: PRODUCTION + name: Create Powered Rail + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 32 + redstone: + material: REDSTONE + amount: 4 + output: + powered rail: + material: POWERED_RAIL + amount: 96 + Create_Rail_Advanced: + type: PRODUCTION + name: Create Rail + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 32 + output: + rail: + material: RAILS + amount: 128 + Cut_any_type_of_Plank_Advanced: + type: PRODUCTION + name: Cut any type of Plank Advanced + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Cut_any_type_of_Plank_Basic: + type: PRODUCTION + name: Cut any type of Plank Basic + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + De-compact_Stack_Advanced: + type: DECOMPACT + name: De-compact Stack + production_time: 1s + compact_lore: Compacted item + De-compact_Stack_Basic: + type: DECOMPACT + name: De-compact Stack + production_time: 5s + compact_lore: Compacted item + Dye_Wool_to_Green_Wool: + type: PRODUCTION + name: Dye Wool to Green Wool + production_time: 5s + input: + wool: + material: WOOL + amount: 64 + dye: + material: INK_SACK + durability: 2 + amount: 4 + output: + green wool: + material: WOOL + durability: 13 + amount: 64 + Dye_Wool_to_Red_Wool: + type: PRODUCTION + name: Dye Wool to Red Wool + production_time: 5s + input: + wool: + material: WOOL + amount: 64 + dye: + material: INK_SACK + durability: 1 + amount: 4 + output: + green wool: + material: WOOL + durability: 14 + amount: 64 + Dye_Wool_to_Yellow_Wool: + type: PRODUCTION + name: Dye Wool to Yellow Wool + production_time: 5s + input: + wool: + material: WOOL + amount: 64 + dye: + material: INK_SACK + durability: 11 + amount: 4 + output: + green wool: + material: WOOL + durability: 4 + amount: 64 + Enchant_Efficiency_: + type: PRODUCTION + name: Enchant Efficiency + production_time: 5s + input: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 1 + emerald block: + material: EMERALD_BLOCK + amount: 4 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 1 + enchants: + efficiency: + enchant: DIG_SPEED + level: 5 + Extract_Diamonds: + type: PRODUCTION + name: Extract Diamonds + production_time: 5s + input: + diamond ore: + material: DIAMOND_ORE + amount: 16 + output: + diamond: + material: DIAMOND + amount: 32 + Extract_Emeralds: + type: PRODUCTION + name: Extract Emeralds + production_time: 5s + input: + emerald ore: + material: EMERALD_ORE + amount: 4 + output: + emerald: + material: EMERALD + amount: 6 + Extract_Lapis: + type: PRODUCTION + name: Extract Lapis + production_time: 5s + input: + lapis ore: + material: LAPIS_ORE + amount: 32 + output: + lapis: + material: INK_SACK + durability: 4 + amount: 128 + Extract_Quartz_Advanced: + type: PRODUCTION + name: Extract Quartz + production_time: 5s + input: + quartz ore: + material: QUARTZ_ORE + amount: 32 + output: + quartz: + material: QUARTZ + amount: 128 + Extract_Quartz_Basic: + type: PRODUCTION + name: Extract Quartz + production_time: 5s + input: + quartz ore: + material: QUARTZ_ORE + amount: 32 + output: + quartz: + material: QUARTZ + amount: 96 + Extract_Redstone_Advanced: + type: PRODUCTION + name: Extract Redstone + production_time: 5s + input: + redstone ore: + material: REDSTONE_ORE + amount: 64 + output: + redstone: + material: REDSTONE + amount: 256 + Extract_Redstone_Basic: + type: PRODUCTION + name: Extract Redstone + production_time: 5s + input: + redstone ore: + material: REDSTONE_ORE + amount: 64 + output: + redstone: + material: REDSTONE + amount: 128 + Forge_Diamond_Axe: + type: PRODUCTION + name: Forge Diamond Axe + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 16 + output: + diamond axe: + material: DIAMOND_AXE + amount: 8 + Forge_Diamond_Boots: + type: PRODUCTION + name: Forge Diamond Boots + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 24 + output: + diamond boots: + material: DIAMOND_BOOTS + amount: 8 + Forge_Diamond_Breastplate: + type: PRODUCTION + name: Forge Diamond Breastplate + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 48 + output: + diamond chestplate: + material: DIAMOND_CHESTPLATE + amount: 8 + Forge_Diamond_Helmet: + type: PRODUCTION + name: Forge Diamond Helmet + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 32 + output: + diamond helmet: + material: DIAMOND_HELMET + amount: 8 + Forge_Diamond_Hoe: + type: PRODUCTION + name: Forge Diamond Hoe + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 8 + output: + diamond hoe: + material: DIAMOND_HOE + amount: 8 + Forge_Diamond_Horse_Armour: + type: PRODUCTION + name: Forge Diamond Horse Armour + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 12 + output: + diamond horse armor: + material: DIAMOND_BARDING + amount: 1 + Forge_Diamond_Leggings_: + type: PRODUCTION + name: Forge Diamond Leggings + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 40 + output: + diamond leggings: + material: DIAMOND_LEGGINGS + amount: 8 + Forge_Diamond_Pickaxe: + type: PRODUCTION + name: Forge Diamond Pickaxe + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 16 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 8 + Forge_Diamond_Shovel: + type: PRODUCTION + name: Forge Diamond Shovel + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 6 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 8 + Forge_Diamond_Sword: + type: PRODUCTION + name: Forge Diamond Sword + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 10 + output: + diamond sword: + material: DIAMOND_SWORD + amount: 8 + Forge_Gold_Axe: + type: PRODUCTION + name: Forge Gold Axe + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 16 + output: + gold axe: + material: GOLD_AXE + amount: 8 + Forge_Gold_Boots: + type: PRODUCTION + name: Forge Gold Boots + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 24 + output: + gold boots: + material: GOLD_BOOTS + amount: 8 + Forge_Gold_Breastplate: + type: PRODUCTION + name: Forge Gold Breastplate + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 48 + output: + gold chestplate: + material: GOLD_CHESTPLATE + amount: 8 + Forge_Gold_Helmet: + type: PRODUCTION + name: Forge Gold Helmet + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 32 + output: + gold helmet: + material: GOLD_HELMET + amount: 8 + Forge_Gold_Hoe: + type: PRODUCTION + name: Forge Gold Hoe + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 8 + output: + gold hoe: + material: GOLD_HOE + amount: 8 + Forge_Gold_Horse_Armour: + type: PRODUCTION + name: Forge Gold Horse Armour + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 12 + output: + gold horse armor: + material: GOLD_BARDING + amount: 1 + Forge_Gold_Leggings_: + type: PRODUCTION + name: Forge Gold Leggings + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 40 + output: + gold leggings: + material: GOLD_LEGGINGS + amount: 8 + Forge_Gold_Pickaxe: + type: PRODUCTION + name: Forge Gold Pickaxe + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 16 + output: + gold pickaxe: + material: GOLD_PICKAXE + amount: 8 + Forge_Gold_Shovel: + type: PRODUCTION + name: Forge Gold Shovel + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 6 + output: + gold pickaxe: + material: GOLD_PICKAXE + amount: 8 + Forge_Gold_Sword: + type: PRODUCTION + name: Forge Gold Sword + production_time: 5s + input: + gold: + material: GOLD_INGOT + amount: 10 + output: + gold sword: + material: GOLD_SWORD + amount: 8 + Forge_Iron_Axe: + type: PRODUCTION + name: Forge Iron Axe + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 16 + output: + iron axe: + material: IRON_AXE + amount: 8 + Forge_Iron_Boots: + type: PRODUCTION + name: Forge Iron Boots + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 24 + output: + iron boots: + material: IRON_BOOTS + amount: 8 + Forge_Iron_Breastplate: + type: PRODUCTION + name: Forge Iron Breastplate + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 48 + output: + iron chestplate: + material: IRON_CHESTPLATE + amount: 8 + Forge_Iron_Helmet: + type: PRODUCTION + name: Forge Iron Helmet + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 32 + output: + iron helmet: + material: IRON_HELMET + amount: 8 + Forge_Iron_Hoe: + type: PRODUCTION + name: Forge Iron Hoe + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 8 + output: + iron hoe: + material: IRON_HOE + amount: 8 + Forge_Iron_Horse_Armour: + type: PRODUCTION + name: Forge Iron Horse Armour + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 12 + output: + iron horse armor: + material: IRON_BARDING + amount: 1 + Forge_Iron_Leggings_: + type: PRODUCTION + name: Forge Iron Leggings + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 40 + output: + iron leggings: + material: IRON_LEGGINGS + amount: 8 + Forge_Iron_Pickaxe: + type: PRODUCTION + name: Forge Iron Pickaxe + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 16 + output: + iron pickaxe: + material: IRON_PICKAXE + amount: 8 + Forge_Iron_Shovel: + type: PRODUCTION + name: Forge Iron Shovel + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 6 + output: + iron pickaxe: + material: IRON_PICKAXE + amount: 8 + Forge_Iron_Sword: + type: PRODUCTION + name: Forge Iron Sword + production_time: 5s + input: + iron: + material: IRON_INGOT + amount: 10 + output: + iron sword: + material: IRON_SWORD + amount: 8 + Forge_Stone_Axe: + type: PRODUCTION + name: Forge Stone Axe + production_time: 5s + input: + stone: + material: STONE + amount: 16 + output: + stone axe: + material: STONE_AXE + amount: 8 + Forge_Stone_Hoe: + type: PRODUCTION + name: Forge Stone Hoe + production_time: 5s + input: + stone: + material: STONE + amount: 8 + output: + stone hoe: + material: STONE_HOE + amount: 8 + Forge_Stone_Pickaxe: + type: PRODUCTION + name: Forge Stone Pickaxe + production_time: 5s + input: + stone: + material: STONE + amount: 16 + output: + stone pickaxe: + material: STONE_PICKAXE + amount: 8 + Forge_Stone_Shovel: + type: PRODUCTION + name: Forge Stone Shovel + production_time: 5s + input: + stone: + material: STONE + amount: 6 + output: + stone pickaxe: + material: STONE_PICKAXE + amount: 8 + Forge_Stone_Sword: + type: PRODUCTION + name: Forge Stone Sword + production_time: 5s + input: + stone: + material: STONE + amount: 10 + output: + stone sword: + material: STONE_SWORD + amount: 8 + Fry_Chicken: + type: PRODUCTION + name: Fry Chicken + production_time: 5s + input: + chicken: + material: RAW_CHICKEN + amount: 32 + output: + cooked chicken: + material: COOKED_CHICKEN + amount: 64 + Grill_Beef: + type: PRODUCTION + name: Grill Beef + production_time: 5s + input: + beef: + material: RAW_BEEF + amount: 32 + output: + cooked beef: + material: COOKED_BEEF + amount: 64 + Grill_Steak_Advanced: + type: PRODUCTION + name: Grill Steak + production_time: 5s + input: + beef: + material: RAW_BEEF + amount: 32 + output: + cooked beef: + material: COOKED_BEEF + amount: 64 + Grill_Steak_Basic: + type: PRODUCTION + name: Grill Steak + production_time: 5s + input: + beef: + material: RAW_BEEF + amount: 32 + output: + cooked beef: + material: COOKED_BEEF + amount: 48 + Grow_Fern: + type: PRODUCTION + name: Grow Fern + production_time: 5s + input: + fern: + material: LONG_GRASS + amount: 32 + durability: 2 + output: + large fern: + material: DOUBLE_PLANT + amount: 32 + durability: 3 + Grow_Grass: + type: PRODUCTION + name: Grow Grass + production_time: 5s + input: + grass: + material: LONG_GRASS + amount: 64 + durability: 1 + output: + double tall grass: + material: DOUBLE_PLANT + amount: 64 + durability: 2 + Grow_Vine: + type: PRODUCTION + name: Grow Vine + production_time: 5s + input: + grass: + material: LONG_GRASS + amount: 64 + output: + vine: + material: VINE + amount: 64 + Harden_Clay_Advanced: + type: PRODUCTION + name: Harden Clay + production_time: 5s + input: + clay: + material: CLAY + amount: 48 + output: + hard clay: + material: HARD_CLAY + amount: 64 + Harden_Clay_Basic: + type: PRODUCTION + name: Harden Clay + production_time: 5s + input: + clay: + material: CLAY + amount: 64 + output: + hard clay: + material: HARD_CLAY + amount: 64 + Kill_Dead_Bush: + type: PRODUCTION + name: Kill Dead Bush + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Kill_Dead_Shrub: + type: PRODUCTION + name: Kill Dead Shrub + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Make_Mushroom_Stew: + type: PRODUCTION + name: Make Mushroom Stew + production_time: 5s + input: + brown mushroom: + material: BROWN_MUSHROOM + amount: 16 + red mushroom: + material: RED_MUSHROOM + amount: 16 + planks: + material: WOOD + durability: -1 + amount: 32 + output: + mushroom stew: + material: MUSHROOM_SOUP + amount: 18 + Make_Rabbit_Stew: + type: PRODUCTION + name: Make Rabbit Stew + production_time: 5s + input: + rabbit: + material: COOKED_RABBIT + amount: 16 + baked potato: + material: BAKED_POTATO + amount: 16 + planks: + material: WOOD + durability: -1 + amount: 32 + output: + rabbit stew: + material: RABBIT_STEW + amount: 18 + Mutate_any_leaf_into_any_other: + type: PRODUCTION + name: Mutate any leaf into any other + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Mutate_any_sapling_into_any_other: + type: PRODUCTION + name: Mutate any sapling into any other + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Mutate_Large_Fern_: + type: PRODUCTION + name: Mutate Large Fern + production_time: 5s + input: + fern: + material: LONG_GRASS + amount: 32 + durability: 2 + output: + large fern: + material: DOUBLE_PLANT + amount: 32 + durability: 3 + Mutate_Tall_Grass_Advanced: + type: PRODUCTION + name: Mutate Tall Grass Advanced + production_time: 5s + input: + fern: + material: LONG_GRASS + amount: 32 + durability: 1 + output: + large fern: + material: DOUBLE_PLANT + amount: 32 + durability: 2 + Mutate_Tall_Grass_Basic: + type: PRODUCTION + name: Mutate Tall Grass Basic + production_time: 5s + input: + fern: + material: LONG_GRASS + amount: 32 + durability: 1 + output: + large fern: + material: DOUBLE_PLANT + amount: 32 + durability: 2 + Random_Printing_Press_Recipe_: + type: PRODUCTION + name: Random Printing Press Recipe + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Smelt_Brickblocks: + type: PRODUCTION + name: Smelt Brickblocks + production_time: 5s + input: + clay: + material: CLAY + amount: 48 + output: + bricks: + material: BRICK + amount: 64 + Smelt_Chiselled_Red_Sandstone: + type: PRODUCTION + name: Smelt Chiselled Red Sandstone + production_time: 5s + input: + red sandstone: + material: RED_SANDSTONE + amount: 48 + output: + chiseled red sandstone: + material: RED_SANDSTONE + durability: 1 + amount: 64 + Smelt_Chiselled_Sandstone_: + type: PRODUCTION + name: Smelt Chiselled Sandstone + production_time: 5s + input: + sandstone: + material: SANDSTONE + amount: 48 + output: + chiseled sandstone: + material: SANDSTONE + durability: 1 + amount: 64 + Smelt_Clay_Bricks: + type: PRODUCTION + name: Smelt Clay Bricks + production_time: 5s + input: + clay: + material: CLAY + amount: 16 + output: + bricks: + material: BRICK + amount: 64 + Smelt_Coal_Ore_Advanced: + type: PRODUCTION + name: Smelt Coal Ore Advanced + production_time: 5s + input: + coal ore: + material: COAL_ORE + amount: 64 + output: + coal: + material: COAL + amount: 256 + Smelt_Coal_Ore_Basic: + type: PRODUCTION + name: Smelt Coal Ore Basic + production_time: 5s + input: + coal ore: + material: COAL_ORE + amount: 64 + output: + coal: + material: COAL + amount: 192 + Smelt_Coal_Ore_Expert: + type: PRODUCTION + name: Smelt Coal Ore Expert + production_time: 5s + input: + coal ore: + material: COAL_ORE + amount: 64 + output: + coal: + material: COAL + amount: 384 + Smelt_Dark_Prismarine: + type: PRODUCTION + name: Smelt Dark Prismarine + production_time: 5s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 64 + ink sack: + material: INK_SACK + amount: 8 + output: + dark prismarine: + material: PRISMARINE + durability: 2 + amount: 10 + Smelt_Glass_Advanced: + type: PRODUCTION + name: Smelt Glass + production_time: 5s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 128 + Smelt_Glass_Basic: + type: PRODUCTION + name: Smelt Glass + production_time: 5s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 96 + Smelt_Glass_Expert: + type: PRODUCTION + name: Smelt Glass + production_time: 5s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 192 + Smelt_Glass_Panes_Advanced: + type: PRODUCTION + name: Smelt Glass Panes + production_time: 5s + input: + sand: + material: SAND + amount: 16 + output: + glass pane: + material: THIN_GLASS + amount: 96 + Smelt_Glass_Panes_Basic: + type: PRODUCTION + name: Smelt Glass Panes + production_time: 5s + input: + sand: + material: SAND + amount: 16 + output: + glass pane: + material: THIN_GLASS + amount: 64 + Smelt_Glassbottles: + type: PRODUCTION + name: Smelt Glassbottles + production_time: 5s + input: + sand: + material: SAND + amount: 32 + output: + glass bottle: + material: GLASS_BOTTLE + amount: 128 + Smelt_Gold_Ore: + type: PRODUCTION + name: Smelt Gold Ore + production_time: 5s + input: + gold ore: + material: GOLD_ORE + amount: 16 + output: + gold: + material: GOLD_INGOT + amount: 64 + Smelt_Iron_Ore_Advanced: + type: PRODUCTION + name: Smelt Iron Ore + production_time: 5s + input: + iron ore: + material: IRON_ORE + amount: 64 + output: + iron: + material: IRON_INGOT + amount: 192 + Smelt_Iron_Ore_Basic: + type: PRODUCTION + name: Smelt Iron Ore + production_time: 5s + input: + iron ore: + material: IRON_ORE + amount: 64 + output: + iron: + material: IRON_INGOT + amount: 128 + Smelt_Netherbrick_Advanced: + type: PRODUCTION + name: Smelt Netherbrick Advanced + production_time: 5s + input: + netherrack: + material: NETHERRACK + amount: 64 + output: + netherbrick: + material: NETHER_BRICK + amount: 48 + Smelt_Prismarine: + type: PRODUCTION + name: Smelt Prismarine + production_time: 5s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 64 + output: + prismarine: + material: PRISMARINE + amount: 32 + Smelt_Prismarine_Bricks: + type: PRODUCTION + name: Smelt Prismarine Bricks + production_time: 5s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 64 + output: + prismarine brick: + material: PRISMARINE + durability: 1 + amount: 8 + Smelt_Red_Sandstone_Advanced: + type: PRODUCTION + name: Smelt Red Sandstone + production_time: 5s + input: + red sand: + material: SAND + durability: 1 + amount: 64 + output: + red sandstone: + material: RED_SANDSTONE + amount: 48 + Smelt_Red_Sandstone_Basic: + type: PRODUCTION + name: Smelt Red Sandstone + production_time: 5s + input: + red sand: + material: SAND + durability: 1 + amount: 64 + output: + red sandstone: + material: RED_SANDSTONE + amount: 32 + Smelt_Red_Sandstone_Slabs: + type: PRODUCTION + name: Smelt Red Sandstone Slabs + production_time: 5s + input: + red sand: + material: RED_SANDSTONE + amount: 64 + output: + red sandstone: + material: STONE_SLAB2 + amount: 64 + Smelt_Red_Sandstone_Stairs: + type: PRODUCTION + name: Smelt Red Sandstone Stairs + production_time: 5s + input: + red sand: + material: RED_SANDSTONE + amount: 64 + output: + red sandstone: + material: RED_SANDSTONE_STAIRS + amount: 48 + Smelt_Sandstone_Advanced: + type: PRODUCTION + name: Smelt Sandstone + production_time: 5s + input: + red sand: + material: SAND + amount: 64 + output: + red sandstone: + material: SANDSTONE + amount: 32 + Smelt_Sandstone_Basic: + type: PRODUCTION + name: Smelt Sandstone + production_time: 5s + input: + red sand: + material: SAND + amount: 64 + output: + red sandstone: + material: SANDSTONE + amount: 32 + Smelt_Sandstone_Slabs: + type: PRODUCTION + name: Smelt Sandstone Slabs + production_time: 5s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + sandstone slab: + material: STEP + durability: 1 + amount: 64 + Smelt_Sandstone_Stairs: + type: PRODUCTION + name: Smelt Sandstone Stairs + production_time: 5s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + sandstone stairs: + material: SANDSTONE_STAIRS + amount: 48 + Smelt_Smooth_Red_Sandstone: + type: PRODUCTION + name: Smelt Smooth Red Sandstone + production_time: 5s + input: + red sandstone: + material: RED_SANDSTONE + amount: 64 + output: + smooth red sandstone: + material: RED_SANDSTONE + durability: 2 + amount: 64 + Smelt_Smooth_Sandstone: + type: PRODUCTION + name: Smelt Smooth Sandstone + production_time: 5s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + smooth sandstone: + material: SANDSTONE + durability: 2 + amount: 64 + Smelt_Stone_Advanced: + type: PRODUCTION + name: Smelt Stone + production_time: 5s + input: + sobblestone: + material: COBBLESTONE + amount: 64 + output: + stone: + material: STONE + amount: 128 + Smelt_Stone_Basic: + type: PRODUCTION + name: Smelt Stone + production_time: 5s + input: + sobblestone: + material: COBBLESTONE + amount: 64 + output: + stone: + material: STONE + amount: 96 + Smelt_Stone_Expert: + type: PRODUCTION + name: Smelt Stone + production_time: 5s + input: + sobblestone: + material: COBBLESTONE + amount: 64 + output: + stone: + material: STONE + amount: 192 + Take_any_mob_egg_apart: + type: PRODUCTION + name: Take any mob egg apart + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Take_friendly_mob_egg_apart: + type: PRODUCTION + name: Take friendly mob egg apart + production_time: 5s + input: + identifiername: + material: STONE + amount: 1 + output: + identifiername: + material: STONE + amount: 1 + Upgrade_to_Advanced_Kiln: + production_time: 5s + type: UPGRADE + name: Upgrade to Advanced Kiln + input: + hardened clay: + material: HARD_CLAY + amount: 640 + factory: Advanced Kiln + Upgrade_to_Animal_Husbandry_Factory_Advanced: + production_time: 5s + type: UPGRADE + name: Upgrade to Animal Husbandry Factory Advanced + input: + golden apple: + material: GOLDEN_APPLE + amount: 64 + hay bale: + material: HAY_BLOCK + amount: 128 + factory: Animal Husbandry Factory Advanced + Upgrade_to_Animal_Husbandry_Factory_Basic: + production_time: 5s + type: UPGRADE + name: Upgrade to Animal Husbandry Factory Basic + input: + hay bale: + material: HAY_BLOCK + amount: 64 + golden apple: + material: GOLDEN_APPLE + amount: 16 + factory: Animal Husbandry Factory Basic + Upgrade_to_Aquatic_Brick_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Aquatic Brick Smelter + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 256 + prismarine crystals: + material: PRISMARINE_CRYSTALS + amount: 128 + factory: Aquatic Brick Smelter + Upgrade_to_Armour_Enchanter: + production_time: 5s + type: UPGRADE + name: Upgrade to Armour Enchanter + input: + emerald block: + material: EMERALD_BLOCK + amount: 256 + diamond block: + material: DIAMOND_BLOCK + amount: 64 + factory: Armour Enchanter + Upgrade_to_Bakery: + production_time: 5s + type: UPGRADE + name: Upgrade to Bakery + input: + bread: + material: BREAD + amount: 512 + baked potato: + material: BAKED_POTATO + amount: 256 + cookie: + material: COOKIE + amount: 128 + factory: Bakery + Upgrade_to_Bastion_Factory: + production_time: 5s + type: UPGRADE + name: Upgrade to Bastion Factory + input: + ender pearl: + material: ENDER_PEARL + amount: 256 + cobweb: + material: WEB + amount: 128 + diamond ore: + material: DIAMOND_ORE + amount: 48 + factory: Bastion Factory + Upgrade_to_Bio_Lab: + production_time: 5s + type: UPGRADE + name: Upgrade to Bio Lab + input: + grass: + material: GRASS + amount: 256 + sapling: + material: SAPLING + durability: -1 + amount: 256 + factory: Bio Lab + Upgrade_to_Blacksmith: + production_time: 5s + type: UPGRADE + name: Upgrade to Blacksmith + input: + iron: + material: IRON_INGOT + amount: 256 + factory: Blacksmith + Upgrade_to_Brick_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Brick Smelter + input: + clay: + material: CLAY + amount: 512 + factory: Brick Smelter + Upgrade_to_Carpentry: + production_time: 5s + type: UPGRADE + name: Upgrade to Carpentry + input: + planks: + material: WOOD + durability: -1 + amount: 256 + factory: Carpentry + Upgrade_to_Coal_Burner: + production_time: 5s + type: UPGRADE + name: Upgrade to Coal Burner + input: + coal: + material: COAL + amount: 256 + factory: Coal Burner + Upgrade_to_Compactor_Basic: + production_time: 5s + type: UPGRADE + name: Upgrade to Compactor Basic + input: + piston: + material: PISTON_BASE + amount: 6 + chest: + material: CHEST + amount: 64 + iron: + material: IRON_INGOT + amount: 32 + factory: Compactor Basic + Upgrade_to_Dedicated_Compactor: + production_time: 5s + type: UPGRADE + name: Upgrade to Dedicated Compactor + input: + piston: + material: PISTON_BASE + amount: 6 + chest: + material: CHEST + amount: 64 + iron: + material: IRON_INGOT + amount: 48 + factory: Dedicated Compactor + Upgrade_to_Dedicated_De-Compactor: + production_time: 5s + type: UPGRADE + name: Upgrade to Dedicated De-Compactor + input: + sticky piston: + material: PISTON_STICKY_BASE + amount: 6 + chest: + material: CHEST + amount: 64 + iron: + material: IRON_INGOT + amount: 48 + factory: Dedicated De-Compactor + Upgrade_to_Diamond_Armour_Forge_: + production_time: 5s + type: UPGRADE + name: Upgrade to Diamond Armour Forge + input: + diamond block: + material: DIAMOND_BLOCK + amount: 48 + factory: Diamond Armour Forge + Upgrade_to_Diamond_Equipment_Forge: + production_time: 5s + type: UPGRADE + name: Upgrade to Diamond Equipment Forge + input: + diamond block: + material: DIAMOND_BLOCK + amount: 32 + factory: Diamond Equipment Forge + Upgrade_to_Diamond_Tools_Forge_: + production_time: 5s + type: UPGRADE + name: Upgrade to Diamond Tools Forge + input: + diamond block: + material: DIAMOND_BLOCK + amount: 32 + factory: Diamond Tools Forge + Upgrade_to_Enchanter_Basic: + production_time: 5s + type: UPGRADE + name: Upgrade to Enchanter Basic + input: + emerald block: + material: EMERALD_BLOCK + amount: 32 + factory: Enchanter Basic + Upgrade_to_Farmstead_Factory: + production_time: 5s + type: UPGRADE + name: Upgrade to Farmstead Factory + input: + wheat: + material: WHEAT + amount: 512 + carrot: + material: CARROT + amount: 512 + potato: + material: POTATO_ITEM + amount: 512 + chicken: + material: RAW_CHICKEN + amount: 64 + beef: + material: RAW_BEEF + amount: 64 + factory: Farmstead Factory + Upgrade_to_Fine_Woodworking: + production_time: 5s + type: UPGRADE + name: Upgrade to Fine Woodworking + input: + planks: + material: WOOD + durability: -1 + amount: 512 + iron axe: + material: IRON_AXE + amount: 1 + factory: Fine Woodworking + Upgrade_to_Flower_Gardening_: + production_time: 5s + type: UPGRADE + name: Upgrade to Flower Gardening + input: + flower: + material: RED_ROSE + amount: 128 + factory: Flower Gardening + Upgrade_to_Gem_extractor_: + production_time: 5s + type: UPGRADE + name: Upgrade to Gem extractor + input: + diamond: + material: DIAMOND + amount: 64 + gold: + material: GOLD_INGOT + amount: 32 + iron: + material: IRON_INGOT + amount: 128 + factory: Gem extractor + Upgrade_to_Glass_Dying_: + production_time: 5s + type: UPGRADE + name: Upgrade to Glass Dying + input: + glass: + material: GLASS + amount: 128 + factory: Glass Dying + Upgrade_to_Gold_Armour_Forge_: + production_time: 5s + type: UPGRADE + name: Upgrade to Gold Armour Forge + input: + gold block: + material: GOLD_BLOCK + amount: 48 + factory: Gold Armour Forge + Upgrade_to_Gold_Equipment_Forge: + production_time: 5s + type: UPGRADE + name: Upgrade to Gold Equipment Forge + input: + gold block: + material: GOLD_BLOCK + amount: 32 + factory: Gold Equipment Forge + Upgrade_to_Gold_Tools_Forge: + production_time: 5s + type: UPGRADE + name: Upgrade to Gold Tools Forge + input: + gold block: + material: GOLD_BLOCK + amount: 32 + factory: Gold Tools Forge + Upgrade_to_Grass_Gardening: + production_time: 5s + type: UPGRADE + name: Upgrade to Grass Gardening + input: + grass: + material: LONG_GRASS + durability: 1 + amount: 128 + factory: Grass Gardening + Upgrade_to_Grill: + production_time: 5s + type: UPGRADE + name: Upgrade to Grill + input: + beef: + material: RAW_BEEF + amount: 128 + mutton: + material: MUTTON + amount: 128 + chicken: + material: RAW_CHICKEN + amount: 128 + factory: Grill + Upgrade_to_Iron_Equipment_Forge: + production_time: 5s + type: UPGRADE + name: Upgrade to Iron Equipment Forge + input: + iron block: + material: IRON_BLOCK + amount: 48 + factory: Iron Equipment Forge + Upgrade_to_Iron_Forge_Advanced: + production_time: 5s + type: UPGRADE + name: Upgrade to Iron Forge Advanced + input: + iron block: + material: IRON_BLOCK + amount: 64 + factory: Iron Forge Advanced + Upgrade_to_Iron_Forge_Basic: + production_time: 5s + type: UPGRADE + name: Upgrade to Iron Forge Basic + input: + iron block: + material: IRON_BLOCK + amount: 32 + factory: Iron Forge Basic + Upgrade_to_Kiln: + production_time: 5s + type: UPGRADE + name: Upgrade to Kiln + input: + clay: + material: CLAY + amount: 128 + factory: Kiln + Upgrade_to_Laboratory: + production_time: 5s + type: UPGRADE + name: Upgrade to Laboratory + input: + cauldron: + material: CAULDRON + amount: 16 + glass bottle: + material: GLASS_BOTTLE + amount: 128 + factory: Laboratory + Upgrade_to_Mad_Scientist: + production_time: 5s + type: UPGRADE + name: Upgrade to Mad Scientist + input: + blaze rod: + material: BLAZE_ROD + amount: 128 + squid egg: + material: MONSTER_EGG + durability: 94 + factory: Mad Scientist + Upgrade_to_Netherbrick_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Netherbrick Smelter + input: + nether brick: + material: NETHER_BRICK + amount: 128 + factory: Netherbrick Smelter + Upgrade_to_Ore_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Ore Smelter + input: + diamond: + material: DIAMOND + amount: 32 + iron: + material: IRON_INGOT + amount: 64 + gold: + material: GOLD_INGOT + amount: 16 + factory: Ore Smelter + Upgrade_to_Organic_Block_Factory: + production_time: 5s + type: UPGRADE + name: Upgrade to Organic Block Factory + input: + grass: + material: GRASS + amount: 128 + factory: Organic Block Factory + Upgrade_to_Printing_Press: + production_time: 5s + type: UPGRADE + name: Upgrade to Printing Press + input: + ink sack: + material: INK_SACK + amount: 32 + paper: + material: PAPER + amount: 64 + factory: Printing Press + Upgrade_to_Rail_Factory_: + production_time: 5s + type: UPGRADE + name: Upgrade to Rail Factory + input: + iron: + material: IRON_INGOT + amount: 128 + redstone: + material: REDSTONE + amount: 32 + factory: Rail Factory + Upgrade_to_Redstone_Circularity_Factory: + production_time: 5s + type: UPGRADE + name: Upgrade to Redstone Circularity Factory + input: + redstone: + material: REDSTONE + amount: 128 + quartz: + material: QUARTZ + amount: 64 + factory: Redstone Circularity Factory + Upgrade_to_Redstone_Factory_Basic: + production_time: 5s + type: UPGRADE + name: Upgrade to Redstone Factory Basic + input: + redstone: + material: REDSTONE + amount: 128 + factory: Redstone Factory Basic + Upgrade_to_Redstone_Mechanics_Factory: + production_time: 5s + type: UPGRADE + name: Upgrade to Redstone Mechanics Factory + input: + redstone: + material: REDSTONE + amount: 128 + iron: + material: IRON_INGOT + amount: 64 + factory: Redstone Mechanics Factory + Upgrade_to_Sand_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Sand Smelter + input: + sand: + material: SAND + amount: 512 + factory: Sand Smelter + Upgrade_to_Sandstone_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Sandstone Smelter + input: + sandstone: + material: SANDSTONE + amount: 128 + red sandstone: + material: RED_SANDSTONE + amount: 128 + factory: Sandstone Smelter + Upgrade_to_Soup_kitchen: + production_time: 5s + type: UPGRADE + name: Upgrade to Soup kitchen + input: + red mushroom: + material: RED_MUSHROOM + amount: 64 + brown mushroom: + material: BROWN_MUSHROOM + amount: 64 + rabbit: + material: RABBIT + amount: 64 + factory: Soup kitchen + Upgrade_to_Stone_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Stone Smelter + input: + stone: + material: STONE + amount: 512 + factory: Stone Smelter + Upgrade_to_Stonebrick_Smelter: + production_time: 5s + type: UPGRADE + name: Upgrade to Stonebrick Smelter + input: + stone: + material: STONE + amount: 256 + factory: Stonebrick Smelter + Upgrade_to_Tool_Enchanter: + production_time: 5s + type: UPGRADE + name: Upgrade to Tool Enchanter + input: + emerald block: + material: EMERALD_BLOCK + amount: 32 + factory: Tool Enchanter + Upgrade_to_Tree_Mutator: + production_time: 5s + type: UPGRADE + name: Upgrade to Tree Mutator + input: + sapling: + material: SAPLING + durability: -1 + amount: 128 + factory: Tree Mutator + Upgrade_to_Weapon_Enchanter: + production_time: 5s + type: UPGRADE + name: Upgrade to Weapon Enchanter + input: + emerald block: + material: EMERALD_BLOCK + amount: 32 + factory: Weapon Enchanter + Upgrade_to_Wood_Processor: + production_time: 5s + type: UPGRADE + name: Upgrade to Wood Processor + input: + planks: + material: WOOD + durability: -1 + amount: 256 + factory: Wood Processor + Upgrade_to_Wool_Processing: + production_time: 5s + type: UPGRADE + name: Upgrade to Wool Processing + input: + wool: + material: WOOL + amount: 256 + factory: Wool Processing From 587cf681302f4c5257a188f4f4a4a1d051529382 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 26 Feb 2016 01:02:31 +0100 Subject: [PATCH 224/459] Add alternative recipe assignment identifier handling, still backwards compatible though --- config.yml | 5 ++++- configCivcraft.yml | 1 + src/com/github/igotyou/FactoryMod/ConfigParser.java | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index e3deb172..a702f26d 100644 --- a/config.yml +++ b/config.yml @@ -153,9 +153,12 @@ break_grace_period: 7d #How often factories are passively decayed decay_intervall: 1h -#How much health is decayed from factories +#How much health is decayed from factories, factories have 10k health total decay_amount: 21 +#Whether the yaml identifier or the factory name should be used when assigning recipes to factories, default to false +use_recipe_yamlidentifiers: false + #---------------------------------------------------------------------------------------------------------------------- #Factories diff --git a/configCivcraft.yml b/configCivcraft.yml index 5e9b18aa..e6a9704f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -15,6 +15,7 @@ log_inventories: true break_grace_period: 7d decay_intervall: 1h decay_amount: 21 +use_recipe_yamlidentifiers: true factories: basiccontraption: type: FCC diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 236ff0ba..682f52c0 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -45,6 +45,7 @@ public class ConfigParser { private HashMap upgradeEggs; private HashMap> recipeLists; private String defaultMenuFactory; + private boolean useYamlIdentifers; public ConfigParser(FactoryMod plugin) { this.plugin = plugin; @@ -76,6 +77,7 @@ public FactoryModManager parse() { plugin.getServer().getPluginManager() .registerEvents(new NetherPortalListener(), plugin); } + useYamlIdentifers = config.getBoolean("use_recipe_yamlidentifiers", false); defaultUpdateTime = (int) parseTime(config.getString( "default_update_time", "5")); ItemMap dFuel = parseItemMap(config.getConfigurationSection("default_fuel")); @@ -127,7 +129,12 @@ private void parseRecipes(ConfigurationSection config) { if (recipe == null) { plugin.warning(String.format("Recipe %s unable to be added.", key)); } else { - recipes.put(recipe.getRecipeName(), recipe); + if (useYamlIdentifers) { + recipes.put(key, recipe); + } + { + recipes.put(recipe.getRecipeName(), recipe); + } } } } From 97b77e3a28937d80369845058ba1a3107d8821f9 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 26 Feb 2016 01:05:06 +0100 Subject: [PATCH 225/459] Use potato item identifier instead of block --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index e6a9704f..9a3d75b2 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3245,7 +3245,7 @@ recipes: material: WHEAT amount: 512 carrot: - material: CARROT + material: CARROT_ITEM amount: 512 potato: material: POTATO_ITEM From 67f516736e50ad5a7f0faec78358d93211ee53ce Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Sun, 28 Feb 2016 13:27:54 +0000 Subject: [PATCH 226/459] Added missing factory upgrades and modified upgrade times Added missing factory upgrades and modified upgrade times, loads of other things got tweaked as well. --- configCivcraft.yml | 290 +++++++++++++++++++++++++-------------------- 1 file changed, 161 insertions(+), 129 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 9a3d75b2..d782f01f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -21,8 +21,9 @@ factories: type: FCC name: Basic Contraption setupcost: - wood: + planks: material: WOOD + durability: -1 amount: 64 stone: material: STONE @@ -120,6 +121,7 @@ factories: - Upgrade_to_Stonebrick_Smelter - Upgrade_to_Netherbrick_Smelter - Upgrade_to_Aquatic_Brick_Smelter + - Upgrade_to_Quartz_Factory advancedstonesmelter: type: FCCUPGRADE name: Advanced Stone Smelter @@ -504,7 +506,7 @@ recipes: Bake_Bread_Advanced: type: PRODUCTION name: Bake Bread - production_time: 5s + production_time: 10s input: wheat: material: WHEAT @@ -595,7 +597,7 @@ recipes: Burn_Charcoal_from_Coal: type: PRODUCTION name: Burn Charcoal from Coal - production_time: 5s + production_time: 10s input: coal: material: COAL @@ -695,9 +697,9 @@ recipes: Craft_Anvils_Advanced: type: PRODUCTION name: Craft Anvils - production_time: 5s + production_time: 10s input: - iron blocks: + iron block: material: IRON_BLOCK amount: 32 output: @@ -709,7 +711,7 @@ recipes: name: Craft Anvils production_time: 5s input: - iron blocks: + iron block: material: IRON_BLOCK amount: 32 output: @@ -781,8 +783,9 @@ recipes: name: Craft Boat production_time: 5s input: - wood: + planks: material: WOOD + durability: -1 amount: 64 output: boat: @@ -793,7 +796,7 @@ recipes: name: Craft Buckets production_time: 5s input: - iron blocks: + iron block: material: IRON_BLOCK amount: 4 output: @@ -805,7 +808,7 @@ recipes: name: Craft Buckets production_time: 5s input: - iron blocks: + iron block: material: IRON_BLOCK amount: 5 output: @@ -938,7 +941,7 @@ recipes: name: Craft Flint and Steel production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 12 flint: @@ -965,7 +968,7 @@ recipes: name: Craft Iron Bars production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 16 output: @@ -977,7 +980,7 @@ recipes: name: Craft Iron Door production_time: 5s input: - iron: + iron ingot: material: IRON_FENCE amount: 16 output: @@ -1118,8 +1121,8 @@ recipes: material: LOG amount: 16 output: - identifiername: - material: STONE + oak fence: + material: FENCE amount: 48 Craft_Pillar_Quartz_Blocks: type: PRODUCTION @@ -1142,10 +1145,10 @@ recipes: cobblestone: material: COBBLESTONE amount: 128 - redstone: + redstone dust: material: REDSTONE amount: 48 - iron: + iron ingot: material: IRON_INGOT amount: 48 planks: @@ -1252,7 +1255,7 @@ recipes: name: Craft Rail Basic production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 32 stick: @@ -1369,7 +1372,7 @@ recipes: leather: material: LEATHER amount: 32 - iron: + iron ingot: material: IRON_INGOT amount: 16 output: @@ -1384,7 +1387,7 @@ recipes: leather: material: LEATHER amount: 32 - iron: + iron ingot: material: IRON_INGOT amount: 32 output: @@ -1411,7 +1414,7 @@ recipes: name: Craft Shears production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 16 output: @@ -1429,7 +1432,7 @@ recipes: redstone: material: REDSTONE amount: 48 - iron: + iron ingot: material: IRON_INGOT amount: 48 planks: @@ -1510,7 +1513,7 @@ recipes: name: Create Activator Rail production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 32 stick: @@ -1593,7 +1596,7 @@ recipes: name: Create Detector Rail production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 32 redstone: @@ -1703,7 +1706,7 @@ recipes: name: Create Powered Rail production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 32 redstone: @@ -1718,7 +1721,7 @@ recipes: name: Create Rail production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 32 output: @@ -1727,28 +1730,30 @@ recipes: amount: 128 Cut_any_type_of_Plank_Advanced: type: PRODUCTION - name: Cut any type of Plank Advanced - production_time: 5s + name: Cut Oak Planks Advanced + production_time: 2s input: - identifiername: - material: STONE - amount: 1 + log: + material: LOG + durability: -1 + amount: 10 output: - identifiername: - material: STONE - amount: 1 + planks: + material: WOOD + amount: 60 Cut_any_type_of_Plank_Basic: type: PRODUCTION - name: Cut any type of Plank Basic - production_time: 5s + name: Cut Oak Planks Basic + production_time: 2s input: - identifiername: - material: STONE - amount: 1 + log: + material: LOG + durability: -1 + amount: 10 output: - identifiername: - material: STONE - amount: 1 + planks: + material: WOOD + amount: 50 De-compact_Stack_Advanced: type: DECOMPACT name: De-compact Stack @@ -1766,6 +1771,7 @@ recipes: input: wool: material: WOOL + durability: -1 amount: 64 dye: material: INK_SACK @@ -1783,6 +1789,7 @@ recipes: input: wool: material: WOOL + durability: -1 amount: 64 dye: material: INK_SACK @@ -1800,6 +1807,7 @@ recipes: input: wool: material: WOOL + durability: -1 amount: 64 dye: material: INK_SACK @@ -2039,7 +2047,7 @@ recipes: name: Forge Gold Axe production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 16 output: @@ -2051,7 +2059,7 @@ recipes: name: Forge Gold Boots production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 24 output: @@ -2063,7 +2071,7 @@ recipes: name: Forge Gold Breastplate production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 48 output: @@ -2075,7 +2083,7 @@ recipes: name: Forge Gold Helmet production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 32 output: @@ -2087,7 +2095,7 @@ recipes: name: Forge Gold Hoe production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 8 output: @@ -2099,7 +2107,7 @@ recipes: name: Forge Gold Horse Armour production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 12 output: @@ -2111,7 +2119,7 @@ recipes: name: Forge Gold Leggings production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 40 output: @@ -2123,7 +2131,7 @@ recipes: name: Forge Gold Pickaxe production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 16 output: @@ -2135,7 +2143,7 @@ recipes: name: Forge Gold Shovel production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 6 output: @@ -2147,7 +2155,7 @@ recipes: name: Forge Gold Sword production_time: 5s input: - gold: + gold ingot: material: GOLD_INGOT amount: 10 output: @@ -2159,7 +2167,7 @@ recipes: name: Forge Iron Axe production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 16 output: @@ -2171,7 +2179,7 @@ recipes: name: Forge Iron Boots production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 24 output: @@ -2183,7 +2191,7 @@ recipes: name: Forge Iron Breastplate production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 48 output: @@ -2195,7 +2203,7 @@ recipes: name: Forge Iron Helmet production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 32 output: @@ -2207,7 +2215,7 @@ recipes: name: Forge Iron Hoe production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 8 output: @@ -2219,7 +2227,7 @@ recipes: name: Forge Iron Horse Armour production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 12 output: @@ -2231,7 +2239,7 @@ recipes: name: Forge Iron Leggings production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 40 output: @@ -2243,7 +2251,7 @@ recipes: name: Forge Iron Pickaxe production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 16 output: @@ -2255,7 +2263,7 @@ recipes: name: Forge Iron Shovel production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 6 output: @@ -2267,7 +2275,7 @@ recipes: name: Forge Iron Sword production_time: 5s input: - iron: + iron ingot: material: IRON_INGOT amount: 10 output: @@ -2769,7 +2777,7 @@ recipes: material: GOLD_ORE amount: 16 output: - gold: + gold ingot: material: GOLD_INGOT amount: 64 Smelt_Iron_Ore_Advanced: @@ -2781,7 +2789,7 @@ recipes: material: IRON_ORE amount: 64 output: - iron: + iron ingot: material: IRON_INGOT amount: 192 Smelt_Iron_Ore_Basic: @@ -2793,7 +2801,7 @@ recipes: material: IRON_ORE amount: 64 output: - iron: + iron ingot: material: IRON_INGOT amount: 128 Smelt_Netherbrick_Advanced: @@ -3019,7 +3027,7 @@ recipes: material: STONE amount: 1 Upgrade_to_Advanced_Kiln: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Advanced Kiln input: @@ -3028,7 +3036,7 @@ recipes: amount: 640 factory: Advanced Kiln Upgrade_to_Animal_Husbandry_Factory_Advanced: - production_time: 5s + production_time: 45s type: UPGRADE name: Upgrade to Animal Husbandry Factory Advanced input: @@ -3040,7 +3048,7 @@ recipes: amount: 128 factory: Animal Husbandry Factory Advanced Upgrade_to_Animal_Husbandry_Factory_Basic: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Animal Husbandry Factory Basic input: @@ -3052,7 +3060,7 @@ recipes: amount: 16 factory: Animal Husbandry Factory Basic Upgrade_to_Aquatic_Brick_Smelter: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Aquatic Brick Smelter input: @@ -3063,8 +3071,17 @@ recipes: material: PRISMARINE_CRYSTALS amount: 128 factory: Aquatic Brick Smelter + Upgrade_to_Quartz_Factory: + production_time: 30s + type: UPGRADE + name: Upgrade to Quartz Factory + input: + Quartz Block: + material: QUARTZ_BLOCK + amount: 256 + factory: Quartz Factory Upgrade_to_Armour_Enchanter: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Armour Enchanter input: @@ -3076,7 +3093,7 @@ recipes: amount: 64 factory: Armour Enchanter Upgrade_to_Bakery: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Bakery input: @@ -3091,7 +3108,7 @@ recipes: amount: 128 factory: Bakery Upgrade_to_Bastion_Factory: - production_time: 5s + production_time: 45s type: UPGRADE name: Upgrade to Bastion Factory input: @@ -3106,7 +3123,7 @@ recipes: amount: 48 factory: Bastion Factory Upgrade_to_Bio_Lab: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Bio Lab input: @@ -3119,25 +3136,25 @@ recipes: amount: 256 factory: Bio Lab Upgrade_to_Blacksmith: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Blacksmith input: - iron: + iron ingot: material: IRON_INGOT amount: 256 factory: Blacksmith Upgrade_to_Brick_Smelter: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Brick Smelter input: - clay: + clay blocks: material: CLAY amount: 512 factory: Brick Smelter Upgrade_to_Carpentry: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Carpentry input: @@ -3147,7 +3164,7 @@ recipes: amount: 256 factory: Carpentry Upgrade_to_Coal_Burner: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Coal Burner input: @@ -3156,7 +3173,7 @@ recipes: amount: 256 factory: Coal Burner Upgrade_to_Compactor_Basic: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Compactor Basic input: @@ -3166,12 +3183,12 @@ recipes: chest: material: CHEST amount: 64 - iron: + iron ingot: material: IRON_INGOT amount: 32 factory: Compactor Basic Upgrade_to_Dedicated_Compactor: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Dedicated Compactor input: @@ -3181,12 +3198,12 @@ recipes: chest: material: CHEST amount: 64 - iron: + iron ingot: material: IRON_INGOT amount: 48 factory: Dedicated Compactor Upgrade_to_Dedicated_De-Compactor: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Dedicated De-Compactor input: @@ -3196,12 +3213,12 @@ recipes: chest: material: CHEST amount: 64 - iron: + iron ingot: material: IRON_INGOT amount: 48 factory: Dedicated De-Compactor Upgrade_to_Diamond_Armour_Forge_: - production_time: 5s + production_time: 45s type: UPGRADE name: Upgrade to Diamond Armour Forge input: @@ -3210,7 +3227,7 @@ recipes: amount: 48 factory: Diamond Armour Forge Upgrade_to_Diamond_Equipment_Forge: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Diamond Equipment Forge input: @@ -3218,8 +3235,8 @@ recipes: material: DIAMOND_BLOCK amount: 32 factory: Diamond Equipment Forge - Upgrade_to_Diamond_Tools_Forge_: - production_time: 5s + Upgrade_to_Diamond_Tools_Forge: + production_time: 45s type: UPGRADE name: Upgrade to Diamond Tools Forge input: @@ -3228,7 +3245,7 @@ recipes: amount: 32 factory: Diamond Tools Forge Upgrade_to_Enchanter_Basic: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Enchanter Basic input: @@ -3237,7 +3254,7 @@ recipes: amount: 32 factory: Enchanter Basic Upgrade_to_Farmstead_Factory: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Farmstead Factory input: @@ -3258,7 +3275,7 @@ recipes: amount: 64 factory: Farmstead Factory Upgrade_to_Fine_Woodworking: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Fine Woodworking input: @@ -3271,7 +3288,7 @@ recipes: amount: 1 factory: Fine Woodworking Upgrade_to_Flower_Gardening_: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Flower Gardening input: @@ -3280,22 +3297,22 @@ recipes: amount: 128 factory: Flower Gardening Upgrade_to_Gem_extractor_: - production_time: 5s + production_time: 45s type: UPGRADE name: Upgrade to Gem extractor input: diamond: material: DIAMOND amount: 64 - gold: + gold ingot: material: GOLD_INGOT amount: 32 - iron: + iron ingot: material: IRON_INGOT amount: 128 factory: Gem extractor Upgrade_to_Glass_Dying_: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Glass Dying input: @@ -3304,7 +3321,7 @@ recipes: amount: 128 factory: Glass Dying Upgrade_to_Gold_Armour_Forge_: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Gold Armour Forge input: @@ -3313,7 +3330,7 @@ recipes: amount: 48 factory: Gold Armour Forge Upgrade_to_Gold_Equipment_Forge: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Gold Equipment Forge input: @@ -3322,7 +3339,7 @@ recipes: amount: 32 factory: Gold Equipment Forge Upgrade_to_Gold_Tools_Forge: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Gold Tools Forge input: @@ -3331,7 +3348,7 @@ recipes: amount: 32 factory: Gold Tools Forge Upgrade_to_Grass_Gardening: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Grass Gardening input: @@ -3341,7 +3358,7 @@ recipes: amount: 128 factory: Grass Gardening Upgrade_to_Grill: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Grill input: @@ -3356,7 +3373,7 @@ recipes: amount: 128 factory: Grill Upgrade_to_Iron_Equipment_Forge: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Iron Equipment Forge input: @@ -3365,7 +3382,7 @@ recipes: amount: 48 factory: Iron Equipment Forge Upgrade_to_Iron_Forge_Advanced: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Iron Forge Advanced input: @@ -3374,7 +3391,7 @@ recipes: amount: 64 factory: Iron Forge Advanced Upgrade_to_Iron_Forge_Basic: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Iron Forge Basic input: @@ -3383,7 +3400,7 @@ recipes: amount: 32 factory: Iron Forge Basic Upgrade_to_Kiln: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Kiln input: @@ -3392,7 +3409,7 @@ recipes: amount: 128 factory: Kiln Upgrade_to_Laboratory: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Laboratory input: @@ -3404,7 +3421,7 @@ recipes: amount: 128 factory: Laboratory Upgrade_to_Mad_Scientist: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Mad Scientist input: @@ -3416,7 +3433,7 @@ recipes: durability: 94 factory: Mad Scientist Upgrade_to_Netherbrick_Smelter: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Netherbrick Smelter input: @@ -3425,22 +3442,37 @@ recipes: amount: 128 factory: Netherbrick Smelter Upgrade_to_Ore_Smelter: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Ore Smelter input: diamond: material: DIAMOND amount: 32 - iron: + iron ingot: material: IRON_INGOT amount: 64 - gold: + gold ingot: material: GOLD_INGOT amount: 16 factory: Ore Smelter + Upgrade_to_Ore_Forge: + production_time: 60s + type: UPGRADE + name: Upgrade to Ore Forge + input: + diamond: + material: DIAMOND + amount: 64 + iron ingot: + material: IRON_INGOT + amount: 128 + gold ingot: + material: GOLD_INGOT + amount: 32 + factory: Ore Forge Upgrade_to_Organic_Block_Factory: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Organic Block Factory input: @@ -3449,7 +3481,7 @@ recipes: amount: 128 factory: Organic Block Factory Upgrade_to_Printing_Press: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Printing Press input: @@ -3461,11 +3493,11 @@ recipes: amount: 64 factory: Printing Press Upgrade_to_Rail_Factory_: - production_time: 5s + production_time: 30s type: UPGRADE name: Upgrade to Rail Factory input: - iron: + iron ingot: material: IRON_INGOT amount: 128 redstone: @@ -3473,7 +3505,7 @@ recipes: amount: 32 factory: Rail Factory Upgrade_to_Redstone_Circularity_Factory: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Redstone Circularity Factory input: @@ -3485,7 +3517,7 @@ recipes: amount: 64 factory: Redstone Circularity Factory Upgrade_to_Redstone_Factory_Basic: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Redstone Factory Basic input: @@ -3494,19 +3526,19 @@ recipes: amount: 128 factory: Redstone Factory Basic Upgrade_to_Redstone_Mechanics_Factory: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Redstone Mechanics Factory input: redstone: material: REDSTONE amount: 128 - iron: + iron ingot: material: IRON_INGOT amount: 64 factory: Redstone Mechanics Factory Upgrade_to_Sand_Smelter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Sand Smelter input: @@ -3515,7 +3547,7 @@ recipes: amount: 512 factory: Sand Smelter Upgrade_to_Sandstone_Smelter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Sandstone Smelter input: @@ -3527,7 +3559,7 @@ recipes: amount: 128 factory: Sandstone Smelter Upgrade_to_Soup_kitchen: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Soup kitchen input: @@ -3542,7 +3574,7 @@ recipes: amount: 64 factory: Soup kitchen Upgrade_to_Stone_Smelter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Stone Smelter input: @@ -3551,7 +3583,7 @@ recipes: amount: 512 factory: Stone Smelter Upgrade_to_Stonebrick_Smelter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Stonebrick Smelter input: @@ -3560,7 +3592,7 @@ recipes: amount: 256 factory: Stonebrick Smelter Upgrade_to_Tool_Enchanter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Tool Enchanter input: @@ -3569,7 +3601,7 @@ recipes: amount: 32 factory: Tool Enchanter Upgrade_to_Tree_Mutator: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Tree Mutator input: @@ -3579,7 +3611,7 @@ recipes: amount: 128 factory: Tree Mutator Upgrade_to_Weapon_Enchanter: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Weapon Enchanter input: @@ -3588,7 +3620,7 @@ recipes: amount: 32 factory: Weapon Enchanter Upgrade_to_Wood_Processor: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Wood Processor input: @@ -3598,7 +3630,7 @@ recipes: amount: 256 factory: Wood Processor Upgrade_to_Wool_Processing: - production_time: 5s + production_time: 20s type: UPGRADE name: Upgrade to Wool Processing input: From 806d35e03d36486e29abec1f01adc08ebb5cda7c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 28 Feb 2016 16:30:22 +0100 Subject: [PATCH 227/459] VArious bugfixes --- .../factories/FurnCraftChestFactory.java | 6 ++++- .../listeners/FactoryModListener.java | 2 +- .../structures/BlockFurnaceStructure.java | 2 +- .../structures/FurnCraftChestStructure.java | 2 +- .../structures/MultiBlockStructure.java | 26 ++++++++++++++++--- .../FactoryMod/structures/PipeStructure.java | 2 +- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 87ae20f4..58831209 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -267,6 +267,9 @@ else if (currentProductionTimer >= currentRecipe deactivate(); } } + else { + deactivate(); + } } /** @@ -331,13 +334,14 @@ public boolean hasInputMaterials() { public void upgrade(String name, List recipes, ItemStack fuel, int fuelConsumptionIntervall, int updateTime) { + LoggingUtils.log("Upgrading " + getLogData() + " to " + name); deactivate(); this.name = name; this.recipes = recipes; this.updateTime = updateTime; this.pm = new FurnacePowerManager(getFurnace(), fuel, fuelConsumptionIntervall); - ((PercentageHealthRepairManager) this.rm).repair(100); + ((PercentageHealthRepairManager) this.rm).repair(PercentageHealthRepairManager.getMaximumHealth()); if (recipes.size() != 0) { setRecipe(recipes.get(0)); } else { diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 81d4a3b9..f7c4a8bc 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -138,7 +138,7 @@ public void playerInteract(PlayerInteractEvent e) { // check if chest is other half of double chest if (block.getType() == Material.CHEST) { for (Block b : MultiBlockStructure - .searchForBlockOnSides(block, + .searchForBlockOnAllSides(block, Material.CHEST)) { Factory f = manager.getFactoryAt(b); if (f != null) { diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java index 6bd7ac6e..bfb25dee 100644 --- a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -16,7 +16,7 @@ public class BlockFurnaceStructure extends MultiBlockStructure { public BlockFurnaceStructure(Block center) { if (center.getType() == Material.DROPPER) { this.center = center.getLocation(); - for (Block b : searchForBlockOnSides(center, Material.FURNACE)) { + for (Block b : searchForBlockOnAllSides(center, Material.FURNACE)) { furnace = b.getLocation(); complete = true; break; diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index 1a58bd9d..7c5cca21 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -24,7 +24,7 @@ public class FurnCraftChestStructure extends MultiBlockStructure { public FurnCraftChestStructure(Block center) { if (center.getType() == Material.WORKBENCH) { craftingTable = center.getLocation(); - for (Block b : searchForBlockOnSides(center, Material.CHEST)) { + for (Block b : searchForBlockOnAllSides(center, Material.CHEST)) { switch (center.getFace(b)) { case SOUTH: if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java index 4be4b8d2..0cd1f915 100644 --- a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -31,19 +31,39 @@ public abstract class MultiBlockStructure { protected static Map dataBlockFaceConversion; /** - * Checks east,west,north and south of the given block for other blocks with - * the given material and returns all the blocks which fulfill that criteria + * Checks all sides of the given block for blocks with the given material + * and returns all the blocks which fulfill that criteria * * @param b * Block to check around * @param m * Material which the adjacent block should be + * @return All the blocks adjacent to the given block + * and of the given material type + */ + public static List searchForBlockOnAllSides(Block b, Material m) { + LinkedList result = new LinkedList(); + for (BlockFace face : allBlockSides) { + Block side = b.getRelative(face); + if (side.getType() == m) { + result.add(side); + } + } + return result; + } + + /** + * Checks north, south, east and west of the given block for blocks with the + * given material and returns all blocks which fulfill that criteria + * + * @param b Block to search around + * @param m Material to search for * @return All the blocks adjacent (not above or below) to the given block * and of the given material type */ public static List searchForBlockOnSides(Block b, Material m) { LinkedList result = new LinkedList(); - for (BlockFace face : allBlockSides) { + for (BlockFace face : northEastWestSouthSides) { Block side = b.getRelative(face); if (side.getType() == m) { result.add(side); diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index 10f00091..bf3beef7 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -29,7 +29,7 @@ public PipeStructure(Block startBlock) { return; } this.start = startBlock.getLocation(); - for (Block b : MultiBlockStructure.searchForBlockOnSides(startBlock, + for (Block b : MultiBlockStructure.searchForBlockOnAllSides(startBlock, Material.FURNACE)) { furnace = b.getLocation(); break; From 253b9d7902df9de9b3fd0c75f74e838e09260f27 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 28 Feb 2016 17:05:20 +0100 Subject: [PATCH 228/459] Op can bypass citadel restrictions on factories --- .../interactionManager/FurnCraftChestInteractionManager.java | 2 +- .../FactoryMod/interactionManager/PipeInteractionManager.java | 2 +- .../FactoryMod/interactionManager/SorterInteractionManager.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index ce820fc6..b437522f 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -97,7 +97,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { // is this cast safe? Let's just assume yes for now PlayerReinforcement rein = (PlayerReinforcement) rm .getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); FactoryMod.sendResponse("FactoryNoPermission", p); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index 10060ab3..f1d84d35 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -46,7 +46,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { ReinforcementManager rm = Citadel.getReinforcementManager(); //is this cast safe? Let's just assume yes for now PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); FactoryMod.sendResponse("FactoryNoPermission", p); return; diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index e96cb3e9..5e9444c3 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -53,7 +53,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { ReinforcementManager rm = Citadel.getReinforcementManager(); //is this cast safe? Let's just assume yes for now PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId())) { + if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); FactoryMod.sendResponse("FactoryNoPermission", p); return; From 949b39e0059943878a4db3da066287499e7698f1 Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Sun, 28 Feb 2016 19:10:32 +0000 Subject: [PATCH 229/459] Upgrade time increased to 5,15,30,60 and 120m --- configCivcraft.yml | 225 ++++++++++++++++++++++++++++----------------- 1 file changed, 143 insertions(+), 82 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d782f01f..59046731 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -12,7 +12,7 @@ default_fuel: default_fuel_consumption_intervall: 2s default_menu_factory: Basic Contraption log_inventories: true -break_grace_period: 7d +break_grace_period: 10d decay_intervall: 1h decay_amount: 21 use_recipe_yamlidentifiers: true @@ -893,7 +893,7 @@ recipes: stick: material: STICK amount: 32 - redstone: + redstone dust: material: REDSTONE amount: 32 output: @@ -914,7 +914,7 @@ recipes: stick: material: STICK amount: 32 - redstone: + redstone dust: material: REDSTONE amount: 32 output: @@ -929,7 +929,7 @@ recipes: cobblestone: material: COBBLESTONE amount: 192 - redstone: + redstone dust: material: REDSTONE amount: 32 output: @@ -1085,7 +1085,7 @@ recipes: name: Craft Noteblocks production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 48 planks: @@ -1101,7 +1101,7 @@ recipes: name: Craft Noteblocks production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 64 planks: @@ -1291,7 +1291,7 @@ recipes: glowstone: material: GLOWSTONE amount: 32 - redstone: + redstone dust: material: REDSTONE amount: 128 output: @@ -1303,7 +1303,7 @@ recipes: name: Craft Redstone Repeater production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 32 redstone torch: @@ -1321,7 +1321,7 @@ recipes: name: Craft Redstone Repeater production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 32 redstone torch: @@ -1339,7 +1339,7 @@ recipes: name: Craft Redstone Torch production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 32 stick: @@ -1354,7 +1354,7 @@ recipes: name: Craft Redstone Torch production_time: 5s input: - redstone: + redstone dust: material: REDSTONE amount: 32 stick: @@ -1424,12 +1424,12 @@ recipes: Craft_Sticky_Piston: type: PRODUCTION name: Craft Sticky Piston - production_time: 5s + production_time: 10s input: cobblestone: material: COBBLESTONE amount: 128 - redstone: + redstone dust: material: REDSTONE amount: 48 iron ingot: @@ -1599,7 +1599,7 @@ recipes: iron ingot: material: IRON_INGOT amount: 32 - redstone: + redstone dust: material: REDSTONE amount: 4 output: @@ -1709,7 +1709,7 @@ recipes: gold ingot: material: GOLD_INGOT amount: 32 - redstone: + redstone dust: material: REDSTONE amount: 4 output: @@ -1907,7 +1907,7 @@ recipes: material: REDSTONE_ORE amount: 64 output: - redstone: + redstone dust: material: REDSTONE amount: 256 Extract_Redstone_Basic: @@ -1919,7 +1919,7 @@ recipes: material: REDSTONE_ORE amount: 64 output: - redstone: + redstone dust: material: REDSTONE amount: 128 Forge_Diamond_Axe: @@ -2969,7 +2969,7 @@ recipes: Smelt_Stone_Advanced: type: PRODUCTION name: Smelt Stone - production_time: 5s + production_time: 10s input: sobblestone: material: COBBLESTONE @@ -2981,7 +2981,7 @@ recipes: Smelt_Stone_Basic: type: PRODUCTION name: Smelt Stone - production_time: 5s + production_time: 20s input: sobblestone: material: COBBLESTONE @@ -3027,18 +3027,20 @@ recipes: material: STONE amount: 1 Upgrade_to_Advanced_Kiln: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Advanced Kiln + fuel_consumption_intervall: 15s input: hardened clay: material: HARD_CLAY amount: 640 factory: Advanced Kiln Upgrade_to_Animal_Husbandry_Factory_Advanced: - production_time: 45s + production_time: 1800s type: UPGRADE name: Upgrade to Animal Husbandry Factory Advanced + fuel_consumption_intervall: 15s input: golden apple: material: GOLDEN_APPLE @@ -3048,9 +3050,10 @@ recipes: amount: 128 factory: Animal Husbandry Factory Advanced Upgrade_to_Animal_Husbandry_Factory_Basic: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Animal Husbandry Factory Basic + fuel_consumption_intervall: 15s input: hay bale: material: HAY_BLOCK @@ -3060,9 +3063,10 @@ recipes: amount: 16 factory: Animal Husbandry Factory Basic Upgrade_to_Aquatic_Brick_Smelter: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Aquatic Brick Smelter + fuel_consumption_intervall: 15s input: prismarine shard: material: PRISMARINE_SHARD @@ -3072,18 +3076,20 @@ recipes: amount: 128 factory: Aquatic Brick Smelter Upgrade_to_Quartz_Factory: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Quartz Factory + fuel_consumption_intervall: 15s input: Quartz Block: material: QUARTZ_BLOCK amount: 256 factory: Quartz Factory Upgrade_to_Armour_Enchanter: - production_time: 30s + production_time: 3600s type: UPGRADE name: Upgrade to Armour Enchanter + fuel_consumption_intervall: 30s input: emerald block: material: EMERALD_BLOCK @@ -3093,9 +3099,10 @@ recipes: amount: 64 factory: Armour Enchanter Upgrade_to_Bakery: - production_time: 30s + production_time: 900s type: UPGRADE name: Upgrade to Bakery + fuel_consumption_intervall: 8s input: bread: material: BREAD @@ -3108,9 +3115,10 @@ recipes: amount: 128 factory: Bakery Upgrade_to_Bastion_Factory: - production_time: 45s + production_time: 3600s type: UPGRADE name: Upgrade to Bastion Factory + fuel_consumption_intervall: 30s input: ender pearl: material: ENDER_PEARL @@ -3123,9 +3131,10 @@ recipes: amount: 48 factory: Bastion Factory Upgrade_to_Bio_Lab: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Bio Lab + fuel_consumption_intervall: 8s input: grass: material: GRASS @@ -3136,46 +3145,51 @@ recipes: amount: 256 factory: Bio Lab Upgrade_to_Blacksmith: - production_time: 20s + production_time: 300s type: UPGRADE name: Upgrade to Blacksmith + fuel_consumption_intervall: 3s input: iron ingot: material: IRON_INGOT amount: 256 factory: Blacksmith Upgrade_to_Brick_Smelter: - production_time: 30s + production_time: 900s type: UPGRADE name: Upgrade to Brick Smelter + fuel_consumption_intervall: 8s input: clay blocks: material: CLAY amount: 512 factory: Brick Smelter Upgrade_to_Carpentry: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Carpentry + fuel_consumption_intervall: 8s input: planks: material: WOOD durability: -1 - amount: 256 + amount: 512 factory: Carpentry Upgrade_to_Coal_Burner: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Coal Burner + fuel_consumption_intervall: 15s input: coal: material: COAL - amount: 256 + amount: 512 factory: Coal Burner Upgrade_to_Compactor_Basic: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Compactor Basic + fuel_consumption_intervall: 15s input: piston: material: PISTON_BASE @@ -3188,9 +3202,10 @@ recipes: amount: 32 factory: Compactor Basic Upgrade_to_Dedicated_Compactor: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Dedicated Compactor + fuel_consumption_intervall: 30s input: piston: material: PISTON_BASE @@ -3203,9 +3218,10 @@ recipes: amount: 48 factory: Dedicated Compactor Upgrade_to_Dedicated_De-Compactor: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Dedicated De-Compactor + fuel_consumption_intervall: 30s input: sticky piston: material: PISTON_STICKY_BASE @@ -3217,46 +3233,51 @@ recipes: material: IRON_INGOT amount: 48 factory: Dedicated De-Compactor - Upgrade_to_Diamond_Armour_Forge_: - production_time: 45s + Upgrade_to_Diamond_Armour_Forge: + production_time: 7200s type: UPGRADE name: Upgrade to Diamond Armour Forge + fuel_consumption_intervall: 60s input: diamond block: material: DIAMOND_BLOCK amount: 48 factory: Diamond Armour Forge Upgrade_to_Diamond_Equipment_Forge: - production_time: 30s + production_time: 3600s type: UPGRADE name: Upgrade to Diamond Equipment Forge + fuel_consumption_intervall: 30s input: diamond block: material: DIAMOND_BLOCK amount: 32 factory: Diamond Equipment Forge Upgrade_to_Diamond_Tools_Forge: - production_time: 45s + production_time: 3600s type: UPGRADE name: Upgrade to Diamond Tools Forge + fuel_consumption_intervall: 30s input: diamond block: material: DIAMOND_BLOCK amount: 32 factory: Diamond Tools Forge Upgrade_to_Enchanter_Basic: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Enchanter Basic + fuel_consumption_intervall: 30s input: emerald block: material: EMERALD_BLOCK amount: 32 factory: Enchanter Basic Upgrade_to_Farmstead_Factory: - production_time: 20s + production_time: 300s type: UPGRADE name: Upgrade to Farmstead Factory + fuel_consumption_intervall: 3s input: wheat: material: WHEAT @@ -3275,9 +3296,10 @@ recipes: amount: 64 factory: Farmstead Factory Upgrade_to_Fine_Woodworking: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Fine Woodworking + fuel_consumption_intervall: 8s input: planks: material: WOOD @@ -3288,18 +3310,23 @@ recipes: amount: 1 factory: Fine Woodworking Upgrade_to_Flower_Gardening_: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Flower Gardening + fuel_consumption_intervall: 8s input: flower: material: RED_ROSE amount: 128 + dirt: + material: DIRT + amount: 512 factory: Flower Gardening Upgrade_to_Gem_extractor_: - production_time: 45s + production_time: 7200s type: UPGRADE name: Upgrade to Gem extractor + fuel_consumption_intervall: 60s input: diamond: material: DIAMOND @@ -3312,55 +3339,64 @@ recipes: amount: 128 factory: Gem extractor Upgrade_to_Glass_Dying_: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Glass Dying + fuel_consumption_intervall: 30s input: glass: material: GLASS amount: 128 factory: Glass Dying Upgrade_to_Gold_Armour_Forge_: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Gold Armour Forge + fuel_consumption_intervall: 30s input: gold block: material: GOLD_BLOCK amount: 48 factory: Gold Armour Forge Upgrade_to_Gold_Equipment_Forge: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Gold Equipment Forge + fuel_consumption_intervall: 15s input: gold block: material: GOLD_BLOCK amount: 32 factory: Gold Equipment Forge Upgrade_to_Gold_Tools_Forge: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Gold Tools Forge + fuel_consumption_intervall: 30s input: gold block: material: GOLD_BLOCK amount: 32 factory: Gold Tools Forge Upgrade_to_Grass_Gardening: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Grass Gardening + fuel_consumption_intervall: 15s input: grass: material: LONG_GRASS durability: 1 - amount: 128 + amount: 256 + dirt: + material: DIRT + amount: 512 factory: Grass Gardening Upgrade_to_Grill: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Grill + fuel_consumption_intervall: 8s input: beef: material: RAW_BEEF @@ -3373,45 +3409,50 @@ recipes: amount: 128 factory: Grill Upgrade_to_Iron_Equipment_Forge: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Iron Equipment Forge + fuel_consumption_intervall: 8s input: iron block: material: IRON_BLOCK amount: 48 factory: Iron Equipment Forge Upgrade_to_Iron_Forge_Advanced: - production_time: 30s + production_time: 3600s type: UPGRADE name: Upgrade to Iron Forge Advanced + fuel_consumption_intervall: 30s input: iron block: material: IRON_BLOCK amount: 64 factory: Iron Forge Advanced Upgrade_to_Iron_Forge_Basic: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Iron Forge Basic + fuel_consumption_intervall: 15s input: iron block: material: IRON_BLOCK amount: 32 factory: Iron Forge Basic Upgrade_to_Kiln: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Kiln + fuel_consumption_intervall: 15s input: clay: material: CLAY amount: 128 factory: Kiln Upgrade_to_Laboratory: - production_time: 20s + production_time: 300s type: UPGRADE name: Upgrade to Laboratory + fuel_consumption_intervall: 3s input: cauldron: material: CAULDRON @@ -3421,9 +3462,10 @@ recipes: amount: 128 factory: Laboratory Upgrade_to_Mad_Scientist: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Mad Scientist + fuel_consumption_intervall: 15s input: blaze rod: material: BLAZE_ROD @@ -3433,18 +3475,20 @@ recipes: durability: 94 factory: Mad Scientist Upgrade_to_Netherbrick_Smelter: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Netherbrick Smelter + fuel_consumption_intervall: 15s input: nether brick: material: NETHER_BRICK amount: 128 factory: Netherbrick Smelter Upgrade_to_Ore_Smelter: - production_time: 30s + production_time: 900s type: UPGRADE name: Upgrade to Ore Smelter + fuel_consumption_intervall: 8s input: diamond: material: DIAMOND @@ -3457,9 +3501,10 @@ recipes: amount: 16 factory: Ore Smelter Upgrade_to_Ore_Forge: - production_time: 60s + production_time: 1800s type: UPGRADE name: Upgrade to Ore Forge + fuel_consumption_intervall: 15s input: diamond: material: DIAMOND @@ -3472,18 +3517,20 @@ recipes: amount: 32 factory: Ore Forge Upgrade_to_Organic_Block_Factory: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Organic Block Factory + fuel_consumption_intervall: 15s input: grass: material: GRASS amount: 128 factory: Organic Block Factory Upgrade_to_Printing_Press: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Printing Press + fuel_consumption_intervall: 15s input: ink sack: material: INK_SACK @@ -3493,23 +3540,25 @@ recipes: amount: 64 factory: Printing Press Upgrade_to_Rail_Factory_: - production_time: 30s + production_time: 1800s type: UPGRADE name: Upgrade to Rail Factory + fuel_consumption_intervall: 15s input: iron ingot: material: IRON_INGOT amount: 128 - redstone: + redstone dust: material: REDSTONE amount: 32 factory: Rail Factory Upgrade_to_Redstone_Circularity_Factory: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Redstone Circularity Factory + fuel_consumption_intervall: 15s input: - redstone: + redstone dust: material: REDSTONE amount: 128 quartz: @@ -3517,20 +3566,22 @@ recipes: amount: 64 factory: Redstone Circularity Factory Upgrade_to_Redstone_Factory_Basic: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Redstone Factory Basic + fuel_consumption_intervall: 8s input: - redstone: + redstone dust: material: REDSTONE amount: 128 factory: Redstone Factory Basic Upgrade_to_Redstone_Mechanics_Factory: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Redstone Mechanics Factory + fuel_consumption_intervall: 15s input: - redstone: + redstone dust: material: REDSTONE amount: 128 iron ingot: @@ -3538,18 +3589,20 @@ recipes: amount: 64 factory: Redstone Mechanics Factory Upgrade_to_Sand_Smelter: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Sand Smelter + fuel_consumption_intervall: 8s input: sand: material: SAND amount: 512 factory: Sand Smelter Upgrade_to_Sandstone_Smelter: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Sandstone Smelter + fuel_consumption_intervall: 15s input: sandstone: material: SANDSTONE @@ -3559,9 +3612,10 @@ recipes: amount: 128 factory: Sandstone Smelter Upgrade_to_Soup_kitchen: - production_time: 20s + production_time: 900s type: UPGRADE name: Upgrade to Soup kitchen + fuel_consumption_intervall: 8s input: red mushroom: material: RED_MUSHROOM @@ -3574,36 +3628,40 @@ recipes: amount: 64 factory: Soup kitchen Upgrade_to_Stone_Smelter: - production_time: 20s + production_time: 300s type: UPGRADE name: Upgrade to Stone Smelter + fuel_consumption_intervall: 3s input: stone: material: STONE amount: 512 factory: Stone Smelter Upgrade_to_Stonebrick_Smelter: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Stonebrick Smelter + fuel_consumption_intervall: 15s input: stone: material: STONE amount: 256 factory: Stonebrick Smelter Upgrade_to_Tool_Enchanter: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Tool Enchanter + fuel_consumption_intervall: 30s input: emerald block: material: EMERALD_BLOCK amount: 32 factory: Tool Enchanter Upgrade_to_Tree_Mutator: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Tree Mutator + fuel_consumption_intervall: 15s input: sapling: material: SAPLING @@ -3611,18 +3669,20 @@ recipes: amount: 128 factory: Tree Mutator Upgrade_to_Weapon_Enchanter: - production_time: 20s + production_time: 3600s type: UPGRADE name: Upgrade to Weapon Enchanter + fuel_consumption_intervall: 30s input: emerald block: material: EMERALD_BLOCK amount: 32 factory: Weapon Enchanter Upgrade_to_Wood_Processor: - production_time: 20s + production_time: 300s type: UPGRADE name: Upgrade to Wood Processor + fuel_consumption_intervall: 3s input: planks: material: WOOD @@ -3630,9 +3690,10 @@ recipes: amount: 256 factory: Wood Processor Upgrade_to_Wool_Processing: - production_time: 20s + production_time: 1800s type: UPGRADE name: Upgrade to Wool Processing + fuel_consumption_intervall: 15s input: wool: material: WOOL From cd531a4e050aa0aef8ece3e195e35a8f2447265d Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Sun, 28 Feb 2016 20:52:58 +0000 Subject: [PATCH 230/459] Added repair recipes and other minor changes Added repair recipe and some minor tweaks --- configCivcraft.yml | 132 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 59046731..c8bed672 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,7 @@ factories: - Smelt_Stone_Basic - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic + - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory - Upgrade_to_Blacksmith @@ -47,6 +48,7 @@ factories: - Smelt_Stone_Advanced - Smelt_Coal_Ore_Basic - Smelt_Glass_Basic + - Repair_Rudimentary_Factory - Upgrade_to_Ore_Smelter - Upgrade_to_Sand_Smelter - Upgrade_to_Brick_Smelter @@ -59,6 +61,7 @@ factories: - Smelt_Iron_Ore_Basic - Extract_Redstone_Basic - Extract_Quartz_Basic + - Repair_Factory - Upgrade_to_Ore_Forge - Upgrade_to_Gem_extractor oresmelter2: @@ -86,16 +89,24 @@ factories: - Smelt_Sandstone_Basic - Smelt_Red_Sandstone_Basic - Convert_Normal_Sand_to_Red_Sand - - Upgrade_to_Sand_Smelter_2 + - Repair_Small_Factory + - Upgrade_to_Advanced_Sand_Smelter - Upgrade_to_Sandstone_Smelter - - Upgrade_to_Glass_Dying - sandsmelter2: + - Upgrade_to_Glass_Dying_Factory + glassdying: type: FCCUPGRADE - name: Sand Smelter 2 + name: Glass Dying Factory + recipes: + - foo + - Repair_Factory + advancedsandsmelter: + type: FCCUPGRADE + name: Advanced Sand Smelter recipes: - Smelt_Glass_Expert - Smelt_Glass_Panes_Advanced - Smelt_Glassbottles + - Repair_Factory sandstonesmelter: type: FCCUPGRADE name: Sandstone Smelter @@ -110,6 +121,7 @@ factories: - Smelt_Chiselled_Red_Sandstone - Smelt_Smooth_Sandstone - Smelt_Smooth_Red_Sandstone + - Repair_Factory bricksmelter: type: FCCUPGRADE name: Brick Smelter @@ -118,6 +130,7 @@ factories: - Craft_Stonebricks_Basic - Craft_Prismarine_Basic - Craft_Netherbrick_Basic + - Repair_Small_Factory - Upgrade_to_Stonebrick_Smelter - Upgrade_to_Netherbrick_Smelter - Upgrade_to_Aquatic_Brick_Smelter @@ -130,6 +143,7 @@ factories: - Craft_Polished_Andesite - Craft_Polished_Diorite - Craft_Polished_Granite + - Repair_Factory stonebricksmelter: type: FCCUPGRADE name: Stone Brick Smelter @@ -140,6 +154,7 @@ factories: - Craft_Chiselled_Stonebrick - Craft_Cracked_Stonebrick - Craft_Mossy_Stonebrick + - Repair_Factory netherbricksmelter: type: FCCUPGRADE name: Nether Brick Smelter @@ -148,6 +163,7 @@ factories: - Craft_Netherbrick_Fence - Craft_Netherbrick_Slabs - Craft_Netherbrick_Stairs + - Repair_Factory aquaticstonesmelter: type: FCCUPGRADE name: Aquatic Brick Smelter @@ -156,6 +172,7 @@ factories: - Smelt_Dark_Prismarine - Smelt_Prismarine_Bricks - Craft_Sea_Lanterns + - Repair_Factory quartzfactory: type: FCCUPGRADE name: Quartz Factory @@ -165,12 +182,14 @@ factories: - Craft_Chiselled_Quartz_Blocks - Craft_Pillar_Quartz_Blocks - Craft_Quartz_Stairs + - Repair_Factory kiln: type: FCCUPGRADE name: Kiln recipes: - Smelt_Clay_Bricks - Harden_Clay_Basic + - Repair_Small_Factory - Upgrade_to_Advanced_Kiln advancedkiln: type: FCCUPGRADE @@ -179,6 +198,7 @@ factories: - Smelt_Brickblocks - Harden_Clay_Advanced - Craft_Flowerpots + - Repair_Factory woodprocessor: type: FCCUPGRADE name: Wood Processor @@ -186,6 +206,7 @@ factories: - Burn_Charcoal_from_Logs_Basic - Craft_Oak_Fence - Cut_any_type_of_Plank_Basic + - Repair_Rudimentary_Factory - Upgrade_to_Carpentry - Upgrade_to_Fine_Woodworking - Upgrade_to_Coal_Burner @@ -198,6 +219,7 @@ factories: - Craft_any_type_of_wooden_stair - Craft_any_type_of_wooden_slab - Craft_any_type_of_wooden_door + - Repair_Small_Factory finewoodworking: type: FCCUPGRADE name: Fine Woodworking @@ -206,12 +228,14 @@ factories: - Craft_any_type_of_fence_gate - Craft_ladder - Craft_trap_door + - Repair_Small_Factory coalburner: type: FCCUPGRADE name: Coal Burner recipes: - Burn_Charcoal_from_Coal - Burn_Charcoal_from_Logs_Advanced + - Repair_Small_Factory farmsteadfactory: type: FCCUPGRADE name: Farmstead Factory @@ -219,6 +243,7 @@ factories: - Bake_Bread_Basic - Grill_Steak_Basic - Create_Poppy_Basic + - Repair_Rudimentary_Factory - Upgrade_to_Bakery - Upgrade_to_Grill - Upgrade_to_Soup_kitchen @@ -233,6 +258,7 @@ factories: - Bake_Cookies - Bake_Cake - Bake_Pumpkin_Pie + - Repair_Small_Factory grill: type: FCCUPGRADE name: Grill @@ -244,6 +270,7 @@ factories: - Cook_Fish - Cook_Mutton - Cook_Rabbit + - Repair_Small_Factory stewmaker: type: FCCUPGRADE name: Soup kitchen @@ -258,6 +285,7 @@ factories: - Dye_Wool_to_Red_Wool - Dye_Wool_to_Yellow_Wool - Dye_Wool_to_Green_Wool + - Repair_Small_Factory - Upgrade_to_Wool_Processing - Upgrade_to_Animal_Husbandry_Factory_Advanced animalhusbandryfactoryadvanced: @@ -267,6 +295,7 @@ factories: - Craft_Saddles_Advanced - Create_Nametags - Create_Leads + - Repair_Factory biolab: type: FCCUPGRADE name: Bio Lab @@ -275,6 +304,7 @@ factories: - Mutate_Tall_Grass Basic - Take_friendly_mob_egg_apart - Create_Podzol_Basic + - Repair_Small_Factory - Upgrade_to_Grass_Gardening - Upgrade_to_Flower_Gardening - Upgrade_to_Tree_Mutator @@ -291,6 +321,7 @@ factories: - Grow_Fern - Grow_Vine - Kill_Dead_Shrub + - Repair_Factory flowergardening: type: FCCUPGRADE name: Flower Gardening @@ -302,12 +333,14 @@ factories: recipes: - Mutate_any_sapling_into_any_other - Mutate_any_leaf_into_any_other + - Repair_Factory madscientist: type: FCCUPGRADE name: Mad Scientist recipes: - Create_any_hostile_mob_egg - Take_any_mob_egg_apart + - Repair_Factory organicblockfactory: type: FCCUPGRADE name: Organic Block Factory @@ -315,6 +348,7 @@ factories: - Create_Podzol_Advanced - Create_Coarse_Dirt - Create_Mycelium + - Repair_Factory blacksmith: type: FCCUPGRADE name: Blacksmith @@ -324,6 +358,7 @@ factories: - Forge_Stone_Shovel - Forge_Stone_Hoe - Forge_Stone_Axe + - Repair_Small_Factory - Upgrade_to_Iron_Forge_Basic - Upgrade_to_Iron_Equipment_Forge ironforgebasic: @@ -333,6 +368,7 @@ factories: - Craft_Rail_Basic - Craft_Buckets_Basic - Craft_Anvils_Basic + - Repair_Factory - Upgrade_to_Iron_Forge_Advanced - Upgrade_to_Rail_Factory ironforgeadvanced: @@ -345,6 +381,7 @@ factories: - Craft_Iron_Bars - Craft_Iron_Door - Craft_Flint_and_Steel + - Repair_Advanced_Factory railfactory: type: FCCUPGRADE name: Rail Factory @@ -353,6 +390,7 @@ factories: - Create_Powered_Rail - Create_Detector_Rail - Create_Activator_Rail + - Repair_Advanced_Factory ironequipmentforge: type: FCCUPGRADE name: Iron Equipment Forge @@ -367,6 +405,7 @@ factories: - Forge_Iron_Breastplate - Forge_Iron_Leggings - Forge_Iron_Horse_Armour + - Repair_Factory - Upgrade_to_Gold_Equipment_Forge - Upgrade_to_Diamond_Equipment_Forge goldequipmentforge: @@ -377,6 +416,7 @@ factories: - Forge_Gold_Shovel - Forge_Gold_Breastplate - Forge_Gold_Leggings + - Repair_Factory - Upgrade_to_Gold_Armour_Forge - Upgrade_to_Gold_Tools_Forge diamondequipmentforge: @@ -387,6 +427,7 @@ factories: - Forge_Diamond_Shovel - Forge_Diamond_Breastplate - Forge_Diamond_Leggings + - Repair_Advanced_Factory - Upgrade_to_Diamond_Armour_Forge - Upgrade_to_Diamond_Tools_Forge goldarmourforge: @@ -398,6 +439,7 @@ factories: - Forge_Gold_Breastplate - Forge_Gold_Leggings - Forge_Gold_Horse_Armour + - Repair_Factory goldtoolsforge: type: FCCUPGRADE name: Gold Tools Forge @@ -407,6 +449,7 @@ factories: - Forge_Gold_Axe - Forge_Gold_Hoe - Forge_Gold_Sword + - Repair_Factory diamondarmourforge: type: FCCUPGRADE name: Diamond Armour Forge @@ -416,6 +459,7 @@ factories: - Forge_Diamond_Breastplate - Forge_Diamond_Leggings - Forge_Diamond_Horse_Armour + - Repair_Expert_Factory diamondtoolsforge: type: FCCUPGRADE name: Diamond Tools Forge @@ -425,6 +469,7 @@ factories: - Forge_Diamond_Axe - Forge_Diamond_Hoe - Forge_Diamond_Sword + - Repair_Expert_Factory laboratory: type: FCCUPGRADE name: Laboratory @@ -433,6 +478,7 @@ factories: - Craft_Dispenser_Basic - Enchant_Efficiency - Random_Printing_Press_Recipe + - Repair_Small_Factory - Upgrade_to_Bastion_Factory - Upgrade_to_Compactor_Basic - Upgrade_to_Enchanter_Basic @@ -443,10 +489,12 @@ factories: name: Bastion Factory recipes: - Create_Bastion + - Repair_Advanced_Factory printingpress: type: FCCUPGRADE name: Printing Press recipes: + - Repair_Factory - foo compactorbasic: type: FCCUPGRADE @@ -454,6 +502,7 @@ factories: recipes: - Compact_Stack_Basic - De-compact_Stack_Basic + - Repair_Factory - Upgrade_to_Dedicated_Compactor - Upgrade_to_Dedicated_De-Compactor dedicatedcompactor: @@ -461,11 +510,13 @@ factories: name: Dedicated Compactor recipes: - Compact_Stack_Advanced + - Repair_Advanced_Factory dedicateddecompactor: type: FCCUPGRADE name: Dedicated De-Compactor recipes: - De-compact_Stack_Advanced + - Repair_Advanced_Factory redstonefactorybasic: type: FCCUPGRADE name: Redstone Factory Basic @@ -474,6 +525,7 @@ factories: - Craft_Redstone_Torch_Basic - Craft_Noteblocks_Basic - Craft_Dispenser_Basic + - Repair_Factory - Upgrade_to_Redstone_Circularity_Factory - Upgrade_to_Redstone_Mechanics_Factory redstonecircularityfactory: @@ -484,6 +536,7 @@ factories: - Craft_Redstone_Torch_Advanced - Craft_Redstone_Comparator - Craft_Daylight_Sensor + - Repair_Advanced_Factory redstonemechanicsfactory: type: FCCUPGRADE name: Redstone Mechanics Factory @@ -495,14 +548,61 @@ factories: - Craft_Dispenser_Advanced - Craft_Droppers - Craft_Redstone_Lamps + - Repair_Advanced_Factory basicenchanter: type: FCCUPGRADE name: Basic Enchanter recipes: - - Upgrade_to_Tool_Enchanter - - Upgrade_to_Weapon_Enchanter - - Upgrade_to_Armour_Enchanter + - Upgrade_to_Tool_Enchanter_ + - Upgrade_to_Weapon_Enchanter_ + - Upgrade_to_Armour_Enchanter_ + - Repair_Advanced_Factory recipes: + Repair_Rudimentary_Factory: + type: REPAIR + name: Repair Factory + production_time: 60s + input: + eye of ender: + material: EYE_OF_ENDER + amount: 1 + health_gained: 2000 + Repair_Small_Factory: + type: REPAIR + name: Repair Factory + production_time: 30s + input: + eye of ender: + material: EYE_OF_ENDER + amount: 1 + health_gained: 1000 + Repair_Factory: + type: REPAIR + name: Repair Factory + production_time: 30s + input: + eye of ender: + material: EYE_OF_ENDER + amount: 1 + health_gained: 500 + Repair_Advanced_Factory: + type: REPAIR + name: Repair Advanced Factory + production_time: 15s + input: + eye of ender: + material: EYE_OF_ENDER + amount: 1 + health_gained: 250 + Repair_Expert_Factory: + type: REPAIR + name: Repair Advanced Factory + production_time: 10s + input: + eye of ender: + material: EYE_OF_ENDER + amount: 1 + health_gained: 75 Bake_Bread_Advanced: type: PRODUCTION name: Bake Bread @@ -3338,16 +3438,16 @@ recipes: material: IRON_INGOT amount: 128 factory: Gem extractor - Upgrade_to_Glass_Dying_: + Upgrade_to_Glass_Dying_Factory: production_time: 3600s type: UPGRADE - name: Upgrade to Glass Dying + name: Upgrade to Glass Dying Factory fuel_consumption_intervall: 30s input: glass: material: GLASS amount: 128 - factory: Glass Dying + factory: Glass Dying Factory Upgrade_to_Gold_Armour_Forge_: production_time: 3600s type: UPGRADE @@ -3598,6 +3698,16 @@ recipes: material: SAND amount: 512 factory: Sand Smelter + Upgrade_to_Advanced_Sand_Smelter: + production_time: 1800s + type: UPGRADE + name: Upgrade to Sand Smelter + fuel_consumption_intervall: 15s + input: + sand: + material: SAND + amount: 1024 + factory: Advanced Sand Smelter Upgrade_to_Sandstone_Smelter: production_time: 1800s type: UPGRADE @@ -3689,7 +3799,7 @@ recipes: durability: -1 amount: 256 factory: Wood Processor - Upgrade_to_Wool_Processing: + Upgrade_to_Wool_Processing_: production_time: 1800s type: UPGRADE name: Upgrade to Wool Processing From 4cd5275ecef9bd13641ff4047ecde03d15f42d2c Mon Sep 17 00:00:00 2001 From: Goldmattress Date: Sun, 28 Feb 2016 21:36:48 +0000 Subject: [PATCH 231/459] Update configCivcraft.yml --- configCivcraft.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c8bed672..93695ee2 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -71,6 +71,7 @@ factories: - Smelt_Coal_Ore_Expert - Smelt_Iron_Ore_Advanced - Smelt_Gold_Ore + - Repair_Advanced_Factory gemextractor: type: FCCUPGRADE name: Gem Extractor @@ -80,6 +81,7 @@ factories: - Extract_Quartz_Advanced - Extract_Redstone_Advanced - Extract_Lapis + - Repair_Advanced_Factory sandsmelter: type: FCCUPGRADE name: Sand Smelter @@ -258,7 +260,7 @@ factories: - Bake_Cookies - Bake_Cake - Bake_Pumpkin_Pie - - Repair_Small_Factory + - Repair_Factory grill: type: FCCUPGRADE name: Grill @@ -327,6 +329,7 @@ factories: name: Flower Gardening recipes: - Create_any_flower + - Repair_Factory treemutator: type: FCCUPGRADE name: Tree Mutator @@ -489,7 +492,7 @@ factories: name: Bastion Factory recipes: - Create_Bastion - - Repair_Advanced_Factory + - Repair_Expert_Factory printingpress: type: FCCUPGRADE name: Printing Press @@ -566,7 +569,7 @@ recipes: eye of ender: material: EYE_OF_ENDER amount: 1 - health_gained: 2000 + health_gained: 1500 Repair_Small_Factory: type: REPAIR name: Repair Factory @@ -575,7 +578,7 @@ recipes: eye of ender: material: EYE_OF_ENDER amount: 1 - health_gained: 1000 + health_gained: 800 Repair_Factory: type: REPAIR name: Repair Factory @@ -584,7 +587,7 @@ recipes: eye of ender: material: EYE_OF_ENDER amount: 1 - health_gained: 500 + health_gained: 350 Repair_Advanced_Factory: type: REPAIR name: Repair Advanced Factory @@ -593,7 +596,7 @@ recipes: eye of ender: material: EYE_OF_ENDER amount: 1 - health_gained: 250 + health_gained: 225 Repair_Expert_Factory: type: REPAIR name: Repair Advanced Factory @@ -602,7 +605,7 @@ recipes: eye of ender: material: EYE_OF_ENDER amount: 1 - health_gained: 75 + health_gained: 65 Bake_Bread_Advanced: type: PRODUCTION name: Bake Bread From 6b3f7237ecc0973bdb88b1d51279c5607d33e7e1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 28 Feb 2016 23:18:53 +0100 Subject: [PATCH 232/459] Add enchantment and lore to eye of ender --- configCivcraft.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 93695ee2..88254e80 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -568,6 +568,11 @@ recipes: input: eye of ender: material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY amount: 1 health_gained: 1500 Repair_Small_Factory: @@ -577,6 +582,11 @@ recipes: input: eye of ender: material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY amount: 1 health_gained: 800 Repair_Factory: @@ -586,6 +596,11 @@ recipes: input: eye of ender: material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY amount: 1 health_gained: 350 Repair_Advanced_Factory: @@ -594,7 +609,12 @@ recipes: production_time: 15s input: eye of ender: - material: EYE_OF_ENDER + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY amount: 1 health_gained: 225 Repair_Expert_Factory: @@ -604,6 +624,11 @@ recipes: input: eye of ender: material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY amount: 1 health_gained: 65 Bake_Bread_Advanced: From 93b4944fc8440c4c011b69e61e7d695ba7a4d606 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 29 Feb 2016 02:15:48 +0100 Subject: [PATCH 233/459] Improve factory creation check to respect -1 dura --- .../igotyou/FactoryMod/FactoryModManager.java | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index cffe5c5a..4a70e21f 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -241,8 +241,14 @@ public void attemptCreation(Block b, Player p) { HashMap eggs = factoryCreationRecipes .get(FurnCraftChestStructure.class); if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Chest) (fccs - .getChest().getState())).getInventory())); + IFactoryEgg egg = null; + for(Entry entry: eggs.entrySet()) { + if (entry.getKey().containedExactlyIn(((Chest) (fccs + .getChest().getState())).getInventory())) { + egg = entry.getValue(); + break; + } + } if (egg != null) { Factory f = egg.hatch(fccs, p); if (f != null) { @@ -278,8 +284,14 @@ public void attemptCreation(Block b, Player p) { HashMap eggs = factoryCreationRecipes .get(PipeStructure.class); if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Dispenser) (ps - .getStart().getState())).getInventory())); + IFactoryEgg egg = null; + for(Entry entry: eggs.entrySet()) { + if (entry.getKey().containedExactlyIn((((Dispenser) (ps + .getStart().getState())).getInventory()))) { + egg = entry.getValue(); + break; + } + } if (egg != null) { if (ps.getGlassColor() != ((PipeEgg) egg) .getColor()) { @@ -324,9 +336,15 @@ public void attemptCreation(Block b, Player p) { HashMap eggs = factoryCreationRecipes .get(BlockFurnaceStructure.class); if (eggs != null) { - IFactoryEgg egg = eggs.get(new ItemMap(((Dropper) (bfs - .getCenter().getBlock().getState())) - .getInventory())); + IFactoryEgg egg = null; + for(Entry entry: eggs.entrySet()) { + if (entry.getKey().containedExactlyIn(((Dropper) (bfs + .getCenter().getBlock().getState())) + .getInventory())) { + egg = entry.getValue(); + break; + } + } if (egg != null) { Factory f = egg.hatch(bfs, p); if (f != null) { From 845e3287ec8e792f107a9f6f84c453fca47877d8 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 29 Feb 2016 04:14:26 +0100 Subject: [PATCH 234/459] Fix cauldron identifier to use item and not block --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 88254e80..aaeed6d2 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3583,7 +3583,7 @@ recipes: fuel_consumption_intervall: 3s input: cauldron: - material: CAULDRON + material: CAULDRON_ITEM amount: 16 glass bottle: material: GLASS_BOTTLE From 796f8d2f08f8ed9c7956448b617e150c883beac9 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 29 Feb 2016 18:51:13 +0100 Subject: [PATCH 235/459] Turn furnaces off hopefully --- .../github/igotyou/FactoryMod/factories/Factory.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 8ca6d3dc..636f8211 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -152,15 +152,6 @@ public void turnFurnaceOff(Block f) { return; } Furnace furnace = (Furnace) f.getState(); - ItemStack[] oldContents = furnace.getInventory().getContents(); - BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); - furnace.getInventory().clear(); - f.setType(Material.FURNACE); - furnace = (Furnace) f.getState(); - MaterialData data = furnace.getData(); - ((DirectionalContainer)data).setFacingDirection(facing); - furnace.setData(data); - furnace.update(); - furnace.getInventory().setContents(oldContents); + furnace.setBurnTime((short)0); } } From cee408428514ff6c1884c63c6cbea10e92c02810 Mon Sep 17 00:00:00 2001 From: KillerSmurf Date: Mon, 29 Feb 2016 10:46:24 -0800 Subject: [PATCH 236/459] Update configCivcraft.yml Added a basic conversion of logs to charcoal in the basic contraption. Added an advanced conversion of logs to charcoal to the woodprocessor. Added recipes for burning logs to charcoal (advanced, and basic). --- configCivcraft.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index aaeed6d2..d2a598f8 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,7 @@ factories: - Smelt_Stone_Basic - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic + - Burn_Charcoal_from_Logs_Basic - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory @@ -205,7 +206,7 @@ factories: type: FCCUPGRADE name: Wood Processor recipes: - - Burn_Charcoal_from_Logs_Basic + - Burn_Charcoal_from_Logs_Advanced - Craft_Oak_Fence - Cut_any_type_of_Plank_Basic - Repair_Rudimentary_Factory @@ -236,7 +237,6 @@ factories: name: Coal Burner recipes: - Burn_Charcoal_from_Coal - - Burn_Charcoal_from_Logs_Advanced - Repair_Small_Factory farmsteadfactory: type: FCCUPGRADE @@ -735,6 +735,34 @@ recipes: material: COAL amount: 128 durability: 1 + Burn_Charcoal_from_Logs_Basic: + type: PRODUCTION + name: Burn Charcoal from Logs + production_time: 15s + input: + log: + material: LOG + durability: -1 + amount: 64 + output: + charcoal: + material: COAL + amount: 96 + durability: 1 + Burn_Charcoal_from_Logs_Advanced: + type: PRODUCTION + name: Burn Charcoal from Logs + production_time: 25s + input: + log: + material: LOG + durability: -1 + amount: 64 + output: + charcoal: + material: COAL + amount: 128 + durability: 1 Compact_Stack_Advanced: type: COMPACT name: Compact Stack From d0d53c5ff3984974f0ce3cadc43ac83584e847d2 Mon Sep 17 00:00:00 2001 From: KillerSmurf Date: Mon, 29 Feb 2016 10:53:44 -0800 Subject: [PATCH 237/459] Update configCivcraft.yml Added expert recipe for logs to charcoal Added expert burning logs to charcoal to the coalburner --- configCivcraft.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index d2a598f8..6776d19f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -236,6 +236,7 @@ factories: type: FCCUPGRADE name: Coal Burner recipes: + - Burn_Charcoal_from_Logs_Expert - Burn_Charcoal_from_Coal - Repair_Small_Factory farmsteadfactory: @@ -763,6 +764,20 @@ recipes: material: COAL amount: 128 durability: 1 + Burn_Charcoal_from_Logs_Expert: + type: PRODUCTION + name: Burn Charcoal from Logs + production_time: 30s + input: + log: + material: LOG + durability: -1 + amount: 64 + output: + charcoal: + material: COAL + amount: 160 + durability: 1 Compact_Stack_Advanced: type: COMPACT name: Compact Stack From 6fea3e336efddcc49f40eb3eaad51ae7f1461eda Mon Sep 17 00:00:00 2001 From: KillerSmurf Date: Mon, 29 Feb 2016 11:24:56 -0800 Subject: [PATCH 238/459] Update configCivcraft.yml Refactored a lot of recipe names to match the recipe names listed under the factories. Added a basic efficiency enchant to laboratory. This is to make it so a low level factory such as the laboratory has some helpful enchants, but they aren't that strong. It only enchants to level 1 efficiency. --- configCivcraft.yml | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 6776d19f..9e5fad29 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -480,7 +480,7 @@ factories: recipes: - Craft_Redstone_Repeater_Basic - Craft_Dispenser_Basic - - Enchant_Efficiency + - Enchant_Efficiency_Basic - Random_Printing_Press_Recipe - Repair_Small_Factory - Upgrade_to_Bastion_Factory @@ -557,9 +557,9 @@ factories: type: FCCUPGRADE name: Basic Enchanter recipes: - - Upgrade_to_Tool_Enchanter_ - - Upgrade_to_Weapon_Enchanter_ - - Upgrade_to_Armour_Enchanter_ + - Upgrade_to_Tool_Enchanter + - Upgrade_to_Weapon_Enchanter + - Upgrade_to_Armour_Enchanter - Repair_Advanced_Factory recipes: Repair_Rudimentary_Factory: @@ -913,7 +913,7 @@ recipes: identifiername: material: STONE amount: 1 - Craft_any_type_of_wooden_door_: + Craft_any_type_of_wooden_door: type: PRODUCTION name: Craft any type of wooden door production_time: 5s @@ -937,7 +937,7 @@ recipes: identifiername: material: STONE amount: 1 - Craft_any_type_of_wooden_stair_: + Craft_any_type_of_wooden_stair: type: PRODUCTION name: Craft any type of wooden stair production_time: 5s @@ -1630,7 +1630,7 @@ recipes: material: STEP durability: 5 amount: 128 - Craft_Stonebrick_Stairs_: + Craft_Stonebrick_Stairs: type: PRODUCTION name: Craft Stonebrick Stairs production_time: 5s @@ -1721,7 +1721,7 @@ recipes: identifiername: material: STONE amount: 1 - Create_Bastion_: + Create_Bastion: type: PRODUCTION name: Create Bastion production_time: 5s @@ -1792,7 +1792,7 @@ recipes: lead: material: LEASH amount: 16 - Create_Mycelium_: + Create_Mycelium: type: PRODUCTION name: Create Mycelium production_time: 5s @@ -1804,7 +1804,7 @@ recipes: mycelium: material: MYCEL amount: 64 - Create_Nametags_: + Create_Nametags: type: PRODUCTION name: Create Nametags production_time: 5s @@ -1989,7 +1989,7 @@ recipes: material: WOOL durability: 4 amount: 64 - Enchant_Efficiency_: + Enchant_Efficiency_Basic: type: PRODUCTION name: Enchant Efficiency production_time: 5s @@ -1999,7 +1999,7 @@ recipes: amount: 1 emerald block: material: EMERALD_BLOCK - amount: 4 + amount: 1 output: diamond pickaxe: material: DIAMOND_PICKAXE @@ -2007,7 +2007,7 @@ recipes: enchants: efficiency: enchant: DIG_SPEED - level: 5 + level: 1 Extract_Diamonds: type: PRODUCTION name: Extract Diamonds @@ -2165,7 +2165,7 @@ recipes: diamond horse armor: material: DIAMOND_BARDING amount: 1 - Forge_Diamond_Leggings_: + Forge_Diamond_Leggings: type: PRODUCTION name: Forge Diamond Leggings production_time: 5s @@ -2285,7 +2285,7 @@ recipes: gold horse armor: material: GOLD_BARDING amount: 1 - Forge_Gold_Leggings_: + Forge_Gold_Leggings: type: PRODUCTION name: Forge Gold Leggings production_time: 5s @@ -2405,7 +2405,7 @@ recipes: iron horse armor: material: IRON_BARDING amount: 1 - Forge_Iron_Leggings_: + Forge_Iron_Leggings: type: PRODUCTION name: Forge Iron Leggings production_time: 5s @@ -2711,7 +2711,7 @@ recipes: identifiername: material: STONE amount: 1 - Mutate_Large_Fern_: + Mutate_Large_Fern: type: PRODUCTION name: Mutate Large Fern production_time: 5s @@ -2753,7 +2753,7 @@ recipes: material: DOUBLE_PLANT amount: 32 durability: 2 - Random_Printing_Press_Recipe_: + Random_Printing_Press_Recipe: type: PRODUCTION name: Random Printing Press Recipe production_time: 5s @@ -2790,7 +2790,7 @@ recipes: material: RED_SANDSTONE durability: 1 amount: 64 - Smelt_Chiselled_Sandstone_: + Smelt_Chiselled_Sandstone: type: PRODUCTION name: Smelt Chiselled Sandstone production_time: 5s @@ -3480,7 +3480,7 @@ recipes: material: IRON_AXE amount: 1 factory: Fine Woodworking - Upgrade_to_Flower_Gardening_: + Upgrade_to_Flower_Gardening: production_time: 1800s type: UPGRADE name: Upgrade to Flower Gardening @@ -3493,7 +3493,7 @@ recipes: material: DIRT amount: 512 factory: Flower Gardening - Upgrade_to_Gem_extractor_: + Upgrade_to_Gem_extractor: production_time: 7200s type: UPGRADE name: Upgrade to Gem extractor @@ -3519,7 +3519,7 @@ recipes: material: GLASS amount: 128 factory: Glass Dying Factory - Upgrade_to_Gold_Armour_Forge_: + Upgrade_to_Gold_Armour_Forge: production_time: 3600s type: UPGRADE name: Upgrade to Gold Armour Forge @@ -3710,7 +3710,7 @@ recipes: material: PAPER amount: 64 factory: Printing Press - Upgrade_to_Rail_Factory_: + Upgrade_to_Rail_Factory: production_time: 1800s type: UPGRADE name: Upgrade to Rail Factory @@ -3870,7 +3870,7 @@ recipes: durability: -1 amount: 256 factory: Wood Processor - Upgrade_to_Wool_Processing_: + Upgrade_to_Wool_Processing: production_time: 1800s type: UPGRADE name: Upgrade to Wool Processing From 5eb3d7b56c0576c7b9f78c8fb1f09946ab64322c Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 29 Feb 2016 20:41:18 +0100 Subject: [PATCH 239/459] Add drops when killing factory --- configCivcraft.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 9e5fad29..088b3a61 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -12,6 +12,7 @@ default_fuel: default_fuel_consumption_intervall: 2s default_menu_factory: Basic Contraption log_inventories: true +default_return_rate: 0.5 break_grace_period: 10d decay_intervall: 1h decay_amount: 21 From de7750a7b5985fa7a8a3311c403bad244a1c6f7d Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 29 Feb 2016 21:13:06 +0100 Subject: [PATCH 240/459] Update Factory.java --- src/com/github/igotyou/FactoryMod/factories/Factory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 636f8211..d4a6eb43 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -153,5 +153,6 @@ public void turnFurnaceOff(Block f) { } Furnace furnace = (Furnace) f.getState(); furnace.setBurnTime((short)0); + furnace.update(); } } From e48aa4979a5b22336de0adc7bb1257e6881fa97d Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 1 Mar 2016 22:08:58 +0100 Subject: [PATCH 241/459] Remove old debug message --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 682f52c0..34d9fb13 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -177,7 +177,6 @@ private void parseFactory(ConfigurationSection config) { } ItemMap setupCost = parseItemMap(config .getConfigurationSection("setupcost")); - System.out.println(setupCost.toString()); if (setupCost.getTotalUniqueItemAmount() > 0) { manager.addFactoryCreationEgg(FurnCraftChestStructure.class, setupCost, egg); From 4dfae430161fd5d92bcada6976d6b5db474e7ee4 Mon Sep 17 00:00:00 2001 From: KillerSmurf Date: Tue, 1 Mar 2016 17:05:11 -0800 Subject: [PATCH 242/459] Update configCivcraft.yml Fix for issue #184: Fixed inconsistency in listing factories for upgrade recipes. Added a wool processing factory, has no recipes for it, but should remove the console error. Fixed certain recipes listed under factories having two spaces instead of an underscore like expected by the declaration of the recipe below. --- configCivcraft.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 088b3a61..a2e65ee5 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -101,7 +101,6 @@ factories: type: FCCUPGRADE name: Glass Dying Factory recipes: - - foo - Repair_Factory advancedsandsmelter: type: FCCUPGRADE @@ -150,7 +149,7 @@ factories: - Repair_Factory stonebricksmelter: type: FCCUPGRADE - name: Stone Brick Smelter + name: Stonebrick Smelter recipes: - Craft_Stonebricks_Advanced - Craft_Stonebrick_Stairs @@ -161,7 +160,7 @@ factories: - Repair_Factory netherbricksmelter: type: FCCUPGRADE - name: Nether Brick Smelter + name: Netherbrick Smelter recipes: - Smelt_Netherbrick_Advanced - Craft_Netherbrick_Fence @@ -300,12 +299,16 @@ factories: - Create_Nametags - Create_Leads - Repair_Factory + woolprocessor: + type: FCCUPGRADE + name: Wool Processing + recipes: biolab: type: FCCUPGRADE name: Bio Lab recipes: - Create_Poppy_Advanced - - Mutate_Tall_Grass Basic + - Mutate_Tall_Grass_Basic - Take_friendly_mob_egg_apart - Create_Podzol_Basic - Repair_Small_Factory @@ -318,7 +321,7 @@ factories: type: FCCUPGRADE name: Grass Gardening recipes: - - Mutate_Tall_Grass Advanced + - Mutate_Tall_Grass_Advanced - Mutate_Large_Fern - Kill_Dead_Bush - Grow_Grass @@ -500,7 +503,6 @@ factories: name: Printing Press recipes: - Repair_Factory - - foo compactorbasic: type: FCCUPGRADE name: Compactor Basic From 095847e09272865597584cfc52ea8c7a5f20e53b Mon Sep 17 00:00:00 2001 From: KillerSmurf Date: Tue, 1 Mar 2016 17:20:10 -0800 Subject: [PATCH 243/459] Update Factory.java Fixed furnaces not turning off after completing task. --- src/com/github/igotyou/FactoryMod/factories/Factory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index d4a6eb43..016e6edc 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -148,7 +148,8 @@ public String getLogData() { } public void turnFurnaceOff(Block f) { - if (f.getType() != Material.FURNACE) { + //Since we are turning it off that implies its on, that means we should check if the furnace is burning. + if (f.getType() != Material.BURNING_FURNACE) { return; } Furnace furnace = (Furnace) f.getState(); From 3ca39797b78fb6ab44499321f6459ab57579d546 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 3 Mar 2016 23:27:03 +0100 Subject: [PATCH 244/459] Persist recipe count across restarts --- .../FactoryMod/utility/FileHandler.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index 717affcf..7b61be58 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -29,6 +29,7 @@ import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.factories.Pipe; import com.github.igotyou.FactoryMod.factories.Sorter; +import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; @@ -77,6 +78,9 @@ public void save(Collection factories) { config.set(current + ".runtime", fccf.getRunningTime()); config.set(current + ".selectedRecipe", fccf .getCurrentRecipe().getRecipeName()); + for(IRecipe i : ((FurnCraftChestFactory) f).getRecipes()) { + config.set(current + ".runcounts." + i.getRecipeName(), fccf.getRunCount(i)); + } } else if (f instanceof Pipe) { Pipe p = (Pipe) f; config.set(current + ".type", "PIPE"); @@ -169,8 +173,20 @@ private void loadFromFile(File f, Map eggs) { } int health = current.getInt("health"); String selectedRecipe = current.getString("selectedRecipe"); - Factory fac = egg.revive(blocks, health, selectedRecipe, + FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, runtime); + ConfigurationSection runCounts = current.getConfigurationSection("runcounts"); + if(runCounts != null) { + for(String countKey : runCounts.getKeys(false)) { + int runs = runCounts.getInt(countKey); + for(IRecipe r : fac.getRecipes()) { + if (r.getRecipeName().equals(countKey)) { + fac.setRunCount(r, runs); + break; + } + } + } + } manager.addFactory(fac); counter++; break; From 4417e3df6f59528bb955237ed65ef64cd0c321e5 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 04:19:45 +0100 Subject: [PATCH 245/459] Fix menu for big inputs/outputs --- .../igotyou/FactoryMod/utility/MenuBuilder.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index ac8c980f..c9ecd4e7 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -421,7 +421,11 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { DecorationStack inputClickable = new DecorationStack(inputStack); ci.setSlot(inputClickable, 4); int index = 13; - for (ItemStack is : rec.getInputRepresentation(null)) { + List ins = rec.getInputRepresentation(null); + if (ins.size() > 18) { + ins = new ItemMap(ins).getLoredItemCountRepresentation(); + } + for (ItemStack is : ins) { Clickable c = new DecorationStack(is); ci.setSlot(c, index); // weird math to fill up the gui nicely @@ -457,7 +461,11 @@ public void clicked(Player arg0) { ci.setSlot(outputClickable, 31); index = 40; - for (ItemStack is : rec.getOutputRepresentation(null)) { + List out = rec.getOutputRepresentation(null); + if (out.size() > 18) { + out = new ItemMap(out).getLoredItemCountRepresentation(); + } + for (ItemStack is : out) { Clickable c; if (rec instanceof Upgraderecipe) { c = new Clickable(is) { From 4819344b983e183560b78370cb55b80d0681f382 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 04:20:00 +0100 Subject: [PATCH 246/459] Begin to rework config --- configCivcraft.yml | 180 +++++++++++++++++++++++++-------------------- 1 file changed, 99 insertions(+), 81 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a2e65ee5..45fb1b23 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1,9 +1,3 @@ -# -# inputmat1: -# material: STONE -# inputmat345FF: -# material: DIRT - default_update_time: 1s default_fuel: charcoal: @@ -11,7 +5,6 @@ default_fuel: durability: 1 default_fuel_consumption_intervall: 2s default_menu_factory: Basic Contraption -log_inventories: true default_return_rate: 0.5 break_grace_period: 10d decay_intervall: 1h @@ -25,10 +18,10 @@ factories: planks: material: WOOD durability: -1 - amount: 64 + amount: 1024 stone: material: STONE - amount: 64 + amount: 256 bread: material: BREAD amount: 32 @@ -208,7 +201,7 @@ factories: recipes: - Burn_Charcoal_from_Logs_Advanced - Craft_Oak_Fence - - Cut_any_type_of_Plank_Basic + - Cut_any_type_of_Plank_Advanced - Repair_Rudimentary_Factory - Upgrade_to_Carpentry - Upgrade_to_Fine_Woodworking @@ -222,6 +215,7 @@ factories: - Craft_any_type_of_wooden_stair - Craft_any_type_of_wooden_slab - Craft_any_type_of_wooden_door + - Cut_any_type_of_Plank_Expert - Repair_Small_Factory finewoodworking: type: FCCUPGRADE @@ -243,7 +237,7 @@ factories: type: FCCUPGRADE name: Farmstead Factory recipes: - - Bake_Bread_Basic + - Bake_Bread_Advanced - Grill_Steak_Basic - Create_Poppy_Basic - Repair_Rudimentary_Factory @@ -257,7 +251,7 @@ factories: name: Bakery recipes: - Bake_Potatoes - - Bake_Bread_Advanced + - Bake_Bread_Expert - Bake_Cookies - Bake_Cake - Bake_Pumpkin_Pie @@ -485,7 +479,6 @@ factories: - Craft_Redstone_Repeater_Basic - Craft_Dispenser_Basic - Enchant_Efficiency_Basic - - Random_Printing_Press_Recipe - Repair_Small_Factory - Upgrade_to_Bastion_Factory - Upgrade_to_Compactor_Basic @@ -638,7 +631,7 @@ recipes: Bake_Bread_Advanced: type: PRODUCTION name: Bake Bread - production_time: 10s + production_time: 30s input: wheat: material: WHEAT @@ -646,19 +639,31 @@ recipes: output: bread: material: BREAD - amount: 1024 - Bake_Bread_Basic: + amount: 128 + Bake_Bread_Expert: type: PRODUCTION name: Bake Bread - production_time: 5s + production_time: 30s input: wheat: material: WHEAT + amount: 384 + output: + bread: + material: BREAD amount: 256 + Bake_Bread_Basic: + type: PRODUCTION + name: Bake Bread + production_time: 20s + input: + wheat: + material: WHEAT + amount: 64 output: bread: material: BREAD - amount: 512 + amount: 27 Bake_Cake: type: PRODUCTION name: Bake Cake @@ -729,7 +734,7 @@ recipes: Burn_Charcoal_from_Coal: type: PRODUCTION name: Burn Charcoal from Coal - production_time: 10s + production_time: 16s input: coal: material: COAL @@ -742,7 +747,7 @@ recipes: Burn_Charcoal_from_Logs_Basic: type: PRODUCTION name: Burn Charcoal from Logs - production_time: 15s + production_time: 16s input: log: material: LOG @@ -751,35 +756,35 @@ recipes: output: charcoal: material: COAL - amount: 96 + amount: 80 durability: 1 Burn_Charcoal_from_Logs_Advanced: type: PRODUCTION name: Burn Charcoal from Logs - production_time: 25s + production_time: 28s input: log: material: LOG durability: -1 - amount: 64 + amount: 128 output: charcoal: material: COAL - amount: 128 + amount: 192 durability: 1 Burn_Charcoal_from_Logs_Expert: type: PRODUCTION name: Burn Charcoal from Logs - production_time: 30s + production_time: 45s input: log: material: LOG durability: -1 - amount: 64 + amount: 512 output: charcoal: material: COAL - amount: 160 + amount: 1024 durability: 1 Compact_Stack_Advanced: type: COMPACT @@ -1903,31 +1908,47 @@ recipes: material: RAILS amount: 128 Cut_any_type_of_Plank_Advanced: - type: PRODUCTION - name: Cut Oak Planks Advanced - production_time: 2s + type: WOODMAPPING + name: Cut Planks + production_time: 15s input: log: material: LOG - durability: -1 - amount: 10 + durability: -2 + amount: 128 output: planks: material: WOOD - amount: 60 + amount: 600 + durabiliy: -2 Cut_any_type_of_Plank_Basic: - type: PRODUCTION - name: Cut Oak Planks Basic - production_time: 2s + type: WOODMAPPING + name: Cut Planks + production_time: 5s input: log: material: LOG - durability: -1 - amount: 10 + durability: -2 + amount: 32 output: planks: material: WOOD - amount: 50 + durability: -2 + amount: 140 + Cut_any_type_of_Plank_Expert: + type: WOODMAPPING + name: Cut Planks Expert + production_time: 30s + input: + log: + material: LOG + durability: -2 + amount: 256 + output: + planks: + material: WOOD + amount: 1280 + durability: -2 De-compact_Stack_Advanced: type: DECOMPACT name: De-compact Stack @@ -2825,15 +2846,15 @@ recipes: input: coal ore: material: COAL_ORE - amount: 64 + amount: 128 output: coal: material: COAL amount: 256 Smelt_Coal_Ore_Basic: type: PRODUCTION - name: Smelt Coal Ore Basic - production_time: 5s + name: Smelt Coal Ore + production_time: 16s input: coal ore: material: COAL_ORE @@ -2841,19 +2862,19 @@ recipes: output: coal: material: COAL - amount: 192 + amount: 80 Smelt_Coal_Ore_Expert: type: PRODUCTION - name: Smelt Coal Ore Expert + name: Smelt Coal Ore production_time: 5s input: coal ore: material: COAL_ORE - amount: 64 + amount: 256 output: coal: material: COAL - amount: 384 + amount: Smelt_Dark_Prismarine: type: PRODUCTION name: Smelt Dark Prismarine @@ -3143,15 +3164,15 @@ recipes: Smelt_Stone_Advanced: type: PRODUCTION name: Smelt Stone - production_time: 10s + production_time: 35s input: sobblestone: material: COBBLESTONE - amount: 64 + amount: 256 output: stone: material: STONE - amount: 128 + amount: 320 Smelt_Stone_Basic: type: PRODUCTION name: Smelt Stone @@ -3159,23 +3180,23 @@ recipes: input: sobblestone: material: COBBLESTONE - amount: 64 + amount: 128 output: stone: material: STONE - amount: 96 + amount: 140 Smelt_Stone_Expert: type: PRODUCTION name: Smelt Stone - production_time: 5s + production_time: 60s input: sobblestone: material: COBBLESTONE - amount: 64 + amount: 512 output: stone: material: STONE - amount: 192 + amount: 720 Take_any_mob_egg_apart: type: PRODUCTION name: Take any mob egg apart @@ -3319,10 +3340,10 @@ recipes: amount: 256 factory: Bio Lab Upgrade_to_Blacksmith: - production_time: 300s + production_time: 10m type: UPGRADE name: Upgrade to Blacksmith - fuel_consumption_intervall: 3s + fuel_consumption_intervall: 20s input: iron ingot: material: IRON_INGOT @@ -3448,26 +3469,23 @@ recipes: amount: 32 factory: Enchanter Basic Upgrade_to_Farmstead_Factory: - production_time: 300s + production_time: 10m type: UPGRADE name: Upgrade to Farmstead Factory - fuel_consumption_intervall: 3s + fuel_consumption_intervall: 20s input: wheat: - material: WHEAT - amount: 512 - carrot: - material: CARROT_ITEM - amount: 512 + material: BREAD + amount: 384 potato: - material: POTATO_ITEM + material: BAKED_POTATO amount: 512 chicken: - material: RAW_CHICKEN - amount: 64 + material: COOKED_CHICKEN + amount: 96 beef: - material: RAW_BEEF - amount: 64 + material: COOKED_PORK + amount: 96 factory: Farmstead Factory Upgrade_to_Fine_Woodworking: production_time: 900s @@ -3623,17 +3641,17 @@ recipes: amount: 128 factory: Kiln Upgrade_to_Laboratory: - production_time: 300s + production_time: 10m type: UPGRADE name: Upgrade to Laboratory - fuel_consumption_intervall: 3s + fuel_consumption_intervall: 20s input: cauldron: - material: CAULDRON_ITEM - amount: 16 + material: REDSTONE + amount: 256 glass bottle: - material: GLASS_BOTTLE - amount: 128 + material: CAULDRON_ITEM + amount: 32 factory: Laboratory Upgrade_to_Mad_Scientist: production_time: 1800s @@ -3812,14 +3830,14 @@ recipes: amount: 64 factory: Soup kitchen Upgrade_to_Stone_Smelter: - production_time: 300s + production_time: 10m type: UPGRADE name: Upgrade to Stone Smelter - fuel_consumption_intervall: 3s + fuel_consumption_intervall: 20s input: stone: material: STONE - amount: 512 + amount: 640 factory: Stone Smelter Upgrade_to_Stonebrick_Smelter: production_time: 1800s @@ -3863,15 +3881,15 @@ recipes: amount: 32 factory: Weapon Enchanter Upgrade_to_Wood_Processor: - production_time: 300s + production_time: 10m type: UPGRADE name: Upgrade to Wood Processor - fuel_consumption_intervall: 3s + fuel_consumption_intervall: 20s input: planks: - material: WOOD + material: LOG durability: -1 - amount: 256 + amount: 512 factory: Wood Processor Upgrade_to_Wool_Processing: production_time: 1800s From 9eb732e8433154e40d5d912d0ff9bcc0ffd98325 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 4 Mar 2016 04:31:22 +0100 Subject: [PATCH 247/459] Update CivModCore version in pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 066e3b82..996893ec 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.1.96 + 1.2 provided From 37b8bc504f3659b7c9037559ec0eae4bde0f4905 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 04:37:59 +0100 Subject: [PATCH 248/459] Fix identifier in config --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 45fb1b23..7e92c44d 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3484,7 +3484,7 @@ recipes: material: COOKED_CHICKEN amount: 96 beef: - material: COOKED_PORK + material: GRILLED_PORK amount: 96 factory: Farmstead Factory Upgrade_to_Fine_Woodworking: From c27c25fe880226cf78c0787302b463d24a8cee5d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 04:55:23 +0100 Subject: [PATCH 249/459] Count right --- .../github/igotyou/FactoryMod/utility/MenuBuilder.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index c9ecd4e7..6e790992 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -252,7 +252,7 @@ private void openSetupBrowser(Player p, String facName) { slot -= (((slot % 9) - 4) * 2); } else { if ((slot % 9) == 0) { - slot += 9; + slot += 13; } else { slot += (((4 - (slot % 9)) * 2) + 1); } @@ -308,7 +308,7 @@ public void clicked(Player arg0) { slot -= (((slot % 9) - 4) * 2); } else { if ((slot % 9) == 0) { - slot += 9; + slot += 13; } else { slot += (((4 - (slot % 9)) * 2) + 1); } @@ -422,9 +422,11 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { ci.setSlot(inputClickable, 4); int index = 13; List ins = rec.getInputRepresentation(null); + System.out.println(ins.size()); if (ins.size() > 18) { ins = new ItemMap(ins).getLoredItemCountRepresentation(); } + System.out.println(ins.size()); for (ItemStack is : ins) { Clickable c = new DecorationStack(is); ci.setSlot(c, index); @@ -437,7 +439,7 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { index -= (((index % 9) - 4) * 2); } else { if ((index % 9) == 0) { - index += 9; + index += 13; } else { index += (((4 - (index % 9)) * 2) + 1); } @@ -500,7 +502,7 @@ public void clicked(Player arg0) { index -= (((index % 9) - 4) * 2); } else { if ((index % 9) == 0) { - index += 9; + index += 13; } else { index += (((4 - (index % 9)) * 2) + 1); } From 6f17e56b683ba3e0120ce391f41b1024325728b1 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 04:58:37 +0100 Subject: [PATCH 250/459] Cant use menu in vehicles --- src/com/github/igotyou/FactoryMod/commands/commands/Menu.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java index 164f054f..f0cfb995 100644 --- a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -30,6 +30,10 @@ public boolean execute(CommandSender sender, String[] args) { } MenuBuilder mb = FactoryMod.getMenuBuilder(); Player p = (Player) sender; + if (p.isInsideVehicle()) { + p.sendMessage(ChatColor.RED + "You can't use this command in vehicles"); + return true; + } if (args.length == 0) { mb.openFactoryBrowser(p, null); } else { From 796fa6ff381683d83da00ce18edc901747d70d9e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 05:36:18 +0100 Subject: [PATCH 251/459] Give recipes their own fuel consumption value --- .../github/igotyou/FactoryMod/ConfigParser.java | 2 ++ .../factories/FurnCraftChestFactory.java | 14 +++++++++----- .../igotyou/FactoryMod/recipes/InputRecipe.java | 9 +++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 34d9fb13..5d87bb17 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -26,6 +26,7 @@ import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; @@ -480,6 +481,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { + " as a valid recipe identifier"); result = null; } + ((InputRecipe)result).setFuelConsumptionIntervall(config.getInt("fuel_consumption_intervall", -1)); plugin.info("Parsed recipe " + name); return result; } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 58831209..56d5dec5 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -19,6 +19,7 @@ import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.recipes.IRecipe; +import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.PylonRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; @@ -212,8 +213,11 @@ public void run() { if (pm.powerAvailable()) { // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed - if (pm.getPowerCounter() >= pm - .getPowerConsumptionIntervall() - 1) { + int consumptionIntervall = ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() : pm + .getPowerConsumptionIntervall(); + if (pm.getPowerCounter() >= consumptionIntervall - 1) { // remove one fuel. pm.consumePower(); // 0 seconds since last fuel consumption @@ -266,8 +270,7 @@ else if (currentProductionTimer >= currentRecipe } else { deactivate(); } - } - else { + } else { deactivate(); } } @@ -341,7 +344,8 @@ public void upgrade(String name, List recipes, ItemStack fuel, this.updateTime = updateTime; this.pm = new FurnacePowerManager(getFurnace(), fuel, fuelConsumptionIntervall); - ((PercentageHealthRepairManager) this.rm).repair(PercentageHealthRepairManager.getMaximumHealth()); + ((PercentageHealthRepairManager) this.rm) + .repair(PercentageHealthRepairManager.getMaximumHealth()); if (recipes.size() != 0) { setRecipe(recipes.get(0)); } else { diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 66b0de83..56d10e6d 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -22,6 +22,7 @@ public abstract class InputRecipe implements IRecipe { protected String name; protected int productionTime; protected ItemMap input; + protected int fuel_consumption_intervall = -1; public InputRecipe(String name, int productionTime, ItemMap input) { this.name = name; @@ -64,6 +65,14 @@ public InputRecipe(String name, int productionTime, ItemMap input) { public String getRecipeName() { return name; } + + public int getFuelConsumptionIntervall() { + return fuel_consumption_intervall; + } + + public void setFuelConsumptionIntervall(int intervall) { + this.fuel_consumption_intervall = intervall; + } public int getProductionTime() { return productionTime; From 9ca395584b84dcd67de48a087892d35ca7aa94dd Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 4 Mar 2016 05:49:06 +0100 Subject: [PATCH 252/459] Add nullcheck --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 5d87bb17..1d70f84a 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -481,8 +481,10 @@ private IRecipe parseRecipe(ConfigurationSection config) { + " as a valid recipe identifier"); result = null; } - ((InputRecipe)result).setFuelConsumptionIntervall(config.getInt("fuel_consumption_intervall", -1)); - plugin.info("Parsed recipe " + name); + if (result != null) { + ((InputRecipe)result).setFuelConsumptionIntervall(config.getInt("fuel_consumption_intervall", -1)); + plugin.info("Parsed recipe " + name); + } return result; } From 0ca3f70c080982bbe6f4d7f3c0ca1bb8a0b9b079 Mon Sep 17 00:00:00 2001 From: Gordon Date: Sat, 5 Mar 2016 23:16:04 -0600 Subject: [PATCH 253/459] Add recipe for smelting acacia and dark oak logs --- configCivcraft.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 7e92c44d..1acdfcc8 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -231,6 +231,7 @@ factories: name: Coal Burner recipes: - Burn_Charcoal_from_Logs_Expert + - Burn_Charcoal_from_Logs2_Expert - Burn_Charcoal_from_Coal - Repair_Small_Factory farmsteadfactory: @@ -786,6 +787,20 @@ recipes: material: COAL amount: 1024 durability: 1 + Burn_Charcoal_from_Logs2_Expert: + type: PRODUCTION + name: Burn Charcoal from Logs2 + production_time: 45s + input: + log: + material: LOG_2 + durability: -1 + amount: 512 + output: + charcoal: + material: COAL + amount: 1024 + durability: 1 Compact_Stack_Advanced: type: COMPACT name: Compact Stack From c63676b67d3e46da383fa867976c2b32aeda6e0b Mon Sep 17 00:00:00 2001 From: biggestnerd Date: Sun, 6 Mar 2016 13:11:06 -0600 Subject: [PATCH 254/459] Fix for wildcard durability drops --- .../FactoryMod/repairManager/PercentageHealthRepairManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 71a3fee9..616de6a4 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -92,6 +92,7 @@ public static void returnStuff(Factory factory) { ItemMap im = new ItemMap(); im.addItemAmount(items.getKey(), returnAmount); for (ItemStack is : im.getItemStackRepresentation()) { + if(is.getDurability() == -1) is.setDurability(0); factory.getMultiBlockStructure() .getCenter() .getWorld() From 696662ab9a830b2afac689ed71b2cff9ff7e2955 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 6 Mar 2016 21:41:22 +0100 Subject: [PATCH 255/459] Update Coal Ore smelting --- configCivcraft.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 1acdfcc8..c42b52e4 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2857,7 +2857,7 @@ recipes: Smelt_Coal_Ore_Advanced: type: PRODUCTION name: Smelt Coal Ore Advanced - production_time: 5s + production_time: 30s input: coal ore: material: COAL_ORE @@ -2881,7 +2881,7 @@ recipes: Smelt_Coal_Ore_Expert: type: PRODUCTION name: Smelt Coal Ore - production_time: 5s + production_time: 50s input: coal ore: material: COAL_ORE @@ -2889,7 +2889,7 @@ recipes: output: coal: material: COAL - amount: + amount: 640 Smelt_Dark_Prismarine: type: PRODUCTION name: Smelt Dark Prismarine From a8246891d0546521ee163ed7e94650fb0a52e1ca Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 7 Mar 2016 02:24:09 +0100 Subject: [PATCH 256/459] Fix fuel time per recipe and add fuel info to recipe gui --- pom.xml | 2 +- src/com/github/igotyou/FactoryMod/ConfigParser.java | 2 +- src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 996893ec..d748f22c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.6 + 2.0.7 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 1d70f84a..fe73fdfd 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -482,7 +482,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { result = null; } if (result != null) { - ((InputRecipe)result).setFuelConsumptionIntervall(config.getInt("fuel_consumption_intervall", -1)); + ((InputRecipe)result).setFuelConsumptionIntervall((int)parseTime(config.getString("fuel_consumption_intervall", "-1"))); plugin.info("Parsed recipe " + name); } return result; diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 6e790992..9de59481 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -508,6 +508,13 @@ public void clicked(Player arg0) { } } } + int fuelInterval = rec.getFuelConsumptionIntervall() != -1? rec.getFuelConsumptionIntervall() : egg.getFuelConsumptionIntervall(); + int fuelConsumed = rec.getProductionTime()/fuelInterval; + ItemStack fuels = egg.getFuel().clone(); + fuels.setAmount(fuelConsumed); + ItemStack fuelStack = new ItemMap(fuels).getLoredItemCountRepresentation().get(0); + ISUtils.addLore(fuelStack, ChatColor.LIGHT_PURPLE + "Total duration of " + rec.getProductionTime() * 20 + " seconds"); + ci.setSlot(new DecorationStack(new ItemMap(fuels).getLoredItemCountRepresentation().get(0)), 30); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } From 7d96e500e59a1a4a2d25c7ac7136c9e4fa7cbc5e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 7 Mar 2016 02:29:21 +0100 Subject: [PATCH 257/459] Reminder: Never accept PRs made in the browser edit mode --- .../FactoryMod/repairManager/PercentageHealthRepairManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 616de6a4..4c7dfe18 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -92,7 +92,7 @@ public static void returnStuff(Factory factory) { ItemMap im = new ItemMap(); im.addItemAmount(items.getKey(), returnAmount); for (ItemStack is : im.getItemStackRepresentation()) { - if(is.getDurability() == -1) is.setDurability(0); + if(is.getDurability() == -1) is.setDurability((short)0); factory.getMultiBlockStructure() .getCenter() .getWorld() From 352d5d18b68a4818709fc197b252e7fd51f1384b Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 7 Mar 2016 02:33:58 +0100 Subject: [PATCH 258/459] I'm retarded --- src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 9de59481..cb967148 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -514,7 +514,7 @@ public void clicked(Player arg0) { fuels.setAmount(fuelConsumed); ItemStack fuelStack = new ItemMap(fuels).getLoredItemCountRepresentation().get(0); ISUtils.addLore(fuelStack, ChatColor.LIGHT_PURPLE + "Total duration of " + rec.getProductionTime() * 20 + " seconds"); - ci.setSlot(new DecorationStack(new ItemMap(fuels).getLoredItemCountRepresentation().get(0)), 30); + ci.setSlot(new DecorationStack(fuelStack), 30); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } From 99597478a1eafc2eac738b78c1ee99f090f514e6 Mon Sep 17 00:00:00 2001 From: Will Thomas Date: Thu, 10 Mar 2016 16:44:48 -0500 Subject: [PATCH 259/459] 1.2:1 as requested, 5s ore -> 6s diamonds --- configCivcraft.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c42b52e4..bc0d65ba 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2050,15 +2050,15 @@ recipes: Extract_Diamonds: type: PRODUCTION name: Extract Diamonds - production_time: 5s + production_time: 25s input: diamond ore: material: DIAMOND_ORE - amount: 16 + amount: 320 output: diamond: material: DIAMOND - amount: 32 + amount: 384 Extract_Emeralds: type: PRODUCTION name: Extract Emeralds From b5918a36446f79871a1779f1a7c3939bc794a347 Mon Sep 17 00:00:00 2001 From: Will Thomas Date: Thu, 10 Mar 2016 16:53:27 -0500 Subject: [PATCH 260/459] 20->24, then... @5s 'cause :shrug: w/e --- configCivcraft.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index bc0d65ba..260c6375 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2050,15 +2050,15 @@ recipes: Extract_Diamonds: type: PRODUCTION name: Extract Diamonds - production_time: 25s + production_time: 5s input: diamond ore: material: DIAMOND_ORE - amount: 320 + amount: 20 output: diamond: material: DIAMOND - amount: 384 + amount: 24 Extract_Emeralds: type: PRODUCTION name: Extract Emeralds From 04d2f226b8f8058fb10524ac22e6bbeadb9cc1e4 Mon Sep 17 00:00:00 2001 From: Will Thomas Date: Thu, 10 Mar 2016 17:57:04 -0500 Subject: [PATCH 261/459] Are factory names case sensitive by chance? The other factories around it matched case, but Gem Extractor was, in the upgrade, "Gem extractor." Only difference I've noticed so far that might be causing them not to be enabled. --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 260c6375..e6147dc0 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3532,7 +3532,7 @@ recipes: Upgrade_to_Gem_extractor: production_time: 7200s type: UPGRADE - name: Upgrade to Gem extractor + name: Upgrade to Gem Extractor fuel_consumption_intervall: 60s input: diamond: @@ -3544,7 +3544,7 @@ recipes: iron ingot: material: IRON_INGOT amount: 128 - factory: Gem extractor + factory: Gem Extractor Upgrade_to_Glass_Dying_Factory: production_time: 3600s type: UPGRADE From 69b71af8a1585f935fada7fd6bf0d073f8ac0f20 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sun, 13 Mar 2016 14:36:26 -0400 Subject: [PATCH 262/459] Correcting Sand Smelter factory name --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index e6147dc0..a18dc73e 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3808,7 +3808,7 @@ recipes: Upgrade_to_Advanced_Sand_Smelter: production_time: 1800s type: UPGRADE - name: Upgrade to Sand Smelter + name: Upgrade to Advanced Sand Smelter fuel_consumption_intervall: 15s input: sand: From e2d4a8c98e88c32ac84632852f1e8c7fb5e97472 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 14 Mar 2016 22:14:22 +0100 Subject: [PATCH 263/459] Further work down config, ore stuff done --- configCivcraft.yml | 172 +++++++++++++++++++++++++++------------------ 1 file changed, 105 insertions(+), 67 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a18dc73e..c502f2a8 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -11,6 +11,8 @@ decay_intervall: 1h decay_amount: 21 use_recipe_yamlidentifiers: true factories: + + #Base factory from which all others upgrade basiccontraption: type: FCC name: Basic Contraption @@ -36,7 +38,10 @@ factories: - Upgrade_to_Blacksmith - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor + + #Smelting stonesmelter: + #Basic Contraption --> Stone Smelter type: FCCUPGRADE name: Stone Smelter recipes: @@ -48,7 +53,10 @@ factories: - Upgrade_to_Sand_Smelter - Upgrade_to_Brick_Smelter - Upgrade_to_Kiln + + #Ore smelting oresmelter: + #Basic Contraption --> Stone Smelter --> Ore Smelter type: FCCUPGRADE name: Ore Smelter recipes: @@ -58,8 +66,9 @@ factories: - Extract_Quartz_Basic - Repair_Factory - Upgrade_to_Ore_Forge - - Upgrade_to_Gem_extractor + - Upgrade_to_Gem_Extractor oresmelter2: + #Basic Contraption --> Stone Smelter --> Ore Smelter --> Ore Forge type: FCCUPGRADE name: Ore Forge recipes: @@ -68,6 +77,7 @@ factories: - Smelt_Gold_Ore - Repair_Advanced_Factory gemextractor: + #Basic Contraption --> Stone Smelter --> Ore Smelter --> Gem Extractor type: FCCUPGRADE name: Gem Extractor recipes: @@ -77,7 +87,10 @@ factories: - Extract_Redstone_Advanced - Extract_Lapis - Repair_Advanced_Factory + + #Sand smelting sandsmelter: + #Basic Contraption --> Stone Smelter --> Sand Smelter type: FCCUPGRADE name: Sand Smelter recipes: @@ -87,23 +100,26 @@ factories: - Smelt_Red_Sandstone_Basic - Convert_Normal_Sand_to_Red_Sand - Repair_Small_Factory - - Upgrade_to_Advanced_Sand_Smelter + - Upgrade_to_Glass_Blowing_Workshop - Upgrade_to_Sandstone_Smelter - Upgrade_to_Glass_Dying_Factory glassdying: + #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Dying Factory type: FCCUPGRADE name: Glass Dying Factory recipes: - Repair_Factory advancedsandsmelter: + #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Blowing Workshop type: FCCUPGRADE - name: Advanced Sand Smelter + name: Glass Blowing Workshop recipes: - Smelt_Glass_Expert - Smelt_Glass_Panes_Advanced - - Smelt_Glassbottles + - Blow_Glassbottles - Repair_Factory sandstonesmelter: + #Basic Contraption --> Stone Smelter --> Sand Smelter --> Sandstone Smelter type: FCCUPGRADE name: Sandstone Smelter recipes: @@ -118,7 +134,10 @@ factories: - Smelt_Smooth_Sandstone - Smelt_Smooth_Red_Sandstone - Repair_Factory + + #Brick smelting bricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter type: FCCUPGRADE name: Brick Smelter recipes: @@ -132,8 +151,9 @@ factories: - Upgrade_to_Aquatic_Brick_Smelter - Upgrade_to_Quartz_Factory advancedstonesmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Fancy Stone Smelter type: FCCUPGRADE - name: Advanced Stone Smelter + name: Fancy Stone Smelter recipes: - Smelt_Stone_Expert - Craft_Polished_Andesite @@ -141,6 +161,7 @@ factories: - Craft_Polished_Granite - Repair_Factory stonebricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Stonebrick Smelter type: FCCUPGRADE name: Stonebrick Smelter recipes: @@ -152,6 +173,7 @@ factories: - Craft_Mossy_Stonebrick - Repair_Factory netherbricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Netherbrick Smelter type: FCCUPGRADE name: Netherbrick Smelter recipes: @@ -161,6 +183,7 @@ factories: - Craft_Netherbrick_Stairs - Repair_Factory aquaticstonesmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Aquatic Brick Smelter type: FCCUPGRADE name: Aquatic Brick Smelter recipes: @@ -170,6 +193,7 @@ factories: - Craft_Sea_Lanterns - Repair_Factory quartzfactory: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Quartz Factory type: FCCUPGRADE name: Quartz Factory recipes: @@ -179,7 +203,10 @@ factories: - Craft_Pillar_Quartz_Blocks - Craft_Quartz_Stairs - Repair_Factory + + #Clay Smelting kiln: + #Basic Contraption --> Stone Smelter --> Kiln type: FCCUPGRADE name: Kiln recipes: @@ -188,6 +215,7 @@ factories: - Repair_Small_Factory - Upgrade_to_Advanced_Kiln advancedkiln: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Kiln --> Advanced Kiln type: FCCUPGRADE name: Advanced Kiln recipes: @@ -195,6 +223,8 @@ factories: - Harden_Clay_Advanced - Craft_Flowerpots - Repair_Factory + + #Wood processing woodprocessor: type: FCCUPGRADE name: Wood Processor @@ -1935,7 +1965,7 @@ recipes: planks: material: WOOD amount: 600 - durabiliy: -2 + durability: -2 Cut_any_type_of_Plank_Basic: type: WOODMAPPING name: Cut Planks @@ -2050,7 +2080,7 @@ recipes: Extract_Diamonds: type: PRODUCTION name: Extract Diamonds - production_time: 5s + production_time: 10s input: diamond ore: material: DIAMOND_ORE @@ -2074,7 +2104,7 @@ recipes: Extract_Lapis: type: PRODUCTION name: Extract Lapis - production_time: 5s + production_time: 8s input: lapis ore: material: LAPIS_ORE @@ -2083,11 +2113,11 @@ recipes: lapis: material: INK_SACK durability: 4 - amount: 128 + amount: 64 Extract_Quartz_Advanced: type: PRODUCTION name: Extract Quartz - production_time: 5s + production_time: 8s input: quartz ore: material: QUARTZ_ORE @@ -2099,7 +2129,7 @@ recipes: Extract_Quartz_Basic: type: PRODUCTION name: Extract Quartz - production_time: 5s + production_time: 10s input: quartz ore: material: QUARTZ_ORE @@ -2111,7 +2141,7 @@ recipes: Extract_Redstone_Advanced: type: PRODUCTION name: Extract Redstone - production_time: 5s + production_time: 15s input: redstone ore: material: REDSTONE_ORE @@ -2119,11 +2149,11 @@ recipes: output: redstone dust: material: REDSTONE - amount: 256 + amount: 192 Extract_Redstone_Basic: type: PRODUCTION name: Extract Redstone - production_time: 5s + production_time: 20s input: redstone ore: material: REDSTONE_ORE @@ -2854,30 +2884,30 @@ recipes: bricks: material: BRICK amount: 64 - Smelt_Coal_Ore_Advanced: + Smelt_Coal_Ore_Basic: type: PRODUCTION - name: Smelt Coal Ore Advanced - production_time: 30s + name: Smelt Coal Ore + production_time: 16s input: coal ore: material: COAL_ORE - amount: 128 + amount: 64 output: coal: material: COAL - amount: 256 - Smelt_Coal_Ore_Basic: + amount: 80 + Smelt_Coal_Ore_Advanced: type: PRODUCTION - name: Smelt Coal Ore - production_time: 16s + name: Smelt Coal Ore Advanced + production_time: 30s input: coal ore: material: COAL_ORE - amount: 64 + amount: 128 output: coal: material: COAL - amount: 80 + amount: 256 Smelt_Coal_Ore_Expert: type: PRODUCTION name: Smelt Coal Ore @@ -2909,7 +2939,7 @@ recipes: Smelt_Glass_Advanced: type: PRODUCTION name: Smelt Glass - production_time: 5s + production_time: 25s input: sand: material: SAND @@ -2921,7 +2951,7 @@ recipes: Smelt_Glass_Basic: type: PRODUCTION name: Smelt Glass - production_time: 5s + production_time: 32s input: sand: material: SAND @@ -2933,7 +2963,7 @@ recipes: Smelt_Glass_Expert: type: PRODUCTION name: Smelt Glass - production_time: 5s + production_time: 20s input: sand: material: SAND @@ -2981,7 +3011,7 @@ recipes: Smelt_Gold_Ore: type: PRODUCTION name: Smelt Gold Ore - production_time: 5s + production_time: 10s input: gold ore: material: GOLD_ORE @@ -2989,11 +3019,11 @@ recipes: output: gold ingot: material: GOLD_INGOT - amount: 64 + amount: 32 Smelt_Iron_Ore_Advanced: type: PRODUCTION name: Smelt Iron Ore - production_time: 5s + production_time: 15s input: iron ore: material: IRON_ORE @@ -3001,11 +3031,11 @@ recipes: output: iron ingot: material: IRON_INGOT - amount: 192 + amount: 110 Smelt_Iron_Ore_Basic: type: PRODUCTION name: Smelt Iron Ore - production_time: 5s + production_time: 20s input: iron ore: material: IRON_ORE @@ -3013,7 +3043,7 @@ recipes: output: iron ingot: material: IRON_INGOT - amount: 128 + amount: 80 Smelt_Netherbrick_Advanced: type: PRODUCTION name: Smelt Netherbrick Advanced @@ -3360,9 +3390,16 @@ recipes: name: Upgrade to Blacksmith fuel_consumption_intervall: 20s input: - iron ingot: + stone: + material: COBBLESTONE + amount: 512 + iron: material: IRON_INGOT - amount: 256 + amount: 24 + wood: + material: WOOD + durability: -1 + amount: 512 factory: Blacksmith Upgrade_to_Brick_Smelter: production_time: 900s @@ -3529,21 +3566,22 @@ recipes: material: DIRT amount: 512 factory: Flower Gardening - Upgrade_to_Gem_extractor: - production_time: 7200s + Upgrade_to_Gem_Extractor: + production_time: 4h type: UPGRADE name: Upgrade to Gem Extractor - fuel_consumption_intervall: 60s + fuel_consumption_intervall: 2m input: diamond: material: DIAMOND - amount: 64 - gold ingot: - material: GOLD_INGOT - amount: 32 - iron ingot: - material: IRON_INGOT amount: 128 + quartz: + material: QUARTZ + amount: 512 + lapis: + material: INK_SACK + durability: 4 + amount: 256 factory: Gem Extractor Upgrade_to_Glass_Dying_Factory: production_time: 3600s @@ -3697,31 +3735,31 @@ recipes: name: Upgrade to Ore Smelter fuel_consumption_intervall: 8s input: - diamond: - material: DIAMOND - amount: 32 iron ingot: material: IRON_INGOT - amount: 64 - gold ingot: - material: GOLD_INGOT - amount: 16 + amount: 512 + coal: + material: COAL + amount: 1024 + redstone: + material: REDSTONE + amount: 256 factory: Ore Smelter Upgrade_to_Ore_Forge: - production_time: 1800s + production_time: 4h type: UPGRADE name: Upgrade to Ore Forge - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 2m input: - diamond: - material: DIAMOND - amount: 64 iron ingot: - material: IRON_INGOT - amount: 128 + material: IRON_BLOCK + amount: 256 gold ingot: - material: GOLD_INGOT - amount: 32 + material: GOLD_BLOCK + amount: 128 + coal: + material: COAL_BLOCK + amount: 384 factory: Ore Forge Upgrade_to_Organic_Block_Factory: production_time: 1800s @@ -3796,27 +3834,27 @@ recipes: amount: 64 factory: Redstone Mechanics Factory Upgrade_to_Sand_Smelter: - production_time: 900s + production_time: 20m type: UPGRADE name: Upgrade to Sand Smelter - fuel_consumption_intervall: 8s + fuel_consumption_intervall: 30s input: sand: material: SAND amount: 512 factory: Sand Smelter - Upgrade_to_Advanced_Sand_Smelter: - production_time: 1800s + Upgrade_to_Glass_Blowing_Workshop: + production_time: 2h type: UPGRADE - name: Upgrade to Advanced Sand Smelter + name: Upgrade to Glass Blowing Workshop fuel_consumption_intervall: 15s input: sand: material: SAND amount: 1024 - factory: Advanced Sand Smelter + factory: Glass Blowing Workshop Upgrade_to_Sandstone_Smelter: - production_time: 1800s + production_time: 2h type: UPGRADE name: Upgrade to Sandstone Smelter fuel_consumption_intervall: 15s From 248590ed2ca7b1e23d99597992cb86727bcd271a Mon Sep 17 00:00:00 2001 From: Vastitas Date: Tue, 15 Mar 2016 14:07:43 +0000 Subject: [PATCH 264/459] fix diamond shovel recipe --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c502f2a8..b4684917 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2268,7 +2268,7 @@ recipes: amount: 6 output: diamond pickaxe: - material: DIAMOND_PICKAXE + material: DIAMOND_SHOVEL amount: 8 Forge_Diamond_Sword: type: PRODUCTION From b5ad6e4545f1daecf22d03495cae75bb3ccdff9a Mon Sep 17 00:00:00 2001 From: Vastitas Date: Tue, 15 Mar 2016 14:43:40 +0000 Subject: [PATCH 265/459] Fix shovel recipes --- configCivcraft.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index b4684917..05319312 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2267,7 +2267,7 @@ recipes: material: DIAMOND amount: 6 output: - diamond pickaxe: + diamond shovel: material: DIAMOND_SHOVEL amount: 8 Forge_Diamond_Sword: @@ -2387,8 +2387,8 @@ recipes: material: GOLD_INGOT amount: 6 output: - gold pickaxe: - material: GOLD_PICKAXE + gold shovel: + material: GOLD_SHOVEL amount: 8 Forge_Gold_Sword: type: PRODUCTION @@ -2507,8 +2507,8 @@ recipes: material: IRON_INGOT amount: 6 output: - iron pickaxe: - material: IRON_PICKAXE + iron shovel: + material: IRON_SHOVEL amount: 8 Forge_Iron_Sword: type: PRODUCTION @@ -2567,8 +2567,8 @@ recipes: material: STONE amount: 6 output: - stone pickaxe: - material: STONE_PICKAXE + stone shovel: + material: STONE_SHOVEL amount: 8 Forge_Stone_Sword: type: PRODUCTION From e58fbedcf99b29a201b81f031bc5ad8c89a0edf7 Mon Sep 17 00:00:00 2001 From: Vastitas Date: Tue, 15 Mar 2016 15:22:16 +0000 Subject: [PATCH 266/459] Fix double steak recipe & added pork recipe --- configCivcraft.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 05319312..1b8de962 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -292,7 +292,7 @@ factories: name: Grill recipes: - Grill_Steak_Advanced - - Grill_Beef + - Grill_Pork - Fry_Chicken - Cook_Salmon - Cook_Fish @@ -2594,17 +2594,17 @@ recipes: cooked chicken: material: COOKED_CHICKEN amount: 64 - Grill_Beef: + Grill_Pork: type: PRODUCTION - name: Grill Beef + name: Grill Pork production_time: 5s input: - beef: - material: RAW_BEEF + pork: + material: RAW_PORK amount: 32 output: - cooked beef: - material: COOKED_BEEF + grilled pork: + material: GRILLED_PORK amount: 64 Grill_Steak_Advanced: type: PRODUCTION From eb429acba4ae486a9858488fc7adbbad4f7b477a Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 15 Mar 2016 21:00:08 +0100 Subject: [PATCH 267/459] SPADE NOT SHOVEL; DOES ANYONE EVEN USE THE ITEM TABLES OR READ MY DOCU?? --- configCivcraft.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 1b8de962..8c4f0e6d 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2268,7 +2268,7 @@ recipes: amount: 6 output: diamond shovel: - material: DIAMOND_SHOVEL + material: DIAMOND_SPADE amount: 8 Forge_Diamond_Sword: type: PRODUCTION @@ -2388,7 +2388,7 @@ recipes: amount: 6 output: gold shovel: - material: GOLD_SHOVEL + material: GOLD_SPADE amount: 8 Forge_Gold_Sword: type: PRODUCTION @@ -2508,7 +2508,7 @@ recipes: amount: 6 output: iron shovel: - material: IRON_SHOVEL + material: IRON_SPADE amount: 8 Forge_Iron_Sword: type: PRODUCTION @@ -2568,7 +2568,7 @@ recipes: amount: 6 output: stone shovel: - material: STONE_SHOVEL + material: STONE_SPADE amount: 8 Forge_Stone_Sword: type: PRODUCTION From a9ed1a3b732096ac58f78fd360a3cc948a47a38c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 15 Mar 2016 21:04:49 +0100 Subject: [PATCH 268/459] Note to self: Keep Diet away from configs --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 8c4f0e6d..fdf101ec 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2600,7 +2600,7 @@ recipes: production_time: 5s input: pork: - material: RAW_PORK + material: PORK amount: 32 output: grilled pork: From 25a07e749a829116452528f928a2fbe955ad3b51 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Mar 2016 23:03:02 +0100 Subject: [PATCH 269/459] Dynamically scale size of recipe ui window --- .../igotyou/FactoryMod/utility/MenuBuilder.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index cb967148..56f79336 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -174,12 +174,17 @@ public void clicked(Player arg0) { private void openRecipeBrowser(Player p, String facName) { ClickableInventory.forceCloseInventory(p); - ClickableInventory recipeInventory = new ClickableInventory(36, - "Recipes for " + facName); // Bukkit has 32 char limit on - // inventory FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); List recipes = egg.getRecipes(); - + int size = (recipes.size() / 9) + 2; + if ((recipes.size() % 9) == 0) { + size--; + } + size *= 9; + + ClickableInventory recipeInventory = new ClickableInventory(size, + "Recipes for " + facName); // Bukkit has 32 char limit on + // inventory // put recipes int j = 0; for (int i = 0; i < recipes.size(); i++) { @@ -207,7 +212,7 @@ public void clicked(Player arg0) { openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); } }; - recipeInventory.setSlot(backClickable, 31); + recipeInventory.setSlot(backClickable, size - 5); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), recipeInventory, p); } From 5dae6e3f756334a7574b0dc522aec5565ef55c4d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Mar 2016 23:16:41 +0100 Subject: [PATCH 270/459] Fix recipe duration in ui and use complete stack for fuel representation if it fits in one slot --- .../github/igotyou/FactoryMod/utility/MenuBuilder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 56f79336..a33c6684 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -517,8 +517,14 @@ public void clicked(Player arg0) { int fuelConsumed = rec.getProductionTime()/fuelInterval; ItemStack fuels = egg.getFuel().clone(); fuels.setAmount(fuelConsumed); - ItemStack fuelStack = new ItemMap(fuels).getLoredItemCountRepresentation().get(0); - ISUtils.addLore(fuelStack, ChatColor.LIGHT_PURPLE + "Total duration of " + rec.getProductionTime() * 20 + " seconds"); + ItemStack fuelStack; + if (fuelConsumed > fuels.getType().getMaxStackSize()) { + fuelStack = new ItemMap(fuels).getLoredItemCountRepresentation().get(0); + } + else { + fuelStack = fuels; + } + ISUtils.addLore(fuelStack, ChatColor.LIGHT_PURPLE + "Total duration of " + rec.getProductionTime() / 20 + " seconds"); ci.setSlot(new DecorationStack(fuelStack), 30); ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); } From bbea6d5d188d0f4ca23a49db938acf1f1747032f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 16 Mar 2016 23:54:47 +0100 Subject: [PATCH 271/459] Dying and sand config stuff --- configCivcraft.yml | 799 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 737 insertions(+), 62 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index fdf101ec..12646d88 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -108,6 +108,38 @@ factories: type: FCCUPGRADE name: Glass Dying Factory recipes: + - Dye_Glass_White + - Dye_Glass_Orange + - Dye_Glass_Magenta + - Dye_Glass_Light_Blue + - Dye_Glass_Yellow + - Dye_Glass_Lime + - Dye_Glass_Pink + - Dye_Glass_Gray + - Dye_Glass_Light_Gray + - Dye_Glass_Cyan + - Dye_Glass_Purple + - Dye_Glass_Blue + - Dye_Glass_Brown + - Dye_Glass_Green + - Dye_Glass_Red + - Dye_Glass_Black + - Dye_GlassPanes_White + - Dye_GlassPanes_Orange + - Dye_GlassPanes_Magenta + - Dye_GlassPanes_Light_Blue + - Dye_GlassPanes_Yellow + - Dye_GlassPanes_Lime + - Dye_GlassPanes_Pink + - Dye_GlassPanes_Gray + - Dye_GlassPanes_Light_Gray + - Dye_GlassPanes_Cyan + - Dye_GlassPanes_Purple + - Dye_GlassPanes_Blue + - Dye_GlassPanes_Brown + - Dye_GlassPanes_Green + - Dye_GlassPanes_Red + - Dye_GlassPanes_Black - Repair_Factory advancedsandsmelter: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Blowing Workshop @@ -150,6 +182,7 @@ factories: - Upgrade_to_Netherbrick_Smelter - Upgrade_to_Aquatic_Brick_Smelter - Upgrade_to_Quartz_Factory + - Upgrade_to_Fancy_Stone_Smelter advancedstonesmelter: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Fancy Stone Smelter type: FCCUPGRADE @@ -857,8 +890,8 @@ recipes: excluded_materials: -BOOK Convert_Normal_Sand_to_Red_Sand: type: PRODUCTION - name: Convert Normal Sand to Red Sand - production_time: 5s + name: Extract Red Sand + production_time: 16s input: sand: material: SAND @@ -867,7 +900,7 @@ recipes: red sand: material: SAND durability: 1 - amount: 64 + amount: 32 Cook_Fish: type: PRODUCTION name: Cook Fish @@ -1386,7 +1419,7 @@ recipes: Craft_Polished_Andesite: type: PRODUCTION name: Craft Polished Andesite - production_time: 5s + production_time: 10s input: andesite: material: STONE @@ -1396,11 +1429,11 @@ recipes: polished andesite: material: STONE durability: 6 - amount: 64 + amount: 32 Craft_Polished_Diorite: type: PRODUCTION name: Craft Polished Diorite - production_time: 5s + production_time: 10s input: andesite: material: STONE @@ -1410,11 +1443,11 @@ recipes: polished andesite: material: STONE durability: 4 - amount: 64 + amount: 32 Craft_Polished_Granite: type: PRODUCTION name: Craft Polished Granite - production_time: 5s + production_time: 10s input: andesite: material: STONE @@ -1424,7 +1457,7 @@ recipes: polished andesite: material: STONE durability: 2 - amount: 64 + amount: 32 Craft_Prismarine_Basic: type: PRODUCTION name: Craft Prismarine @@ -2846,32 +2879,6 @@ recipes: bricks: material: BRICK amount: 64 - Smelt_Chiselled_Red_Sandstone: - type: PRODUCTION - name: Smelt Chiselled Red Sandstone - production_time: 5s - input: - red sandstone: - material: RED_SANDSTONE - amount: 48 - output: - chiseled red sandstone: - material: RED_SANDSTONE - durability: 1 - amount: 64 - Smelt_Chiselled_Sandstone: - type: PRODUCTION - name: Smelt Chiselled Sandstone - production_time: 5s - input: - sandstone: - material: SANDSTONE - amount: 48 - output: - chiseled sandstone: - material: SANDSTONE - durability: 1 - amount: 64 Smelt_Clay_Bricks: type: PRODUCTION name: Smelt Clay Bricks @@ -2975,15 +2982,15 @@ recipes: Smelt_Glass_Panes_Advanced: type: PRODUCTION name: Smelt Glass Panes - production_time: 5s + production_time: 8s input: sand: material: SAND - amount: 16 + amount: 32 output: glass pane: material: THIN_GLASS - amount: 96 + amount: 192 Smelt_Glass_Panes_Basic: type: PRODUCTION name: Smelt Glass Panes @@ -2996,10 +3003,10 @@ recipes: glass pane: material: THIN_GLASS amount: 64 - Smelt_Glassbottles: + Blow_Glassbottles: type: PRODUCTION - name: Smelt Glassbottles - production_time: 5s + name: Blow Glassbottles + production_time: 10s input: sand: material: SAND @@ -3084,20 +3091,20 @@ recipes: Smelt_Red_Sandstone_Advanced: type: PRODUCTION name: Smelt Red Sandstone - production_time: 5s + production_time: 20s input: red sand: material: SAND durability: 1 - amount: 64 + amount: 128 output: red sandstone: material: RED_SANDSTONE - amount: 48 + amount: 96 Smelt_Red_Sandstone_Basic: type: PRODUCTION name: Smelt Red Sandstone - production_time: 5s + production_time: 12s input: red sand: material: SAND @@ -3110,7 +3117,7 @@ recipes: Smelt_Red_Sandstone_Slabs: type: PRODUCTION name: Smelt Red Sandstone Slabs - production_time: 5s + production_time: 12s input: red sand: material: RED_SANDSTONE @@ -3118,11 +3125,11 @@ recipes: output: red sandstone: material: STONE_SLAB2 - amount: 64 + amount: 192 Smelt_Red_Sandstone_Stairs: type: PRODUCTION name: Smelt Red Sandstone Stairs - production_time: 5s + production_time: 12s input: red sand: material: RED_SANDSTONE @@ -3130,23 +3137,23 @@ recipes: output: red sandstone: material: RED_SANDSTONE_STAIRS - amount: 48 + amount: 64 Smelt_Sandstone_Advanced: type: PRODUCTION name: Smelt Sandstone - production_time: 5s + production_time: 20s input: red sand: material: SAND - amount: 64 + amount: 128 output: red sandstone: material: SANDSTONE - amount: 32 + amount: 96 Smelt_Sandstone_Basic: type: PRODUCTION name: Smelt Sandstone - production_time: 5s + production_time: 12s input: red sand: material: SAND @@ -3158,7 +3165,7 @@ recipes: Smelt_Sandstone_Slabs: type: PRODUCTION name: Smelt Sandstone Slabs - production_time: 5s + production_time: 12s input: sandstone: material: SANDSTONE @@ -3167,11 +3174,11 @@ recipes: sandstone slab: material: STEP durability: 1 - amount: 64 + amount: 192 Smelt_Sandstone_Stairs: type: PRODUCTION name: Smelt Sandstone Stairs - production_time: 5s + production_time: 12s input: sandstone: material: SANDSTONE @@ -3179,11 +3186,11 @@ recipes: output: sandstone stairs: material: SANDSTONE_STAIRS - amount: 48 + amount: 64 Smelt_Smooth_Red_Sandstone: type: PRODUCTION name: Smelt Smooth Red Sandstone - production_time: 5s + production_time: 16s input: red sandstone: material: RED_SANDSTONE @@ -3196,7 +3203,7 @@ recipes: Smelt_Smooth_Sandstone: type: PRODUCTION name: Smelt Smooth Sandstone - production_time: 5s + production_time: 16s input: sandstone: material: SANDSTONE @@ -3206,6 +3213,32 @@ recipes: material: SANDSTONE durability: 2 amount: 64 + Smelt_Chiselled_Red_Sandstone: + type: PRODUCTION + name: Smelt Chiselled Red Sandstone + production_time: 12s + input: + red sandstone: + material: RED_SANDSTONE + amount: 48 + output: + chiseled red sandstone: + material: RED_SANDSTONE + durability: 1 + amount: 64 + Smelt_Chiselled_Sandstone: + type: PRODUCTION + name: Smelt Chiselled Sandstone + production_time: 12s + input: + sandstone: + material: SANDSTONE + amount: 48 + output: + chiseled sandstone: + material: SANDSTONE + durability: 1 + amount: 64 Smelt_Stone_Advanced: type: PRODUCTION name: Smelt Stone @@ -3591,7 +3624,74 @@ recipes: input: glass: material: GLASS - amount: 128 + amount: 384 + panes: + material: THIN_GLASS + amount: 384 + dye0: + material: INK_SACK + amount: 64 + durability: 0 + dye1: + material: INK_SACK + amount: 64 + durability: 1 + dye2: + material: INK_SACK + amount: 64 + durability: 2 + dye3: + material: INK_SACK + amount: 64 + durability: 3 + dye4: + material: INK_SACK + amount: 64 + durability: 4 + dye5: + material: INK_SACK + amount: 64 + durability: 5 + dye6: + material: INK_SACK + amount: 64 + durability: 6 + dye7: + material: INK_SACK + amount: 64 + durability: 7 + dye8: + material: INK_SACK + amount: 64 + durability: 8 + dye9: + material: INK_SACK + amount: 64 + durability: 9 + dye10: + material: INK_SACK + amount: 64 + durability: 10 + dye11: + material: INK_SACK + amount: 64 + durability: 11 + dye12: + material: INK_SACK + amount: 64 + durability: 12 + dye13: + material: INK_SACK + amount: 64 + durability: 13 + dye14: + material: INK_SACK + amount: 64 + durability: 14 + dye15: + material: INK_SACK + amount: 64 + durability: 15 factory: Glass Dying Factory Upgrade_to_Gold_Armour_Forge: production_time: 3600s @@ -3851,7 +3951,13 @@ recipes: input: sand: material: SAND + amount: 512 + glass: + material: GLASS amount: 1024 + panes: + material: THIN_GLASS + amount: 512 factory: Glass Blowing Workshop Upgrade_to_Sandstone_Smelter: production_time: 2h @@ -3861,10 +3967,10 @@ recipes: input: sandstone: material: SANDSTONE - amount: 128 + amount: 640 red sandstone: material: RED_SANDSTONE - amount: 128 + amount: 640 factory: Sandstone Smelter Upgrade_to_Soup_kitchen: production_time: 900s @@ -3954,3 +4060,572 @@ recipes: material: WOOL amount: 256 factory: Wool Processing + Upgrade_to_Fancy_Stone_Smelter: + name: Upgrade to Fancy Stone Smelter + production_time: 20m + type: UPGRADE + fuel_consumption_intervall: 30s + factory: Fancy Stone Smelter + input: + stone: + material: STONE + amount: 1152 + otherstone: + material: STONE + durability: 1 + amount: 256 + idontevenknowwhatthisoneiscalled: + material: STONE + durability: 3 + amount: 256 + morestoneIguess: + material: STONE + durability: 5 + amount: 256 + + +#Dying recipes + Dye_Glass_White: + name: Dye Glass White + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 15 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 0 + Dye_Glass_Orange: + name: Dye Glass Orange + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 14 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 1 + Dye_Glass_Magenta: + name: Dye Glass Magenta + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 13 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 2 + Dye_Glass_Light_Blue: + name: Dye Glass Light Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 12 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 3 + Dye_Glass_Yellow: + name: Dye Glass Yellow + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 11 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 4 + Dye_Glass_Lime: + name: Dye Glass Lime + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 10 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 5 + Dye_Glass_Pink: + name: Dye Glass Pink + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 9 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 6 + Dye_Glass_Gray: + name: Dye Glass Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 8 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 7 + Dye_Glass_Light_Gray: + name: Dye Glass Light Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 7 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 8 + Dye_Glass_Cyan: + name: Dye Glass Cyan + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 6 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 9 + Dye_Glass_Purple: + name: Dye Glass Purple + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 5 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 10 + Dye_Glass_Blue: + name: Dye Glass Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 4 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 11 + Dye_Glass_Brown: + name: Dye Glass Brown + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 3 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 12 + Dye_Glass_Green: + name: Dye Glass Green + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 2 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 13 + Dye_Glass_Red: + name: Dye Glass Red + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 1 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 14 + Dye_Glass_Black: + name: Dye Glass Black + type: PRODUCTION + production_time: 10s + input: + glass: + material: GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 0 + output: + stainedglass: + material: STAINED_GLASS + amount: 64 + durability: 15 + Dye_GlassPanes_White: + name: Dye Glass Panes White + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 15 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 0 + Dye_GlassPanes_Orange: + name: Dye Glass Panes Orange + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 14 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 1 + Dye_GlassPanes_Magenta: + name: Dye Glass Panes Magenta + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 13 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 2 + Dye_GlassPanes_Light_Blue: + name: Dye Glass Panes Light Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 12 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 3 + Dye_GlassPanes_Yellow: + name: Dye Glass Panes Yellow + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 11 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 4 + Dye_GlassPanes_Lime: + name: Dye Glass Panes Lime + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 10 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 5 + Dye_GlassPanes_Pink: + name: Dye Glass Panes Pink + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 9 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 6 + Dye_GlassPanes_Gray: + name: Dye Glass Panes Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 8 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 7 + Dye_GlassPanes_Light_Gray: + name: Dye Glass Panes Light Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 7 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 8 + Dye_GlassPanes_Cyan: + name: Dye Glass Panes Cyan + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 6 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 9 + Dye_GlassPanes_Purple: + name: Dye Glass Panes Purple + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 5 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 10 + Dye_GlassPanes_Blue: + name: Dye Glass Panes Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 4 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 11 + Dye_GlassPanes_Brown: + name: Dye Glass Panes Brown + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 3 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 12 + Dye_GlassPanes_Green: + name: Dye Glass Panes Green + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 2 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 13 + Dye_GlassPanes_Red: + name: Dye Glass Panes Red + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 1 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 14 + Dye_GlassPanes_Black: + name: Dye Glass Panes Black + type: PRODUCTION + production_time: 10s + input: + glass: + material: THIN_GLASS + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 0 + output: + stainedglass: + material: STAINED_GLASS_PANE + amount: 64 + durability: 15 \ No newline at end of file From c594d25d587eab71a79a38c0796230f020a4e40d Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 17 Mar 2016 00:18:29 +0100 Subject: [PATCH 272/459] Save activator for FCC and send warn messages to dumb people --- .../factories/FurnCraftChestFactory.java | 37 +++++++++++++++++++ .../powerManager/FurnacePowerManager.java | 4 ++ .../FactoryMod/utility/FileHandler.java | 16 ++++++++ 3 files changed, 57 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 56d5dec5..7e2f19ef 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -4,7 +4,9 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; @@ -39,6 +41,7 @@ public class FurnCraftChestFactory extends Factory { protected List recipes; protected IRecipe currentRecipe; protected Map runCount; + private UUID activator; private static HashSet pylonFactories; @@ -120,9 +123,17 @@ public void attemptToActivate(Player p) { } } if (p != null) { + int consumptionIntervall = ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() : pm + .getPowerConsumptionIntervall(); + if (((FurnacePowerManager) pm).getFuelAmountAvailable() < (currentRecipe.getProductionTime() / consumptionIntervall)) { + p.sendMessage(ChatColor.RED + "You don't have enough fuel, the factory will run out of it before completing"); + } p.sendMessage(ChatColor.GREEN + "Activated " + name + " with recipe: " + currentRecipe.getRecipeName()); + activator = p.getUniqueId(); } activate(); } else { @@ -167,6 +178,7 @@ public void deactivate() { active = false; // reset the production timer currentProductionTimer = 0; + activator = null; } } @@ -197,6 +209,18 @@ public void setRunCount(IRecipe r, Integer count) { } } + /** + * @return UUID of the person who activated the factory or null if the + * factory is off or was triggered by redstone + */ + public UUID getActivator() { + return activator; + } + + public void setActivator(UUID uuid) { + this.activator = uuid; + } + /** * Called by the manager each update cycle */ @@ -235,6 +259,7 @@ public void run() { } // if there is no fuel Available turn off the factory else { + sendActivatorMessage(ChatColor.RED + name + " deactivated, because it ran out of fuel"); deactivate(); } } @@ -246,6 +271,7 @@ else if (currentProductionTimer >= currentRecipe LoggingUtils.log("Executing recipe " + currentRecipe.getRecipeName() + " for " + getLogData()); + sendActivatorMessage(ChatColor.AQUA + currentRecipe.getRecipeName() + " in " + name + " completed"); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of @@ -268,9 +294,11 @@ else if (currentProductionTimer >= currentRecipe } } } else { + sendActivatorMessage(ChatColor.RED + name + " deactivated, because it ran out of required materials"); deactivate(); } } else { + sendActivatorMessage(ChatColor.RED + name + " deactivated, because the factory was destroyed"); deactivate(); } } @@ -316,6 +344,15 @@ public void setRecipe(IRecipe pr) { public int getRunCount(IRecipe r) { return runCount.get(r); } + + private void sendActivatorMessage(String msg) { + if (activator != null) { + Player p = Bukkit.getPlayer(activator); + if (p != null) { + p.sendMessage(msg); + } + } + } /** * Sets the internal production timer diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java index 3641f922..b7d05f09 100644 --- a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java +++ b/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -63,5 +63,9 @@ public void consumePower() { FurnaceInventory fi = ((Furnace) furnace.getState()).getInventory(); fi.removeItem(fuel); } + + public int getFuelAmountAvailable() { + return new ItemMap(((Furnace) furnace.getState()).getInventory()).getAmount(fuel); + } } diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index 7b61be58..f8a59121 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -6,6 +6,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -78,6 +79,12 @@ public void save(Collection factories) { config.set(current + ".runtime", fccf.getRunningTime()); config.set(current + ".selectedRecipe", fccf .getCurrentRecipe().getRecipeName()); + if (fccf.getActivator() == null) { + config.set(current + ".activator", "null"); + } + else { + config.set(current + ".activator", fccf.getActivator().toString()); + } for(IRecipe i : ((FurnCraftChestFactory) f).getRecipes()) { config.set(current + ".runcounts." + i.getRecipeName(), fccf.getRunCount(i)); } @@ -175,6 +182,15 @@ private void loadFromFile(File f, Map eggs) { String selectedRecipe = current.getString("selectedRecipe"); FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, runtime); + String activator = current.getString("activator", "null"); + UUID acti; + if (activator.equals("null")) { + acti = null; + } + else { + acti = UUID.fromString(activator); + } + fac.setActivator(acti); ConfigurationSection runCounts = current.getConfigurationSection("runcounts"); if(runCounts != null) { for(String countKey : runCounts.getKeys(false)) { From 120312d2c34c7615d2072e869d201f0900e74f59 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 17 Mar 2016 03:08:49 +0100 Subject: [PATCH 273/459] Bastion stuff --- configCivcraft.yml | 294 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 278 insertions(+), 16 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 12646d88..1eccf08a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -75,6 +75,7 @@ factories: - Smelt_Coal_Ore_Expert - Smelt_Iron_Ore_Advanced - Smelt_Gold_Ore + - Craft_Cave_Concentrate - Repair_Advanced_Factory gemextractor: #Basic Contraption --> Stone Smelter --> Ore Smelter --> Gem Extractor @@ -140,6 +141,7 @@ factories: - Dye_GlassPanes_Green - Dye_GlassPanes_Red - Dye_GlassPanes_Black + - Concentrate_Rainbow - Repair_Factory advancedsandsmelter: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Blowing Workshop @@ -165,6 +167,7 @@ factories: - Smelt_Chiselled_Red_Sandstone - Smelt_Smooth_Sandstone - Smelt_Smooth_Red_Sandstone + - Sieve_Desert_Concentrate - Repair_Factory #Brick smelting @@ -214,6 +217,7 @@ factories: - Craft_Netherbrick_Fence - Craft_Netherbrick_Slabs - Craft_Netherbrick_Stairs + - Craft_Hell_Concentrate - Repair_Factory aquaticstonesmelter: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Aquatic Brick Smelter @@ -319,6 +323,7 @@ factories: - Bake_Cookies - Bake_Cake - Bake_Pumpkin_Pie + - Bake_Food_Concentrate - Repair_Factory grill: type: FCCUPGRADE @@ -338,6 +343,7 @@ factories: recipes: - Make_Rabbit_Stew - Make_Mushroom_Stew + - Brew_Soup_Concentrate animalhusbandryfactorybasic: type: FCCUPGRADE name: Animal Husbandry Factory Basic @@ -399,6 +405,7 @@ factories: recipes: - Mutate_any_sapling_into_any_other - Mutate_any_leaf_into_any_other + - Grow_Concentrate_Of_Nature - Repair_Factory madscientist: type: FCCUPGRADE @@ -600,6 +607,7 @@ factories: - Craft_Redstone_Torch_Advanced - Craft_Redstone_Comparator - Craft_Daylight_Sensor + - Craft_End_Concentrate - Repair_Advanced_Factory redstonemechanicsfactory: type: FCCUPGRADE @@ -1812,29 +1820,45 @@ recipes: name: Create Bastion production_time: 5s input: - admin tears: - material: GHAST_TEAR - amount: 4 + pretzel: + material: CAKE lore: - - Sadmins_are_sad - tealnerd is bae: - material: WOOL - durability: 9 - amount: 4 + - Food Concentrate + soup: + material: MUSHROOM_SOUP lore: - - Teal_makes_great_configs - glitchwood: - material: LOG - amount: 1 + - Soup Concentrate + sand: + material: SAND + lore: + - Desert Concentrate + durability: 1 + brick: + material: NETHER_BRICK_ITEM lore: - - All_hail_the_mighty_Glitchwood - - There_can_be_only_one! + - Hell Concentrate + end: + material: ENDER_PEARL + lore: + - End Concentrate + rainbow: + material: INK_SACK + durability: 4 + lore: + - Rainbow Concentrate + cave: + material: COAL_ORE + lore: + - Cave Concentrate + nature: + material: SAPLING + lore: + - Nature Concentrate + durability: 3 output: bastion: material: SPONGE amount: 16 - lore: - - A_bastion_block Create_Coarse_Dirt: type: PRODUCTION name: Create Coarse Dirt @@ -4083,6 +4107,244 @@ recipes: durability: 5 amount: 256 +#Bastion recipes + Brew_Soup_Concentrate: + name: Brew Soup Concentrate + type: PRODUCTION + production_time: 15s + input: + wood: + material: WOOD + amount: 128 + durability: -1 + mushroom1: + material: RED_MUSHROOM + amount: 256 + mushroom2: + material: BROWN_MUSHROOM + amount: 256 + bucket: + material: WATER_BUCKET + amount: 4 + output: + bucket: + material: BUCKET + amount: 4 + soup: + material: MUSHROOM_SOUP + lore: + - Soup Concentrate + Bake_Food_Concentrate: + name: Bake Food Concentrate + type: PRODUCTION + production_time: 15s + input: + sugar: + material: SUGAR + amount: 64 + egg: + material: EGG + amount: 64 + milk: + material: MILK_BUCKET + amount: 4 + wheat: + material: WHEAT + amount: 256 + output: + buckets: + material: BUCKET + amount: 4 + pretzel: + material: CAKE + lore: + - Food Concentrate + Sieve_Desert_Concentrate: + name: Sieve Desert Concentrate + type: PRODUCTION + production_time: 15s + input: + sand: + material: SAND + amount: 256 + redsand: + material: SAND + amount: 128 + durability: 1 + cactus: + material: CACTUS + amount: 32 + output: + sand: + material: SAND + lore: + - Desert Concentrate + durability: 1 + Craft_Hell_Concentrate: + name: Craft Hell Concentrate + type: PRODUCTION + production_time: 15s + input: + netherrack: + material: NETHERRACK + amount: 384 + slow: + material: SOUL_SAND + amount: 64 + quartz: + material: GLOWSTONE + amount: 16 + output: + brick: + material: NETHER_BRICK_ITEM + lore: + - Hell Concentrate + Craft_End_Concentrate: + name: Craft End Concentrate + type: PRODUCTION + production_time: 15s + input: + endstone: + material: ENDER_STONE + amount: 64 + pearls: + material: ENDER_PEARL + amount: 16 + output: + concentrate: + material: ENDER_PEARL + lore: + - End Concentrate + Concentrate_Rainbow: + name: Concentrate Rainbow + type: PRODUCTION + production_time: 15s + output: + rainbow: + material: INK_SACK + durability: 4 + lore: + - Rainbow Concentrate + input: + dye0: + material: INK_SACK + amount: 16 + durability: 0 + dye1: + material: INK_SACK + amount: 16 + durability: 1 + dye2: + material: INK_SACK + amount: 16 + durability: 2 + dye3: + material: INK_SACK + amount: 16 + durability: 3 + dye4: + material: INK_SACK + amount: 16 + durability: 4 + dye5: + material: INK_SACK + amount: 16 + durability: 5 + dye6: + material: INK_SACK + amount: 16 + durability: 6 + dye7: + material: INK_SACK + amount: 16 + durability: 7 + dye8: + material: INK_SACK + amount: 16 + durability: 8 + dye9: + material: INK_SACK + amount: 16 + durability: 9 + dye10: + material: INK_SACK + amount: 16 + durability: 10 + dye11: + material: INK_SACK + amount: 16 + durability: 11 + dye12: + material: INK_SACK + amount: 16 + durability: 12 + dye13: + material: INK_SACK + amount: 16 + durability: 13 + dye14: + material: INK_SACK + amount: 16 + durability: 14 + dye15: + material: INK_SACK + amount: 16 + durability: 15 + Craft_Cave_Concentrate: + name: Craft Cave Concentrate + type: PRODUCTION + production_time: 15s + input: + goldore: + material: GOLD_ORE + amount: 16 + lapisore: + material: LAPIS_ORE + amount: 16 + redore: + material: REDSTONE_ORE + amount: 16 + output: + concentrate: + material: COAL_ORE + lore: + - Cave Concentrate + Grow_Concentrate_Of_Nature: + name: Grow Nature Concentrate + type: PRODUCTION + production_time: 15s + input: + sapling1: + material: SAPLING + amount: 8 + durability: 0 + sapling2: + material: SAPLING + amount: 8 + durability: 1 + sapling3: + material: SAPLING + amount: 8 + durability: 2 + sapling4: + material: SAPLING + amount: 8 + durability: 3 + sapling5: + material: SAPLING + amount: 8 + durability: 4 + sapling6: + material: SAPLING + amount: 8 + durability: 5 + output: + concentrate: + material: SAPLING + lore: + - Nature Concentrate + durability: 3 + #Dying recipes Dye_Glass_White: From ca872d2986a54715c2273d67e07c9dfe39c86ebb Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 17 Mar 2016 17:07:48 +0100 Subject: [PATCH 274/459] Bastion Factory is createable --- configCivcraft.yml | 85 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 10 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 1eccf08a..d408a212 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -228,6 +228,7 @@ factories: - Smelt_Dark_Prismarine - Smelt_Prismarine_Bricks - Craft_Sea_Lanterns + - Craft_Concentrate_Of_Ocean - Repair_Factory quartzfactory: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Quartz Factory @@ -1855,6 +1856,10 @@ recipes: lore: - Nature Concentrate durability: 3 + ocean: + material: INK_SACK + lore: + - Ocean Concentrate output: bastion: material: SPONGE @@ -3412,20 +3417,59 @@ recipes: amount: 128 factory: Bakery Upgrade_to_Bastion_Factory: - production_time: 3600s + production_time: 3h type: UPGRADE name: Upgrade to Bastion Factory - fuel_consumption_intervall: 30s + fuel_consumption_intervall: 2m input: - ender pearl: + pretzel: + material: CAKE + amount: 10 + lore: + - Food Concentrate + soup: + material: MUSHROOM_SOUP + amount: 10 + lore: + - Soup Concentrate + sand: + material: SAND + amount: 10 + lore: + - Desert Concentrate + durability: 1 + brick: + material: NETHER_BRICK_ITEM + amount: 10 + lore: + - Hell Concentrate + end: material: ENDER_PEARL - amount: 256 - cobweb: - material: WEB - amount: 128 - diamond ore: - material: DIAMOND_ORE - amount: 48 + amount: 10 + lore: + - End Concentrate + rainbow: + material: INK_SACK + amount: 10 + durability: 4 + lore: + - Rainbow Concentrate + cave: + material: COAL_ORE + amount: 10 + lore: + - Cave Concentrate + nature: + material: SAPLING + amount: 10 + lore: + - Nature Concentrate + durability: 3 + ocean: + material: INK_SACK + amount: 10 + lore: + - Ocean Concentrate factory: Bastion Factory Upgrade_to_Bio_Lab: production_time: 900s @@ -4344,6 +4388,27 @@ recipes: lore: - Nature Concentrate durability: 3 + Craft_Concentrate_Of_Ocean: + name: Craft Ocean Concentrate + type: PRODUCTION + production_time: 15s + input: + prismarine: + material: PRISMARINE_CRYSTALS + amount: 32 + moreprismarine: + material: PRISMARINE_SHARD + amount: 96 + ink: + material: INK_SACK + amount: 64 + output: + ocean: + material: INK_SACK + lore: + - Ocean Concentrate + + #Dying recipes From 46bb49bc620e85698c1d725b75ca889e48d8e624 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Thu, 17 Mar 2016 20:17:30 +0100 Subject: [PATCH 275/459] Use compact ItemMap view for factory creation materials --- .../github/igotyou/FactoryMod/utility/MenuBuilder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index a33c6684..6a79a472 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -302,7 +302,14 @@ public void clicked(Player arg0) { }; ci.setSlot(cheCli, 5); int slot = 40; - for (ItemStack is : rec.getInput().getItemStackRepresentation()) { + List itms; + if (rec.getInput().getItemStackRepresentation().size() > 27) { + itms = rec.getInput().getLoredItemCountRepresentation(); + } + else { + itms = rec.getInput().getItemStackRepresentation(); + } + for (ItemStack is : itms) { DecorationStack dec = new DecorationStack(is); ci.setSlot(dec, slot); if ((slot % 9) == 4) { From 578208196e89da4ba7687c5efddf0cd7ddebc641 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 18 Mar 2016 00:48:24 +0100 Subject: [PATCH 276/459] Pylons work --- .../igotyou/FactoryMod/ConfigParser.java | 11 +++++++++ .../igotyou/FactoryMod/FactoryModManager.java | 2 ++ .../factories/FurnCraftChestFactory.java | 11 +++++++++ .../FactoryMod/recipes/PylonRecipe.java | 23 +++++++++++++++++-- .../FactoryMod/utility/MenuBuilder.java | 1 + 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index fe73fdfd..3487d344 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -28,6 +28,7 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; +import com.github.igotyou.FactoryMod.recipes.PylonRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; @@ -95,6 +96,8 @@ public FactoryModManager parse() { long gracePeriod = 50 * parseTime(config .getString("break_grace_period")); defaultMenuFactory = config.getString("default_menu_factory"); + int globalPylonLimit = config.getInt("global_pylon_limit"); + PylonRecipe.setGlobalLimit(globalPylonLimit); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, redstonePowerOn, redstoneRecipeChange, logInventories, gracePeriod); @@ -476,6 +479,14 @@ private IRecipe parseRecipe(ConfigurationSection config) { result = null; } break; + case "PYLON": + ItemMap in = parseItemMap(config + .getConfigurationSection("input")); + ItemMap out = parseItemMap(config + .getConfigurationSection("output")); + int weight = config.getInt("weight"); + result = new PylonRecipe(name, productionTime, in, out, weight); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 4a70e21f..8ea6557b 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -21,6 +21,7 @@ import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; @@ -176,6 +177,7 @@ public void removeFactory(Factory f) { f.deactivate(); } factories.remove(f); + FurnCraftChestFactory.removePylon(f); for (Location b : f.getMultiBlockStructure().getAllBlocks()) { locations.remove(b); } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 7e2f19ef..0564b532 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -371,10 +371,15 @@ public void setProductionTimer(int timer) { public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } + + public static void removePylon(Factory f) { + pylonFactories.remove(f); + } public void upgrade(String name, List recipes, ItemStack fuel, int fuelConsumptionIntervall, int updateTime) { LoggingUtils.log("Upgrading " + getLogData() + " to " + name); + pylonFactories.remove(this); deactivate(); this.name = name; this.recipes = recipes; @@ -392,5 +397,11 @@ public void upgrade(String name, List recipes, ItemStack fuel, for (IRecipe rec : recipes) { runCount.put(rec, 0); } + for (IRecipe rec : recipes) { + if (rec instanceof PylonRecipe) { + pylonFactories.add(this); + break; + } + } } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 93640ee0..1c6e9948 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -19,8 +19,8 @@ public class PylonRecipe extends InputRecipe { private ItemMap output; private static int currentGlobalWeight; + private static int globalLimit; private int weight; - private double maximumFraction; public PylonRecipe(String name, int productionTime, ItemMap input, ItemMap output, int weight) { @@ -43,6 +43,14 @@ public void applyEffect(Inventory i, Factory f) { } } } + + public static void setGlobalLimit(int limit) { + globalLimit = limit; + } + + public static int getGlobalLimit() { + return globalLimit; + } public List getOutputRepresentation(Inventory i) { ItemMap currOut = getCurrentOutput(); @@ -90,7 +98,18 @@ private boolean skyView() { } private ItemMap getCurrentOutput() { - double multiplier = Math.min(1 / currentGlobalWeight, maximumFraction); + int weight = 0; + for(FurnCraftChestFactory f : FurnCraftChestFactory.getPylonFactories()) { + for(IRecipe rec : f.getRecipes()) { + if (rec instanceof PylonRecipe) { + weight += ((PylonRecipe) rec).getWeight(); + break; + } + } + } + currentGlobalWeight = weight; + double overload = Math.max(1.0, (float) currentGlobalWeight / (float)globalLimit); + double multiplier = 1.0 / overload; ItemMap actualOutput = new ItemMap(); for (Entry entry : output.getEntrySet()) { actualOutput.addItemAmount(entry.getKey(), diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 6a79a472..d6e3a324 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -49,6 +49,7 @@ public class MenuBuilder { private IFactoryEgg defaultMenu; public MenuBuilder(String defaultFactory) { + ClickableInventory.setPlugin(FactoryMod.getPlugin()); manager = FactoryMod.getManager(); for (IFactoryEgg egg : manager.getAllEggs().values()) { if (egg instanceof FurnCraftChestEgg) { From b102d1d877a6a27eacf4d7680481e02beebaf002 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Sat, 19 Mar 2016 14:46:26 +0000 Subject: [PATCH 277/459] Make biolab upgradable grass blocks arent obtainable currently. Double checked to make sure I didnt break anything --- configCivcraft.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d408a212..1501e0b9 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3477,8 +3477,8 @@ recipes: name: Upgrade to Bio Lab fuel_consumption_intervall: 8s input: - grass: - material: GRASS + dirt: + material: DIRT amount: 256 sapling: material: SAPLING @@ -4955,4 +4955,4 @@ recipes: stainedglass: material: STAINED_GLASS_PANE amount: 64 - durability: 15 \ No newline at end of file + durability: 15 From 6cc717abec65f070c063cae7f8a6b9a044a55a47 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 01:01:26 +0100 Subject: [PATCH 278/459] Slowly working through the config --- configCivcraft.yml | 318 ++++++++++++++++++++++++++------------------- 1 file changed, 184 insertions(+), 134 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 1501e0b9..f93e5b53 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -250,15 +250,6 @@ factories: recipes: - Smelt_Clay_Bricks - Harden_Clay_Basic - - Repair_Small_Factory - - Upgrade_to_Advanced_Kiln - advancedkiln: - #Basic Contraption --> Stone Smelter --> Brick Smelter --> Kiln --> Advanced Kiln - type: FCCUPGRADE - name: Advanced Kiln - recipes: - - Smelt_Brickblocks - - Harden_Clay_Advanced - Craft_Flowerpots - Repair_Factory @@ -374,7 +365,7 @@ factories: recipes: - Create_Poppy_Advanced - Mutate_Tall_Grass_Basic - - Take_friendly_mob_egg_apart + - Take_friendly_mob_egg_apart_Basic - Create_Podzol_Basic - Repair_Small_Factory - Upgrade_to_Grass_Gardening @@ -744,24 +735,27 @@ recipes: input: wheat: material: WHEAT - amount: 192 + amount: 80 sugar: material: SUGAR - amount: 128 + amount: 48 eggs: material: EGG - amount: 64 + amount: 24 milk: material: MILK_BUCKET - amount: 10 + amount: 16 output: cake: material: CAKE - amount: 64 + amount: 32 + bucket: + material: BUCKET + amount: 16 Bake_Cookies: type: PRODUCTION name: Bake Cookies - production_time: 5s + production_time: 32s input: cocoa: material: INK_SACK @@ -773,33 +767,33 @@ recipes: output: cookie: material: COOKIE - amount: 1024 + amount: 768 Bake_Potatoes: type: PRODUCTION name: Bake Potatoes - production_time: 5s + production_time: 32s input: potato: material: POTATO_ITEM - amount: 512 + amount: 256 output: baked potato: material: BAKED_POTATO - amount: 1024 + amount: 512 Bake_Pumpkin_Pie: type: PRODUCTION name: Bake Pumpkin Pie - production_time: 5s + production_time: 32s input: pumpkin: material: PUMPKIN - amount: 64 + amount: 128 egg: material: EGG - amount: 64 + amount: 128 sugar: material: SUGAR - amount: 64 + amount: 128 output: pumpkin pie: material: PUMPKIN_PIE @@ -913,11 +907,11 @@ recipes: Cook_Fish: type: PRODUCTION name: Cook Fish - production_time: 5s + production_time: 16s input: raw fish: material: RAW_FISH - amount: 64 + amount: 32 output: cooked fish: material: COOKED_FISH @@ -925,41 +919,41 @@ recipes: Cook_Mutton: type: PRODUCTION name: Cook Mutton - production_time: 5s + production_time: 16s input: raw mutton: material: MUTTON - amount: 64 + amount: 32 output: cooked mutton: material: COOKED_MUTTON - amount: 128 + amount: 64 Cook_Rabbit: type: PRODUCTION name: Cook Rabbit - production_time: 5s + production_time: 16s input: raw rabbit: material: RABBIT - amount: 64 + amount: 32 output: cooked rabbit: material: COOKED_RABBIT - amount: 128 + amount: 64 Cook_Salmon: type: PRODUCTION name: Cook Salmon - production_time: 5s + production_time: 16s input: raw salmon: material: RAW_FISH durability: 1 - amount: 64 + amount: 32 output: cooked salmon: material: COOKED_FISH durability: 1 - amount: 128 + amount: 64 Craft_Anvils_Advanced: type: PRODUCTION name: Craft Anvils @@ -1101,10 +1095,10 @@ recipes: input: stone brick: material: SMOOTH_BRICK - amount: 16 + amount: 8 flint: material: FLINT - amount: 2 + amount: 1 output: chiseled stone brick: material: SMOOTH_BRICK @@ -1117,7 +1111,7 @@ recipes: input: stone brick: material: SMOOTH_BRICK - amount: 16 + amount: 8 gravel: material: GRAVEL amount: 2 @@ -1291,7 +1285,7 @@ recipes: amount: 16 vine: material: VINE - amount: 2 + amount: 8 output: chiseled stone brick: material: SMOOTH_BRICK @@ -1299,7 +1293,7 @@ recipes: amount: 16 Craft_Netherbrick_Basic: type: PRODUCTION - name: Craft Netherbrick + name: Smelt Netherbrick production_time: 5s input: netherrack: @@ -1308,11 +1302,11 @@ recipes: output: netherbrick: material: NETHER_BRICK - amount: 32 + amount: 24 Craft_Netherbrick_Fence: type: PRODUCTION name: Craft Netherbrick Fence - production_time: 5s + production_time: 20s input: nether brick: material: NETHER_BRICK @@ -1324,7 +1318,7 @@ recipes: Craft_Netherbrick_Slabs: type: PRODUCTION name: Craft Netherbrick Slabs - production_time: 5s + production_time: 20s input: nether brick: material: NETHER_BRICK @@ -1333,11 +1327,11 @@ recipes: nether brick slabs: material: STEP durability: 6 - amount: 128 + amount: 160 Craft_Netherbrick_Stairs: type: PRODUCTION name: Craft Netherbrick Stairs - production_time: 5s + production_time: 20s input: nether brick: material: NETHER_BRICK @@ -1470,7 +1464,7 @@ recipes: Craft_Prismarine_Basic: type: PRODUCTION name: Craft Prismarine - production_time: 5s + production_time: 15s input: prismarine shard: material: PRISMARINE_SHARD @@ -1478,7 +1472,7 @@ recipes: output: orismarine: material: PRISMARINE - amount: 32 + amount: 24 Craft_Quartz_Blocks: type: PRODUCTION name: Craft Quartz Blocks @@ -1494,7 +1488,7 @@ recipes: Craft_Quartz_Slabs: type: PRODUCTION name: Craft Quartz Slabs - production_time: 5s + production_time: 20s input: quartz block: material: QUARTZ_BLOCK @@ -1503,11 +1497,11 @@ recipes: quartz slab: material: STEP durability: 7 - amount: 128 + amount: 160 Craft_Quartz_Stairs: type: PRODUCTION name: Craft Quartz Stairs - production_time: 5s + production_time: 20s input: quartz block: material: QUARTZ_BLOCK @@ -1939,8 +1933,8 @@ recipes: amount: 8 Create_Podzol_Advanced: type: PRODUCTION - name: Create Podzol Advanced - production_time: 5s + name: Create Podzol + production_time: 32s input: dirt: material: DIRT @@ -1952,8 +1946,8 @@ recipes: amount: 128 Create_Podzol_Basic: type: PRODUCTION - name: Create Podzol Basic - production_time: 5s + name: Create Podzol + production_time: 32s input: dirt: material: DIRT @@ -1966,27 +1960,27 @@ recipes: Create_Poppy_Advanced: type: PRODUCTION name: Create Poppy Advanced - production_time: 5s + production_time: 16s input: identifiername: - material: STONE - amount: 1 + material: LEAVES + amount: 32 output: identifiername: - material: STONE - amount: 1 + material: RED_ROSE + amount: 16 Create_Poppy_Basic: type: PRODUCTION - name: Create Poppy Basic - production_time: 5s + name: Grow Poppy + production_time: 8s input: identifiername: - material: STONE - amount: 1 + material: 20 + amount: 16 output: identifiername: - material: STONE - amount: 1 + material: RED_ROSE + amount: 8 Create_Powered_Rail: type: PRODUCTION name: Create Powered Rail @@ -2647,7 +2641,7 @@ recipes: Fry_Chicken: type: PRODUCTION name: Fry Chicken - production_time: 5s + production_time: 16s input: chicken: material: RAW_CHICKEN @@ -2659,7 +2653,7 @@ recipes: Grill_Pork: type: PRODUCTION name: Grill Pork - production_time: 5s + production_time: 16s input: pork: material: PORK @@ -2671,7 +2665,7 @@ recipes: Grill_Steak_Advanced: type: PRODUCTION name: Grill Steak - production_time: 5s + production_time: 16s input: beef: material: RAW_BEEF @@ -2683,7 +2677,7 @@ recipes: Grill_Steak_Basic: type: PRODUCTION name: Grill Steak - production_time: 5s + production_time: 20s input: beef: material: RAW_BEEF @@ -2747,7 +2741,7 @@ recipes: Harden_Clay_Basic: type: PRODUCTION name: Harden Clay - production_time: 5s + production_time: 16s input: clay: material: CLAY @@ -2755,7 +2749,7 @@ recipes: output: hard clay: material: HARD_CLAY - amount: 64 + amount: 128 Kill_Dead_Bush: type: PRODUCTION name: Kill Dead Bush @@ -2783,7 +2777,7 @@ recipes: Make_Mushroom_Stew: type: PRODUCTION name: Make Mushroom Stew - production_time: 5s + production_time: 8s input: brown mushroom: material: BROWN_MUSHROOM @@ -2802,7 +2796,7 @@ recipes: Make_Rabbit_Stew: type: PRODUCTION name: Make Rabbit Stew - production_time: 5s + production_time: 8s input: rabbit: material: COOKED_RABBIT @@ -2872,7 +2866,7 @@ recipes: durability: 2 Mutate_Tall_Grass_Basic: type: PRODUCTION - name: Mutate Tall Grass Basic + name: Grow Tall Grass production_time: 5s input: fern: @@ -2896,22 +2890,10 @@ recipes: identifiername: material: STONE amount: 1 - Smelt_Brickblocks: - type: PRODUCTION - name: Smelt Brickblocks - production_time: 5s - input: - clay: - material: CLAY - amount: 48 - output: - bricks: - material: BRICK - amount: 64 Smelt_Clay_Bricks: type: PRODUCTION name: Smelt Clay Bricks - production_time: 5s + production_time: 8s input: clay: material: CLAY @@ -2919,7 +2901,7 @@ recipes: output: bricks: material: BRICK - amount: 64 + amount: 32 Smelt_Coal_Ore_Basic: type: PRODUCTION name: Smelt Coal Ore @@ -3082,8 +3064,8 @@ recipes: amount: 80 Smelt_Netherbrick_Advanced: type: PRODUCTION - name: Smelt Netherbrick Advanced - production_time: 5s + name: Smelt Netherbrick + production_time: 10s input: netherrack: material: NETHERRACK @@ -3316,7 +3298,7 @@ recipes: identifiername: material: STONE amount: 1 - Take_friendly_mob_egg_apart: + Take_friendly_mob_egg_apart_Basic: type: PRODUCTION name: Take friendly mob egg apart production_time: 5s @@ -3328,16 +3310,6 @@ recipes: identifiername: material: STONE amount: 1 - Upgrade_to_Advanced_Kiln: - production_time: 1800s - type: UPGRADE - name: Upgrade to Advanced Kiln - fuel_consumption_intervall: 15s - input: - hardened clay: - material: HARD_CLAY - amount: 640 - factory: Advanced Kiln Upgrade_to_Animal_Husbandry_Factory_Advanced: production_time: 1800s type: UPGRADE @@ -3365,27 +3337,42 @@ recipes: amount: 16 factory: Animal Husbandry Factory Basic Upgrade_to_Aquatic_Brick_Smelter: - production_time: 1800s + production_time: 1h type: UPGRADE name: Upgrade to Aquatic Brick Smelter - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 30s input: prismarine shard: material: PRISMARINE_SHARD - amount: 256 + amount: 512 prismarine crystals: material: PRISMARINE_CRYSTALS amount: 128 + ink: + material: INK_SACK + amount: 64 + waterbucket: + material: WATER_BUCKET + amount: 4 + lavabucket: + material: LAVA_BUCKET + amount: 4 factory: Aquatic Brick Smelter Upgrade_to_Quartz_Factory: - production_time: 1800s + production_time: 1h type: UPGRADE name: Upgrade to Quartz Factory - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 30s input: Quartz Block: material: QUARTZ_BLOCK amount: 256 + quartz: + material: QUARTZ + amount: 512 + pick: + material: DIAMOND_PICKAXE + amount: 8 factory: Quartz Factory Upgrade_to_Armour_Enchanter: production_time: 3600s @@ -3401,20 +3388,29 @@ recipes: amount: 64 factory: Armour Enchanter Upgrade_to_Bakery: - production_time: 900s + production_time: 2h type: UPGRADE name: Upgrade to Bakery - fuel_consumption_intervall: 8s + fuel_consumption_intervall: 1m input: bread: material: BREAD amount: 512 + cake: + material: CAKE + amount: 32 + pumpkinpie: + material: PUMPKIN_PIE + amount: 128 baked potato: material: BAKED_POTATO - amount: 256 + amount: 512 cookie: material: COOKIE - amount: 128 + amount: 512 + fire: + material: FLINT_AND_STEEL + amount: 8 factory: Bakery Upgrade_to_Bastion_Factory: production_time: 3h @@ -3472,18 +3468,31 @@ recipes: - Ocean Concentrate factory: Bastion Factory Upgrade_to_Bio_Lab: - production_time: 900s + production_time: 2h type: UPGRADE name: Upgrade to Bio Lab - fuel_consumption_intervall: 8s + fuel_consumption_intervall: 1m input: dirt: material: DIRT - amount: 256 + amount: 1024 + poppy: + material: RED_ROSE + amount: 128 + yellow_flower: + material: YELLOW_FLOWER + amount: 128 + water: + material: WATER_BUCKET + amount: 8 + bonemeal: + material: INK_SACK + durability: 15 + amount: 128 sapling: material: SAPLING durability: -1 - amount: 256 + amount: 384 factory: Bio Lab Upgrade_to_Blacksmith: production_time: 10m @@ -3629,10 +3638,10 @@ recipes: input: wheat: material: BREAD - amount: 384 + amount: 192 potato: material: BAKED_POTATO - amount: 512 + amount: 256 chicken: material: COOKED_CHICKEN amount: 96 @@ -3792,10 +3801,10 @@ recipes: amount: 32 factory: Gold Tools Forge Upgrade_to_Grass_Gardening: - production_time: 1800s + production_time: 1h type: UPGRADE name: Upgrade to Grass Gardening - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 30s input: grass: material: LONG_GRASS @@ -3804,22 +3813,41 @@ recipes: dirt: material: DIRT amount: 512 + deadbush: + material: DEAD_BUSH + amount: 128 factory: Grass Gardening Upgrade_to_Grill: - production_time: 900s + production_time: 2h type: UPGRADE name: Upgrade to Grill - fuel_consumption_intervall: 8s + fuel_consumption_intervall: 1m input: beef: - material: RAW_BEEF - amount: 128 + material: COOKED_BEEF + amount: 256 + pork: + material: GRILLED_PORK + amount: 256 mutton: - material: MUTTON + material: COOKED_MUTTON amount: 128 chicken: - material: RAW_CHICKEN + material: COOKED_CHICKEN + amount: 128 + fish: + material: COOKED_FISH + amount: 128 + salmon: + material: COOKED_FISH + amount: 64 + durability: 1 + rabbit: + material: COOKED_RABBIT amount: 128 + fire: + material: FLINT_AND_STEEL + amount: 8 factory: Grill Upgrade_to_Iron_Equipment_Forge: production_time: 900s @@ -3859,7 +3887,14 @@ recipes: input: clay: material: CLAY + amount: 1024 + char: + material: COAL + durability: 1 amount: 128 + lava: + material: LAVA_BUCKET + amount: 8 factory: Kiln Upgrade_to_Laboratory: production_time: 10m @@ -3888,14 +3923,21 @@ recipes: durability: 94 factory: Mad Scientist Upgrade_to_Netherbrick_Smelter: - production_time: 1800s + production_time: 1h type: UPGRADE name: Upgrade to Netherbrick Smelter - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 30s input: nether brick: material: NETHER_BRICK - amount: 128 + amount: 384 + netherrack: + material: NETHERRACK + amount: 1024 + lavabucket: + material: LAVA_BUCKET + amount: 16 + factory: Netherbrick Smelter Upgrade_to_Ore_Smelter: production_time: 900s @@ -4041,20 +4083,28 @@ recipes: amount: 640 factory: Sandstone Smelter Upgrade_to_Soup_kitchen: - production_time: 900s - type: UPGRADE - name: Upgrade to Soup kitchen - fuel_consumption_intervall: 8s + production_time: 2h + name: Upgrade to Soup Kitchen + fuel_consumption_intervall: 1m input: red mushroom: material: RED_MUSHROOM - amount: 64 + amount: 384 brown mushroom: material: BROWN_MUSHROOM - amount: 64 + amount: 384 rabbit: material: RABBIT - amount: 64 + amount: 128 + bowl: + material: BOWL + amount: 128 + fire: + material: FLINT_AND_STEEL + amount: 8 + water: + material: WATER_BUCKET + amount: 8 factory: Soup kitchen Upgrade_to_Stone_Smelter: production_time: 10m From 4c8fe7d1ea1beee24b14c952e6e58ec41bd47d10 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 03:36:40 +0100 Subject: [PATCH 279/459] Fixes and adding pipes and sorters --- configCivcraft.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index f93e5b53..c85cf398 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -621,6 +621,52 @@ factories: - Upgrade_to_Weapon_Enchanter - Upgrade_to_Armour_Enchanter - Repair_Advanced_Factory + normalpipe: + type: PIPE + name: Standard Pipe + setupcost: + redstone: + material: REDSTONE + amount: 128 + transfer_time_multiplier: 1s + transfer_amount: 16 + glass_color: 1 + betterpipe: + type: PIPE + name: Improved Pipe + setupcost: + redstone: + material: REDSTONE + amount: 384 + gold: + material: GOLD_INGOT + amount: 32 + transfer_time_multiplier: 10 + transfer_amount: 24 + glass_color: 2 + sortera: + type: SORTER + name: Standard Sorter + setupcost: + redstone: + material: REDSTONE + amount: 128 + sort_time: 2s + sort_amount: 32 + maximum_materials_per_side: 5 + sorterb: + type: SORTER + name: Improved Sorter + setupcost: + redstone: + material: REDSTONE + amount: 384 + gold: + material: GOLD_INGOT + amount: 32 + sort_time: 1s + sort_amount: 64 + maximum_materials_per_side: 10 recipes: Repair_Rudimentary_Factory: type: REPAIR @@ -1975,8 +2021,8 @@ recipes: production_time: 8s input: identifiername: - material: 20 - amount: 16 + material: LEAVES + amount: 20 output: identifiername: material: RED_ROSE @@ -4084,6 +4130,7 @@ recipes: factory: Sandstone Smelter Upgrade_to_Soup_kitchen: production_time: 2h + type: UPGRADE name: Upgrade to Soup Kitchen fuel_consumption_intervall: 1m input: From a11127fef566e3c147ddd636778e7e0c0104cadc Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 16:10:09 +0100 Subject: [PATCH 280/459] Many bug fixes --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 2 +- src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java | 1 + .../github/igotyou/FactoryMod/factories/Factory.java | 5 +++-- .../FactoryMod/factories/FurnCraftChestFactory.java | 1 + src/com/github/igotyou/FactoryMod/factories/Pipe.java | 11 ++++++++--- .../github/igotyou/FactoryMod/factories/Sorter.java | 2 ++ .../igotyou/FactoryMod/structures/PipeStructure.java | 8 ++++++-- .../igotyou/FactoryMod/utility/FileHandler.java | 3 +++ 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 3487d344..415aad89 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -314,7 +314,7 @@ public PipeEgg parsePipe(ConfigurationSection config) { } int transferTimeMultiplier = (int) parseTime(config .getString("transfer_time_multiplier")); - int transferAmount = config.getInt("transferamount"); + int transferAmount = config.getInt("transfer_amount"); byte color = (byte) config.getInt("glass_color"); return new PipeEgg(name, update, fuel, fuelIntervall, null, transferTimeMultiplier, transferAmount, color, returnRate); diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index 4981b903..2c93d668 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -102,6 +102,7 @@ public Factory revive(List blocks, List allowedMaterials, fuelConsumptionIntervall); Pipe pipe = new Pipe(im, rm, pm, ps, updateTime, name, transferTimeMultiplier, transferAmount); + ((PipeStructure) ps).setGlassColor(color); ((PipeInteractionManager) im).setPipe(pipe); ((NoRepairDestroyOnBreakManager)rm).setFactory(pipe); pipe.setAllowedMaterials(allowedMaterials); diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 016e6edc..801188a4 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -27,7 +27,8 @@ public abstract class Factory implements Runnable { protected MultiBlockStructure mbs; protected int updateTime; protected String name; - protected final String separator = "#"; + protected int threadId; + public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, MultiBlockStructure mbs, int updateTime, String name) { @@ -117,7 +118,7 @@ public String getName() { public abstract void attemptToActivate(Player p); public void scheduleUpdate() { - FactoryMod + threadId = FactoryMod .getPlugin() .getServer() .getScheduler() diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 0564b532..2ef93b24 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -174,6 +174,7 @@ public void activate() { public void deactivate() { LoggingUtils.log("Deactivating " + getLogData()); if (active) { + Bukkit.getScheduler().cancelTask(threadId); turnFurnaceOff(getFurnace()); active = false; // reset the production timer diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 385f9d59..61275a86 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -3,6 +3,7 @@ import java.util.LinkedList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; @@ -63,6 +64,8 @@ public void attemptToActivate(Player p) { } } else { rm.breakIt(); + p.sendMessage(ChatColor.RED + + "Failed to activate pipe, it is missing blocks"); } } @@ -79,6 +82,7 @@ public void activate() { public void deactivate() { LoggingUtils.log("Deactivating " + getLogData()); active = false; + Bukkit.getScheduler().cancelTask(threadId); turnFurnaceOff(((PipeStructure) mbs).getFurnace()); runTime = 0; } @@ -128,7 +132,7 @@ public void transfer() { int leftToRemove = transferAmount; for (ItemStack is : sourceInventory.getContents()) { if (is != null - && is.getType() != Material.AIR + && is.getType() != Material.AIR && is.getAmount() != 0 && (allowedMaterials == null || allowedMaterials .contains(is.getType()))) { int removeAmount = Math.min(leftToRemove, is.getAmount()); @@ -142,8 +146,9 @@ public void transfer() { LoggingUtils.logInventory(targetInventory, "Target inventory before transfer for " + getLogData()); - sourceInventory.removeItem(removing); - targetInventory.addItem(removing); + if (removeMap.removeSafelyFrom(sourceInventory)) { + targetInventory.addItem(removing); + } LoggingUtils.logInventory(sourceInventory, "Origin inventory after transfer for " + getLogData()); diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index f39067fd..41082d7a 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -4,6 +4,7 @@ import java.util.Map; import java.util.Map.Entry; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; @@ -82,6 +83,7 @@ public void activate() { public void deactivate() { LoggingUtils.log("Deactivating " + getLogData()); LoggingUtils.logInventory(mbs.getCenter().getBlock()); + Bukkit.getScheduler().cancelTask(threadId); turnFurnaceOff(((BlockFurnaceStructure) mbs).getFurnace()); active = false; } diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java index bf3beef7..cef89f77 100644 --- a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -53,7 +53,7 @@ public PipeStructure(Block startBlock) { boolean foundEnd = false; boolean foundPipeBlock = false; for (Block b : blocks) { - if (b.getState() instanceof InventoryHolder) { + if (b.getState() instanceof InventoryHolder && !b.getLocation().equals(start)) { end = b.getLocation(); this.length = length; complete = true; @@ -81,7 +81,7 @@ public PipeStructure(List blocks) { this.furnace = blocks.get(1); this.end = blocks.get(blocks.size() - 1); List glass = new LinkedList(); - for (int i = 3; i< blocks.size()-1;i++) { + for (int i = 2; i < blocks.size()-1;i++) { glass.add(blocks.get(i)); } this.glassPipe = glass; @@ -142,6 +142,10 @@ public boolean isComplete() { public byte getGlassColor() { return glassColor; } + + public void setGlassColor(byte data) { + this.glassColor = data; + } public int getLength() { return length; diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index f8a59121..e03ababc 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -216,6 +216,9 @@ private void loadFromFile(File f, Map eggs) { } else { mats = null; } + if (mats.size() == 0) { + mats = null; + } Factory p = pipeEgg.revive(blocks, mats, runtime); manager.addFactory(p); counter++; From 9014c6774041481053e0e8dc71291a489e3874f3 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 17:48:14 +0100 Subject: [PATCH 281/459] Fix factory name tab completing and add admin command to create factories --- plugin.yml | 6 +- pom.xml | 2 +- .../commands/FactoryModCommandHandler.java | 52 ++++++++ .../FactoryMod/commands/commands/Create.java | 125 ++++++++++++++++++ .../FactoryMod/commands/commands/Menu.java | 25 +--- 5 files changed, 186 insertions(+), 24 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/commands/commands/Create.java diff --git a/plugin.yml b/plugin.yml index 34ab9bb2..240593de 100644 --- a/plugin.yml +++ b/plugin.yml @@ -7,6 +7,10 @@ softdepend: [CivMenu, NameLayer, Citadel] commands: fm: permission: fm.public + fmc: + permission: fm.op permissions: fm.public: - default: true \ No newline at end of file + default: true + fm.op: + default: op \ No newline at end of file diff --git a/pom.xml b/pom.xml index d748f22c..b7b128f0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.7 + 2.0.8 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java b/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java index 7e56a792..4cdd7f73 100644 --- a/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java +++ b/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java @@ -1,5 +1,12 @@ package com.github.igotyou.FactoryMod.commands; +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.command.CommandSender; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.commands.commands.Create; import com.github.igotyou.FactoryMod.commands.commands.Menu; import vg.civcraft.mc.civmodcore.command.CommandHandler; @@ -7,6 +14,51 @@ public class FactoryModCommandHandler extends CommandHandler{ public void registerCommands() { addCommands(new Menu("fm")); + addCommands(new Create("fmc")); + } + + public static List tabCompleteFactory(CommandSender arg0, String [] arg1) { + List fac = new LinkedList(); + String entered = getFactoryName(arg1); + entered = entered.toLowerCase(); + for(String name:FactoryMod.getManager().getAllEggs().keySet()) { + if (name.toLowerCase().startsWith(entered)) { + fac.add(name); + } + } + if (fac.size() == 0) { + return fac; + } + if (fac.size() > 1) { + List res = new LinkedList(); + for(String s : fac) { + String toAdd = s.split(" ")[arg1.length - 1]; + if (!res.contains(toAdd)) { + res.add(toAdd); + } + } + return res; + } + StringBuilder sb = new StringBuilder(); + for(int i = arg1.length - 1; i < fac.get(0).split(" ").length; i++) { + sb.append(fac.get(0).split(" ") [i]); + sb.append(" "); + } + fac.clear(); + fac.add(sb.toString().substring(0, sb.length() - 1).toLowerCase()); + return fac; + } + + public static String getFactoryName(String[] args) { + if (args.length == 0) { + return ""; + } + StringBuilder sb = new StringBuilder(); + for (String arg : args) { + sb.append(arg); + sb.append(" "); + } + return sb.toString().substring(0, sb.length() - 1); } diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Create.java b/src/com/github/igotyou/FactoryMod/commands/commands/Create.java new file mode 100644 index 00000000..9d9d999c --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Create.java @@ -0,0 +1,125 @@ +package com.github.igotyou.FactoryMod.commands.commands; + +import java.util.List; +import java.util.Set; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import vg.civcraft.mc.civmodcore.command.PlayerCommand; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; +import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; +import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; +import com.github.igotyou.FactoryMod.eggs.PipeEgg; +import com.github.igotyou.FactoryMod.eggs.SorterEgg; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; + +public class Create extends PlayerCommand { + + public Create(String name) { + super(name); + setIdentifier("fmc"); + setDescription("Creates a factory at the blocks you are looking at"); + setUsage("/fmc "); + setArguments(0, 10); + } + + @Override + public boolean execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage(ChatColor.MAGIC + + "How the hell is this supposed to work"); + return true; + } + FactoryModManager manager = FactoryMod.getManager(); + String name = FactoryModCommandHandler.getFactoryName(args); + IFactoryEgg egg = manager.getEgg(name); + if (egg == null) { + String comp = name.toLowerCase(); + // check for lower/uppercase miss spellings + for (Entry entry : manager.getAllEggs() + .entrySet()) { + if (entry.getKey().toLowerCase().equals(comp)) { + egg = entry.getValue(); + break; + } + } + if (egg == null) { + sender.sendMessage(ChatColor.RED + + "This factory does not exist"); + return true; + } + } + Set transparent = null; + List view = ((Player) sender).getLineOfSight(transparent, 10); + if (egg instanceof FurnCraftChestEgg) { + FurnCraftChestEgg fcce = (FurnCraftChestEgg) egg; + if (view.get(view.size() - 1).getType() == Material.WORKBENCH) { + FurnCraftChestStructure fccs = new FurnCraftChestStructure( + view.get(view.size() - 1)); + if (!fccs.isComplete()) { + sender.sendMessage(ChatColor.RED + + "The required block structure for this factory doesn't exist here"); + return true; + } + manager.addFactory(fcce.hatch(fccs, (Player) sender)); + sender.sendMessage(ChatColor.GREEN + "Created " + egg.getName()); + } else { + sender.sendMessage(ChatColor.RED + + "You are not looking at the right block for this factory"); + } + return true; + } + if (egg instanceof PipeEgg) { + PipeEgg fcce = (PipeEgg) egg; + if (view.get(view.size() - 1).getType() == Material.DISPENSER) { + PipeStructure fccs = new PipeStructure( + view.get(view.size() - 1)); + if (!fccs.isComplete()) { + sender.sendMessage(ChatColor.RED + + "The required block structure for this factory doesn't exist here"); + return true; + } + manager.addFactory(fcce.hatch(fccs, (Player) sender)); + sender.sendMessage(ChatColor.GREEN + "Created " + egg.getName()); + } else { + sender.sendMessage(ChatColor.RED + + "You are not looking at the right block for this factory"); + } + return true; + } + if (egg instanceof SorterEgg) { + SorterEgg fcce = (SorterEgg) egg; + if (view.get(view.size() - 1).getType() == Material.DROPPER) { + BlockFurnaceStructure fccs = new BlockFurnaceStructure( + view.get(view.size() - 1)); + if (!fccs.isComplete()) { + sender.sendMessage(ChatColor.RED + + "The required block structure for this factory doesn't exist here"); + return true; + } + manager.addFactory(fcce.hatch(fccs, (Player) sender)); + sender.sendMessage(ChatColor.GREEN + "Created " + egg.getName()); + } else { + sender.sendMessage(ChatColor.RED + + "You are not looking at the right block for this factory"); + } + } + + return true; + } + + @Override + public List tabComplete(CommandSender arg0, String[] arg1) { + return FactoryModCommandHandler.tabCompleteFactory(arg0, arg1); + } +} diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java index f0cfb995..f8fa7088 100644 --- a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.commands.commands; -import java.util.LinkedList; import java.util.List; import org.bukkit.ChatColor; @@ -8,6 +7,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; import com.github.igotyou.FactoryMod.utility.MenuBuilder; import vg.civcraft.mc.civmodcore.command.PlayerCommand; @@ -37,32 +37,13 @@ public boolean execute(CommandSender sender, String[] args) { if (args.length == 0) { mb.openFactoryBrowser(p, null); } else { - mb.openFactoryBrowser(p, getFactoryName(args)); + mb.openFactoryBrowser(p, FactoryModCommandHandler.getFactoryName(args)); } return true; } @Override public List tabComplete(CommandSender arg0, String [] arg1) { - List fac = new LinkedList(); - String entered = getFactoryName(arg1); - for(String name:FactoryMod.getManager().getAllEggs().keySet()) { - if (name.toLowerCase().startsWith(entered)) { - fac.add(name); - } - } - return fac; - } - - private String getFactoryName(String[] args) { - if (args.length == 0) { - return ""; - } - StringBuilder sb = new StringBuilder(); - for (String arg : args) { - sb.append(arg); - sb.append(" "); - } - return sb.toString().substring(0, sb.length() - 1).toLowerCase(); + return FactoryModCommandHandler.tabCompleteFactory(arg0, arg1); } } From d9ede7d3bef4a1ee618108a5f051b8c31d17d934 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 20:04:24 +0100 Subject: [PATCH 282/459] Recheck whether pipe is complete before transferring and removing leftover debug messages --- src/com/github/igotyou/FactoryMod/factories/Pipe.java | 1 + src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 61275a86..fa5c3a46 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -124,6 +124,7 @@ && transferMaterialsAvailable()) { public void transfer() { LoggingUtils.log("Attempting to transfer for " + getLogData()); + mbs.recheckComplete(); if (mbs.isComplete()) { Inventory sourceInventory = ((InventoryHolder) (((PipeStructure) mbs) .getStart().getState())).getInventory(); diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index d6e3a324..f8614c97 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -435,11 +435,9 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { ci.setSlot(inputClickable, 4); int index = 13; List ins = rec.getInputRepresentation(null); - System.out.println(ins.size()); if (ins.size() > 18) { ins = new ItemMap(ins).getLoredItemCountRepresentation(); } - System.out.println(ins.size()); for (ItemStack is : ins) { Clickable c = new DecorationStack(is); ci.setSlot(c, index); From e04e8cb59a5b64e98df5e3bea3caa5964cca7d72 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 20:37:52 +0100 Subject: [PATCH 283/459] Fix fuel consumption intervall for 2 factories --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c85cf398..b52197f2 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4103,7 +4103,7 @@ recipes: production_time: 2h type: UPGRADE name: Upgrade to Glass Blowing Workshop - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 1m input: sand: material: SAND @@ -4119,7 +4119,7 @@ recipes: production_time: 2h type: UPGRADE name: Upgrade to Sandstone Smelter - fuel_consumption_intervall: 15s + fuel_consumption_intervall: 1m input: sandstone: material: SANDSTONE From 08c6a6ccf101cfb28ca163a7c1cad784220ff651 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 20:42:18 +0100 Subject: [PATCH 284/459] Use compact ItemMap view in setup correctly --- src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index f8614c97..3889bd55 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -302,7 +302,7 @@ public void clicked(Player arg0) { } }; ci.setSlot(cheCli, 5); - int slot = 40; + int slot = 31; List itms; if (rec.getInput().getItemStackRepresentation().size() > 27) { itms = rec.getInput().getLoredItemCountRepresentation(); From 4851a5a7c571cf6578ce0ea9a8d1eb963853578f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 21 Mar 2016 21:24:34 +0100 Subject: [PATCH 285/459] Ensure furnaces are on and changing upgrade recipe icon --- .../FactoryMod/factories/FurnCraftChestFactory.java | 4 ++++ src/com/github/igotyou/FactoryMod/factories/Pipe.java | 4 ++++ src/com/github/igotyou/FactoryMod/factories/Sorter.java | 5 +++++ .../github/igotyou/FactoryMod/recipes/Upgraderecipe.java | 9 ++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 2ef93b24..6c75b24e 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -236,6 +236,10 @@ public void run() { // if the factory power source inventory has enough fuel for // at least 1 energyCycle if (pm.powerAvailable()) { + //check whether the furnace is on, minecraft sometimes turns it off + if (getFurnace().getType() != Material.BURNING_FURNACE) { + turnFurnaceOn(getFurnace()); + } // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed int consumptionIntervall = ((InputRecipe) currentRecipe) diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index fa5c3a46..9a96bb04 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -99,6 +99,10 @@ && transferMaterialsAvailable()) { deactivate(); } } else { + Block furnace = ((PipeStructure) mbs).getFurnace(); + if (furnace.getType() != Material.BURNING_FURNACE) { + turnFurnaceOn(furnace); + } // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed if (pm.getPowerCounter() >= pm.getPowerConsumptionIntervall() - 1) { diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 41082d7a..059bc5e3 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -21,6 +21,7 @@ import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class Sorter extends Factory { @@ -105,6 +106,10 @@ && sortableMaterialsAvailable()) { deactivate(); } } else { + Block furnace = ((BlockFurnaceStructure) mbs).getFurnace(); + if (furnace.getType() != Material.BURNING_FURNACE) { + turnFurnaceOn(furnace); + } if (pm.getPowerCounter() >= pm.getPowerConsumptionIntervall() - 1) { pm.consumePower(); pm.setPowerCounter(0); diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 3aac7d4b..d58a719e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -6,8 +6,11 @@ import org.bukkit.ChatColor; import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -40,7 +43,11 @@ public void applyEffect(Inventory i, Factory f) { } public ItemStack getRecipeRepresentation() { - ItemStack res = new ItemStack(Material.WORKBENCH); + ItemStack res = input.getItemStackRepresentation().get(0); + ItemMeta im = res.getItemMeta(); + im.addEnchant(Enchantment.DAMAGE_ALL, 1, true); + im.addItemFlags(ItemFlag.HIDE_ENCHANTS); + res.setItemMeta(im); ISUtils.setName(res, name); return res; } From 0c551827f4d6b4402d48b1275378ebf80f041deb Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Tue, 22 Mar 2016 10:19:40 +0000 Subject: [PATCH 286/459] change colour of factory complete run message --- .../igotyou/FactoryMod/factories/FurnCraftChestFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 6c75b24e..3e43faa2 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -276,7 +276,7 @@ else if (currentProductionTimer >= currentRecipe LoggingUtils.log("Executing recipe " + currentRecipe.getRecipeName() + " for " + getLogData()); - sendActivatorMessage(ChatColor.AQUA + currentRecipe.getRecipeName() + " in " + name + " completed"); + sendActivatorMessage(ChatColor.GOLD + currentRecipe.getRecipeName() + " in " + name + " completed"); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of From bc1190b26eb3847caa40383fbb922df74e2f5dc5 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Tue, 22 Mar 2016 15:16:10 +0000 Subject: [PATCH 287/459] Changed each sendActivator colour --- .../igotyou/FactoryMod/factories/FurnCraftChestFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 3e43faa2..8c050c31 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -264,7 +264,7 @@ public void run() { } // if there is no fuel Available turn off the factory else { - sendActivatorMessage(ChatColor.RED + name + " deactivated, because it ran out of fuel"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of fuel"); deactivate(); } } @@ -299,11 +299,11 @@ else if (currentProductionTimer >= currentRecipe } } } else { - sendActivatorMessage(ChatColor.RED + name + " deactivated, because it ran out of required materials"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of required materials"); deactivate(); } } else { - sendActivatorMessage(ChatColor.RED + name + " deactivated, because the factory was destroyed"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because the factory was destroyed"); deactivate(); } } From 2fdbda7588422f75b18179f2d5bfaefb62d3c6ec Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 22 Mar 2016 20:43:10 +0100 Subject: [PATCH 288/459] Add xp and pylons --- configCivcraft.yml | 337 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index b52197f2..40c64e74 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -544,9 +544,11 @@ factories: - Enchant_Efficiency_Basic - Repair_Small_Factory - Upgrade_to_Bastion_Factory + - Upgrade_to_Emerald_Extractor - Upgrade_to_Compactor_Basic - Upgrade_to_Enchanter_Basic - Upgrade_to_Printing_Press + - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic bastionfactory: type: FCCUPGRADE @@ -621,6 +623,31 @@ factories: - Upgrade_to_Weapon_Enchanter - Upgrade_to_Armour_Enchanter - Repair_Advanced_Factory + xpfactory: + type: FCCUPGRADE + name: Emerald Extractor + recipes: + - Produce_Potash_Enrichement + - Produce_Vitamin_Enrichment + - Produce_Nether_Enrichement + basicpylon: + type: FCCUPGRADE + name: Basic Pylon + recipes: + - Pylon_Basic + - Upgrade_to_Advanced_Pylon + advancedPylon: + type: FCCUPGRADE + name: Advanced Pylon + recipes: + - Pylon_Advanced + - Upgrade_to_Expert_Pylon + expertpylon: + type: FCCUPGRADE + name: Expert Pylon + recipes: + - Pylon_Expert + normalpipe: type: PIPE name: Standard Pipe @@ -4247,6 +4274,316 @@ recipes: material: STONE durability: 5 amount: 256 + Upgrade_to_Emerald_Extractor: + name: Upgrade to Emerald Extractor + production_time: 4h + fuel_consumption_intervall: 2m + type: UPGRADE + factory: Emerald Extractor + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 32 + potato: + material: BAKED_POTATO + amount: 512 + carrots: + material: CARROT_ITEM + amount: 512 + mushroom: + material: BROWN_MUSHROOM + amount: 256 + yesdiet_more_mushroom: + material: RED_MUSHROOM + amount: 256 + aether: + material: GOLD_NUGGET + amount: 512 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + vines: + material: VINE + amount: 128 + grass: + material: LONG_GRASS + amount: 256 + durability: 1 + pumpkin: + material: PUMPKIN + amount: 256 + melon: + material: MELON_BLOCK + amount: 128 + Upgrade_to_Basic_Pylon: + type: UPGRADE + name: Upgrade to Basic Pylon + production_time: 8h + fuel_consumption_intervall: 5m + factory: Basic Pylon + input: + goldblocks: + material: GOLD_BLOCK + amount: 8 + redstoneblocks: + material: REDSTONE_BLOCK + amount: 8 + ironblocks: + material: IRON_BLOCK + amount: 8 + glass: + material: GLASS + amount: 512 + Upgrade_to_Advanced_Pylon: + type: UPGRADE + name: Upgrade to Advanced Pylon + production_time: 8h + fuel_consumption_intervall: 5m + factory: Advanced Pylon + input: + diamondblocks: + material: DIAMOND_BLOCK + amount: 2 + goldblocks: + material: GOLD_BLOCK + amount: 24 + redstoneblocks: + material: REDSTONE_BLOCK + amount: 24 + ironblocks: + material: IRON_BLOCK + amount: 24 + glass: + material: GLASS + amount: 1024 + Upgrade_to_Expert_Pylon: + type: UPGRADE + name: Upgrade to Expert Pylon + production_time: 8h + fuel_consumption_intervall: 5m + factory: Expert Pylon + input: + diamondblock: + material: DIAMOND_BLOCK + amount: 8 + goldblocks: + material: GOLD_BLOCK + amount: 64 + redstoneblocks: + material: REDSTONE_BLOCK + amount: 64 + ironblocks: + material: IRON_BLOCK + amount: 64 + glass: + material: GLASS + amount: 2048 + gunpowder: + material: SULPHUR + amount: 64 + logs: + material: LOG + amount: 1024 + durability: -1 + +#XP recipes + Produce_Potash_Enrichement: + name: Produce Potash Enrichment + type: PRODUCTION + production_time: 15s + input: + aether: + material: GOLD_NUGGET + amount: 128 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + essence: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + potato: + material: BAKED_POTATO + amount: 256 + sugar: + material: SUGAR + amount: 256 + melon: + material: MELON_BLOCK + amount: 32 + redrose: + material: RED_ROSE + amount: 8 + brown_mushroom: + material: BROWN_MUSHROOM + amount: 64 + oaksapling: + material: SAPLING + amount: 4 + sprucelog: + material: LOG + amount: 32 + durability: 1 + output: + emeralds: + material: EMERALD + amount: 128 + Produce_Vitamin_Enrichment: + type: PRODUCTION + name: Produce Vitamin Enrichment + production_time: 15s + input: + aether: + material: GOLD_NUGGET + amount: 128 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + essence: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + carrots: + material: CARROT_ITEM + amount: 256 + cocoa: + material: INK_SACK + amount: 92 + durability: 3 + grass: + material: LONG_GRASS + durability: 1 + amount: 32 + rose: + material: RED_ROSE + amount: 8 + brownmushrooms: + material: BROWN_MUSHROOM + amount: 64 + oaksapling: + material: SAPLING + amount: 4 + junglelog: + material: LOG + durability: 3 + amount: 32 + output: + xp: + material: EMERALD + amount: 128 + Produce_Nether_Enrichement: + type: PRODUCTION + name: Produce Vitamin Enrichment + production_time: 15s + input: + aether: + material: GOLD_NUGGET + amount: 128 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + essence: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + vines: + material: VINE + amount: 128 + netherwart: + material: NETHER_STALK + amount: 64 + cactus: + material: CACTUS + amount: 256 + yellow_flower: + material: YELLOW_FLOWER + amount: 8 + redmushroom: + material: RED_MUSHROOM + amount: 64 + birchsapling: + material: SAPLING + durability: 2 + amount: 4 + darkoaklog: + material: LOG_2 + durability: 1 + amount: 32 + output: + xp: + material: EMERALD + amount: 128 + +#Pylon recipes + Pylon_Basic: + name: Extract Aether + type: PYLON + production_time: 2h + input: + output: + aether: + material: GOLD_NUGGET + amount: 10 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + weight: 40 + Pylon_Advanced: + name: Extract Aether + type: PYLON + production_time: 1h + input: + output: + aether: + material: GOLD_NUGGET + amount: 14 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + weight: 26 + Pylon_Expert: + name: Extract Aether + type: PYLON + production_time: 1h + input: + output: + aether: + material: GOLD_NUGGET + amount: 20 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + weight: 20 + + #Bastion recipes Brew_Soup_Concentrate: From b033330baa0d626535dac25ff45d9fa5e6810e0e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 22 Mar 2016 21:26:32 +0100 Subject: [PATCH 289/459] Pylons consume a reasonable amount of charcoal2 --- configCivcraft.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 40c64e74..ec5ac458 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4541,6 +4541,7 @@ recipes: name: Extract Aether type: PYLON production_time: 2h + fuel_consumption_intervall: 6m input: output: aether: @@ -4555,6 +4556,7 @@ recipes: Pylon_Advanced: name: Extract Aether type: PYLON + fuel_consumption_intervall: 6m production_time: 1h input: output: @@ -4570,6 +4572,7 @@ recipes: Pylon_Expert: name: Extract Aether type: PYLON + fuel_consumption_intervall: 6m production_time: 1h input: output: From 0311700b80ec66104a2dce7af3e339beb4729944 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 22 Mar 2016 21:29:33 +0100 Subject: [PATCH 290/459] Commenting out essence cost in xp for now --- configCivcraft.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index ec5ac458..6c5dcb5e 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4407,13 +4407,13 @@ recipes: enchants: dura: enchant: DURABILITY - essence: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY +# essence: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY potato: material: BAKED_POTATO amount: 256 @@ -4453,13 +4453,13 @@ recipes: enchants: dura: enchant: DURABILITY - essence: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY +# essence: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY carrots: material: CARROT_ITEM amount: 256 @@ -4501,13 +4501,13 @@ recipes: enchants: dura: enchant: DURABILITY - essence: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY +# essence: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY vines: material: VINE amount: 128 From 34bd4914b06275b8d0b34d91e242788ebb3e9652 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 22 Mar 2016 21:38:08 +0100 Subject: [PATCH 291/459] Add pylon repair recipes --- configCivcraft.yml | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 6c5dcb5e..14b5e71c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -636,18 +636,22 @@ factories: recipes: - Pylon_Basic - Upgrade_to_Advanced_Pylon + - Repair_Basic_Pylon advancedPylon: type: FCCUPGRADE name: Advanced Pylon recipes: - Pylon_Advanced - Upgrade_to_Expert_Pylon + - Repair_Advanced_Pylon expertpylon: type: FCCUPGRADE name: Expert Pylon recipes: - - Pylon_Expert - + - Pylon_Expert + - Repair_Expert_Pylon + +#Pipes normalpipe: type: PIPE name: Standard Pipe @@ -671,6 +675,8 @@ factories: transfer_time_multiplier: 10 transfer_amount: 24 glass_color: 2 + +#Sorters sortera: type: SORTER name: Standard Sorter @@ -4585,7 +4591,37 @@ recipes: dura: enchant: DURABILITY weight: 20 - + + +#Pylon repair recipes + Repair_Basic_Pylon: + type: REPAIR + name: Repair Basic Pylon + production_time: 10s + input: + xp: + material: EMERALD + amount: 100 + health_gained: 1000 + Repair_Advanced_Pylon: + type: REPAIR + name: Repair Basic Pylon + production_time: 10s + input: + xp: + material: EMERALD + amount: 140 + health_gained: 1000 + Repair_Expert_Pylon: + type: REPAIR + name: Repair Basic Pylon + production_time: 10s + input: + xp: + material: EMERALD + amount: 200 + health_gained: 1000 + #Bastion recipes From 3e7649a8b807eebc0bee0d6b6cbdab546c1561ee Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Tue, 22 Mar 2016 21:23:39 +0000 Subject: [PATCH 292/459] Nether enrichment typo --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 14b5e71c..7642d62f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4496,7 +4496,7 @@ recipes: amount: 128 Produce_Nether_Enrichement: type: PRODUCTION - name: Produce Vitamin Enrichment + name: Produce Nether Enrichment production_time: 15s input: aether: From ceecc13a4d7e1f8d99904754c11728d6fb686d35 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 23 Mar 2016 00:09:25 +0100 Subject: [PATCH 293/459] Use output of first recipe in upgraded factory as representation --- .../interactionManager/FurnCraftChestInteractionManager.java | 1 - src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index b437522f..8ab2c515 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,6 +1,5 @@ package com.github.igotyou.FactoryMod.interactionManager; -import java.sql.Date; import java.util.HashMap; import org.bukkit.ChatColor; diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index d58a719e..27f93850 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -43,7 +43,8 @@ public void applyEffect(Inventory i, Factory f) { } public ItemStack getRecipeRepresentation() { - ItemStack res = input.getItemStackRepresentation().get(0); + ItemStack res = ((InputRecipe)((FurnCraftChestEgg)egg).getRecipes().get(0)).getOutputRepresentation(null).get(0); + res.setAmount(0); ItemMeta im = res.getItemMeta(); im.addEnchant(Enchantment.DAMAGE_ALL, 1, true); im.addItemFlags(ItemFlag.HIDE_ENCHANTS); From a6e0b68f90b07f50f03d9336e07ee3ac39dc07da Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 23 Mar 2016 00:36:07 +0100 Subject: [PATCH 294/459] Add global pylon weight to config (before anyone notices) --- configCivcraft.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 7642d62f..f59e26a7 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -10,6 +10,9 @@ break_grace_period: 10d decay_intervall: 1h decay_amount: 21 use_recipe_yamlidentifiers: true +global_pylon_limit: 100 + + factories: #Base factory from which all others upgrade From 707dfdfa160c32e76f831762d65ec40faea610a5 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Wed, 23 Mar 2016 00:00:15 +0000 Subject: [PATCH 295/459] Pylon recipe changes --- configCivcraft.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 7642d62f..701639f3 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4356,19 +4356,19 @@ recipes: input: diamondblocks: material: DIAMOND_BLOCK - amount: 2 + amount: 4 goldblocks: material: GOLD_BLOCK - amount: 24 + amount: 48 redstoneblocks: material: REDSTONE_BLOCK - amount: 24 + amount: 48 ironblocks: material: IRON_BLOCK - amount: 24 + amount: 48 glass: material: GLASS - amount: 1024 + amount: 2048 Upgrade_to_Expert_Pylon: type: UPGRADE name: Upgrade to Expert Pylon @@ -4378,25 +4378,25 @@ recipes: input: diamondblock: material: DIAMOND_BLOCK - amount: 8 + amount: 24 goldblocks: material: GOLD_BLOCK - amount: 64 + amount: 256 redstoneblocks: material: REDSTONE_BLOCK - amount: 64 + amount: 256 ironblocks: material: IRON_BLOCK - amount: 64 + amount: 256 glass: material: GLASS - amount: 2048 + amount: 1280 gunpowder: material: SULPHUR - amount: 64 + amount: 256 logs: material: LOG - amount: 1024 + amount: 640 durability: -1 #XP recipes From 73bb239e0867b94d24516879856b0d3583bef35f Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 23 Mar 2016 01:12:21 +0100 Subject: [PATCH 296/459] Amount should be 1 --- src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 27f93850..e0caba67 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -44,7 +44,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = ((InputRecipe)((FurnCraftChestEgg)egg).getRecipes().get(0)).getOutputRepresentation(null).get(0); - res.setAmount(0); + res.setAmount(1); ItemMeta im = res.getItemMeta(); im.addEnchant(Enchantment.DAMAGE_ALL, 1, true); im.addItemFlags(ItemFlag.HIDE_ENCHANTS); From 675b3d43e6fdc62718446612811f321fbc40d4cc Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 23 Mar 2016 02:03:06 +0100 Subject: [PATCH 297/459] Enchanting recipes improved to be useable as upgrading enchants and upgrading docu --- config.yml | 37 +++++++++++++ .../igotyou/FactoryMod/ConfigParser.java | 12 ++++- .../DeterministicEnchantingRecipe.java | 54 +++++++++++-------- 3 files changed, 80 insertions(+), 23 deletions(-) diff --git a/config.yml b/config.yml index a702f26d..26186576 100644 --- a/config.yml +++ b/config.yml @@ -496,6 +496,43 @@ factories: #factory is the name of the factory it's supposed to be upgraded to. This factory must have been specified as FCCUPGRADE #above and the name here and above has to be exactly the same. + +#6. Enchantingrecipe + +#Enchanting recipes allow factories to apply enchants to items. Instead of just consuming a blank tool to produce an enchanted +#one the way it would be possible with enchanted tools, this actually applies the enchant. This can also be used to increase the +#level of an already existing enchant + +#Example: + +#enchanting: +# type: ENCHANT +# name: Enchant with Effiency 5 +# input: +# diamond: +# material: DIAMOND +# amount: 50 +# enchant: DIG_SPEED +# level: 5 +# enchant_item: +# tool: +# material: DIAMOND_PICKAXE + +#type has to be ENCHANT for this recipe + +#name is the name of the recipe displayed ingame + +#input are additional items which are consumed as a cost to enchant the item + +#enchant is the enchant which is applied to the item, use official spigot identifers for this: +#https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html + +#level is the level of the enchant, if not specified this will default to 1 + +#enchant_item is the item to which the enchant is applied. This can just be a blank tool, if you want this enchant to be appliable +#to any tool of this material or you can give this item an enchant with the same type as this recipe, but of a different level to use +#this recipe as an upgrade to the enchant + recipes: diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 415aad89..5f1d2852 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -10,6 +10,7 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; @@ -25,6 +26,7 @@ import com.github.igotyou.FactoryMod.recipes.AOERepairRecipe; import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; +import com.github.igotyou.FactoryMod.recipes.DeterministicEnchantingRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; @@ -53,7 +55,7 @@ public ConfigParser(FactoryMod plugin) { this.plugin = plugin; } - /** + /** * Parses the whole config and creates a manager containing everything that * was parsed from the config * @@ -487,6 +489,14 @@ private IRecipe parseRecipe(ConfigurationSection config) { int weight = config.getInt("weight"); result = new PylonRecipe(name, productionTime, in, out, weight); break; + case "ENCHANT": + ItemMap inp = parseItemMap(config + .getConfigurationSection("input")); + Enchantment enchant = Enchantment.getByName(config.getString("enchant")); + int level = config.getInt("level", 1); + ItemMap tool = parseItemMap(config.getConfigurationSection("enchant_item")); + result = new DeterministicEnchantingRecipe(name, productionTime, inp, tool, enchant, level); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index 4ecaf230..e4c7c3a2 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -4,10 +4,10 @@ import java.util.List; import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -17,10 +17,10 @@ public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; private int level; - private Material tool; + private ItemMap tool; public DeterministicEnchantingRecipe(String name, int productionTime, - ItemMap input, Material tool, Enchantment enchant, int level) { + ItemMap input, ItemMap tool, Enchantment enchant, int level) { super(name, productionTime, input); this.enchant = enchant; this.tool = tool; @@ -29,9 +29,12 @@ public DeterministicEnchantingRecipe(String name, int productionTime, public boolean enoughMaterialAvailable(Inventory i) { if (input.isContainedIn(i)) { + ItemStack toolio = tool.getItemStackRepresentation().get(0); for (ItemStack is : i.getContents()) { - if (is != null && is.getType() == tool - && is.getItemMeta().getEnchantLevel(enchant) < level) { + if (is != null + && toolio.getType() == is.getType() + && toolio.getEnchantmentLevel(enchant) == is + .getEnchantmentLevel(enchant)) { return true; } } @@ -40,26 +43,28 @@ public boolean enoughMaterialAvailable(Inventory i) { } public ItemStack getRecipeRepresentation() { - ItemStack is = new ItemStack(tool); + ItemStack is = tool.getItemStackRepresentation().get(0); + is.removeEnchantment(enchant); is.addEnchantment(enchant, level); ISUtils.setName(is, name); return is; } public List getOutputRepresentation(Inventory i) { - ItemStack is = new ItemStack(tool); + ItemStack is = tool.getItemStackRepresentation().get(0); + is.removeEnchantment(enchant); is.addEnchantment(enchant, level); if (i != null) { ISUtils.addLore( is, ChatColor.GREEN + "Enough materials for " - + String.valueOf(Math.max(new ItemMap( - new ItemStack(tool)) - .getMultiplesContainedIn(i), input - .getMultiplesContainedIn(i))) + " runs"); + + String.valueOf(Math.min( + tool.getMultiplesContainedIn(i), + input.getMultiplesContainedIn(i))) + + " runs"); } - List stacks = new LinkedList(); + List stacks = new LinkedList(); stacks.add(is); return stacks; } @@ -67,11 +72,11 @@ public List getOutputRepresentation(Inventory i) { public List getInputRepresentation(Inventory i) { if (i == null) { List bla = input.getItemStackRepresentation(); - bla.add(new ItemStack(tool)); + bla.add(tool.getItemStackRepresentation().get(0)); return bla; } List returns = createLoredStacksForInfo(i); - ItemStack toSt = new ItemStack(tool); + ItemStack toSt = tool.getItemStackRepresentation().get(0); ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); returns.add(toSt); @@ -80,14 +85,19 @@ public List getInputRepresentation(Inventory i) { public void applyEffect(Inventory i, Factory f) { logBeforeRecipeRun(i, f); - for(ItemStack is:input.getItemStackRepresentation()) { - i.removeItem(is); - } - for(ItemStack is:i.getContents()) { - if (is != null && is.getType() == tool && is.getItemMeta().getEnchantLevel(enchant) < level) { - is.getItemMeta().removeEnchant(enchant); - is.getItemMeta().addEnchant(enchant, level, true); - break; + if (input.removeSafelyFrom(i)) { + ItemStack toolio = tool.getItemStackRepresentation().get(0); + for (ItemStack is : i.getContents()) { + if (is != null + && toolio.getType() == is.getType() + && toolio.getEnchantmentLevel(enchant) == is + .getEnchantmentLevel(enchant)) { + ItemMeta im = is.getItemMeta(); + im.removeEnchant(enchant); + im.addEnchant(enchant, level, true); + is.setItemMeta(im); + break; + } } } logAfterRecipeRun(i, f); From 2264a69f95cf2c4bd44c2485f2238f5e91ff8dd9 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Thu, 24 Mar 2016 05:50:10 +0000 Subject: [PATCH 298/459] Slight basic pipe & sorter balancing --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 07064f1c..6a4f18de 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -661,7 +661,7 @@ factories: setupcost: redstone: material: REDSTONE - amount: 128 + amount: 16 transfer_time_multiplier: 1s transfer_amount: 16 glass_color: 1 @@ -686,7 +686,7 @@ factories: setupcost: redstone: material: REDSTONE - amount: 128 + amount: 16 sort_time: 2s sort_amount: 32 maximum_materials_per_side: 5 From dad679a85dc3932480247053bc44e00a22b1415c Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Thu, 24 Mar 2016 06:12:37 +0000 Subject: [PATCH 299/459] adding crystallization factory recipe --- configCivcraft.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 07064f1c..b2fc464a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -553,6 +553,7 @@ factories: - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic + - Upgrade_to_Crystallization_Factory bastionfactory: type: FCCUPGRADE name: Bastion Factory @@ -653,6 +654,13 @@ factories: recipes: - Pylon_Expert - Repair_Expert_Pylon + crystallizationfactory: + type: FCCUPGRADE + name: Crystallization Factory + recipes: + - Pack_Snow_To_Ice + - Compress_Ice_To_Packed_Ice + - Repair_Factory #Pipes normalpipe: @@ -4545,6 +4553,18 @@ recipes: material: EMERALD amount: 128 + Upgrade_to_Crystallization_Factory: + production_time: 10m + type: UPGRADE + name: Upgrade to Crystallization Factory + fuel_consumption_intervall: 20s + input: + snow: + material: SNOW_BLOCK + amount: 576 + waterbucket: + material: WATER_BUCKET + amount: 4 #Pylon recipes Pylon_Basic: name: Extract Aether @@ -5432,3 +5452,33 @@ recipes: material: STAINED_GLASS_PANE amount: 64 durability: 15 + Pack_Snow_To_Ice: + name: Pack Snow into Ice + type: PRODUCTION + production_time: 10s + input: + snow: + material: SNOW_BLOCK + amount: 576 + waterbucket: + material: WATER_BUCKET + amount: 4 + output: + ice: + material: ICE + amount: 288 + bucket: + material: BUCKET + amount: 4 + Compress_Ice_To_Packed_Ice: + name: Compress Ice into Compressed Ice + type: PRODUCTION + production_time: 10s + input: + snow: + material: ICE + amount: 288 + output: + ice: + material: PACKED_ICE + amount: 192 From 68804241ee4f5a6827d14fcd9def7e63b2345f5d Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Thu, 24 Mar 2016 07:03:47 +0000 Subject: [PATCH 300/459] Update configCivcraft.yml --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 6a4f18de..28c06811 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -661,7 +661,7 @@ factories: setupcost: redstone: material: REDSTONE - amount: 16 + amount: 48 transfer_time_multiplier: 1s transfer_amount: 16 glass_color: 1 @@ -686,7 +686,7 @@ factories: setupcost: redstone: material: REDSTONE - amount: 16 + amount: 48 sort_time: 2s sort_amount: 32 maximum_materials_per_side: 5 From 2ce9266d1a16ef6d1f1b488031d36465fddc889e Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Thu, 24 Mar 2016 07:09:57 +0000 Subject: [PATCH 301/459] update requirements --- configCivcraft.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index b2fc464a..d0760d71 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -154,6 +154,7 @@ factories: - Smelt_Glass_Expert - Smelt_Glass_Panes_Advanced - Blow_Glassbottles + - Upgrade_to_Crystallization_Factory - Repair_Factory sandstonesmelter: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Sandstone Smelter @@ -553,7 +554,6 @@ factories: - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic - - Upgrade_to_Crystallization_Factory bastionfactory: type: FCCUPGRADE name: Bastion Factory @@ -4561,7 +4561,10 @@ recipes: input: snow: material: SNOW_BLOCK - amount: 576 + amount: 1024 + ice: + material: ICE + amount: 1024 waterbucket: material: WATER_BUCKET amount: 4 @@ -5466,7 +5469,7 @@ recipes: output: ice: material: ICE - amount: 288 + amount: 64 bucket: material: BUCKET amount: 4 @@ -5477,8 +5480,8 @@ recipes: input: snow: material: ICE - amount: 288 + amount: 192 output: ice: material: PACKED_ICE - amount: 192 + amount: 64 From 030fee2e7869a29a0f838a2a459240321758f43f Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Thu, 24 Mar 2016 07:11:20 +0000 Subject: [PATCH 302/459] typos --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d0760d71..b95f12df 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5478,10 +5478,10 @@ recipes: type: PRODUCTION production_time: 10s input: - snow: + ice: material: ICE amount: 192 output: - ice: + packedice: material: PACKED_ICE amount: 64 From ffe324e410654d98b9a46f7669d9f33ad39190bb Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 25 Mar 2016 18:22:42 +0100 Subject: [PATCH 303/459] Add events for transferring, activating factories and executing recipes --- pom.xml | 4 +- .../events/FactoryActivateEvent.java | 39 +++++++++++++++ .../FactoryMod/events/ItemTransferEvent.java | 50 +++++++++++++++++++ .../FactoryMod/events/RecipeExecuteEvent.java | 34 +++++++++++++ .../factories/FurnCraftChestFactory.java | 15 ++++++ .../igotyou/FactoryMod/factories/Pipe.java | 21 +++++++- .../igotyou/FactoryMod/factories/Sorter.java | 26 +++++++++- 7 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java create mode 100644 src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java create mode 100644 src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java diff --git a/pom.xml b/pom.xml index b7b128f0..a80ad8fb 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.8 + 2.0.9 FactoryMod https://github.com/Civcraft/FactoryMod @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.2 + 1.2.02 provided diff --git a/src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java b/src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java new file mode 100644 index 00000000..93343ea2 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java @@ -0,0 +1,39 @@ +package com.github.igotyou.FactoryMod.events; + +import org.bukkit.entity.Player; + +import vg.civcraft.mc.civmodcore.interfaces.CustomEvent; + +import com.github.igotyou.FactoryMod.factories.Factory; + +/** + * Event called when any type of factory is being activated. Cancelling this + * event will prevent the factory from starting up, no additional message will + * be sent to the player informing him about the cancelling, this will be left + * up to the listener cancelling the activation + * + */ +public class FactoryActivateEvent extends CustomEvent { + private Factory fac; + private Player activator; + + public FactoryActivateEvent(Factory f, Player activator) { + this.fac = f; + this.activator = activator; + } + + /** + * @return The factory being activated + */ + public Factory getFactory() { + return fac; + } + + /** + * @return The player activating the factory or null if it was not activated + * by a player + */ + public Player getActivator() { + return activator; + } +} diff --git a/src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java b/src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java new file mode 100644 index 00000000..25f451d3 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java @@ -0,0 +1,50 @@ +package com.github.igotyou.FactoryMod.events; + +import org.bukkit.block.Block; +import org.bukkit.event.inventory.InventoryMoveItemEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; + +/** + * Event called when any factory is moving around items. This will (hopefully) + * make this plugin more compatible with other plugins which have listeners for + * item move events + * + */ +public class ItemTransferEvent extends InventoryMoveItemEvent { + private Factory f; + private Block fromBlock; + private Block toBlock; + + public ItemTransferEvent(Factory f, Inventory fromInventory, + Inventory toInventory, Block fromBlock, Block toBlock, + ItemStack trans) { + super(fromInventory, trans, toInventory, true); + this.f = f; + this.fromBlock = fromBlock; + this.toBlock = toBlock; + } + + /** + * @return The factory causing the transfer + */ + public Factory getFactory() { + return f; + } + + /** + * @return The source block from which the transfer is originating + */ + public Block getSourceBlock() { + return fromBlock; + } + + /** + * @return The target block to which the transfer is going + */ + public Block getTargetBlock() { + return toBlock; + } +} diff --git a/src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java b/src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java new file mode 100644 index 00000000..9b03c6a1 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java @@ -0,0 +1,34 @@ +package com.github.igotyou.FactoryMod.events; + +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.recipes.InputRecipe; + +import vg.civcraft.mc.civmodcore.interfaces.CustomEvent; + +/** + * Event called when executing a recipe in a FurnCraftChestFactory + */ +public class RecipeExecuteEvent extends CustomEvent { + private FurnCraftChestFactory fccf; + private InputRecipe rec; + + public RecipeExecuteEvent(FurnCraftChestFactory fccf, InputRecipe rec) { + this.rec = rec; + this.fccf = fccf; + } + + /** + * @return The factory executing the recipe + */ + public FurnCraftChestFactory getFactory() { + return fccf; + } + + /** + * @return The recipe being executed + */ + public InputRecipe getRecipe() { + return rec; + } + +} diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 8c050c31..fd02e2df 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -17,6 +17,8 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.events.FactoryActivateEvent; +import com.github.igotyou.FactoryMod.events.RecipeExecuteEvent; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.powerManager.FurnacePowerManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; @@ -122,6 +124,11 @@ public void attemptToActivate(Player p) { return; } } + FactoryActivateEvent fae = new FactoryActivateEvent(this, p); + Bukkit.getPluginManager().callEvent(fae); + if (fae.isCancelled()) { + return; + } if (p != null) { int consumptionIntervall = ((InputRecipe) currentRecipe) .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) @@ -276,6 +283,14 @@ else if (currentProductionTimer >= currentRecipe LoggingUtils.log("Executing recipe " + currentRecipe.getRecipeName() + " for " + getLogData()); + RecipeExecuteEvent ree = new RecipeExecuteEvent(this, (InputRecipe) currentRecipe); + Bukkit.getPluginManager().callEvent(ree); + if (ree.isCancelled()) { + LoggingUtils.log("Executing recipe " + + currentRecipe.getRecipeName() + " for " + + getLogData() + " was cancelled over the event"); + return; + } sendActivatorMessage(ChatColor.GOLD + currentRecipe.getRecipeName() + " in " + name + " completed"); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 9a96bb04..a348af1a 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -14,6 +14,8 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import com.github.igotyou.FactoryMod.events.FactoryActivateEvent; +import com.github.igotyou.FactoryMod.events.ItemTransferEvent; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; @@ -45,6 +47,13 @@ public void attemptToActivate(Player p) { if (mbs.isComplete()) { if (transferMaterialsAvailable()) { if (pm.powerAvailable()) { + FactoryActivateEvent fae = new FactoryActivateEvent(this, p); + Bukkit.getPluginManager().callEvent(fae); + if (fae.isCancelled()) { + LoggingUtils.log("Activating for " + getLogData() + + " was cancelled by the event"); + return; + } if (p != null) { p.sendMessage(ChatColor.GREEN + "Activated pipe transfer"); @@ -137,7 +146,8 @@ public void transfer() { int leftToRemove = transferAmount; for (ItemStack is : sourceInventory.getContents()) { if (is != null - && is.getType() != Material.AIR && is.getAmount() != 0 + && is.getType() != Material.AIR + && is.getAmount() != 0 && (allowedMaterials == null || allowedMaterials .contains(is.getType()))) { int removeAmount = Math.min(leftToRemove, is.getAmount()); @@ -145,6 +155,15 @@ public void transfer() { removing.setAmount(removeAmount); ItemMap removeMap = new ItemMap(removing); if (removeMap.fitsIn(targetInventory)) { + ItemTransferEvent ite = new ItemTransferEvent(this, + sourceInventory, targetInventory, + ((PipeStructure) mbs).getStart(), + ((PipeStructure) mbs).getEnd(), removing); + Bukkit.getPluginManager().callEvent(ite); + if (ite.isCancelled()) { + LoggingUtils.log("Transfer for " + removing.toString() + " was cancelled over the event"); + continue; + } LoggingUtils.logInventory(sourceInventory, "Origin inventory before transfer for " + getLogData()); diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 059bc5e3..7b228356 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -16,12 +16,13 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import com.github.igotyou.FactoryMod.events.FactoryActivateEvent; +import com.github.igotyou.FactoryMod.events.ItemTransferEvent; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; import com.github.igotyou.FactoryMod.powerManager.IPowerManager; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.structures.PipeStructure; import com.github.igotyou.FactoryMod.utility.LoggingUtils; public class Sorter extends Factory { @@ -52,6 +53,16 @@ public void attemptToActivate(Player p) { if (mbs.isComplete()) { if (pm.powerAvailable()) { if (sortableMaterialsAvailable()) { + FactoryActivateEvent fae = new FactoryActivateEvent(this, p); + Bukkit.getPluginManager().callEvent(fae); + if (fae.isCancelled()) { + LoggingUtils.log("Activating of " + getLogData() + + " was cancelled by the event"); + return; + } + if (p != null) { + p.sendMessage(ChatColor.GREEN + "Activated " + name); + } activate(); } else { if (p != null) { @@ -172,6 +183,17 @@ public void sortStack() { ItemStack rem = is.clone(); rem.setAmount(removeAmount); if (new ItemMap(is).fitsIn(relInv)) { + ItemTransferEvent ite = new ItemTransferEvent(this, + inv, relInv, center, + center.getRelative(bf), rem); + Bukkit.getPluginManager().callEvent(ite); + if (ite.isCancelled()) { + LoggingUtils.log("Sorting for " + + rem.toString() + " in " + + getLogData() + + " was cancelled over the event"); + continue; + } LoggingUtils.log("Moving " + rem.toString() + " from " @@ -211,7 +233,7 @@ public void sortStack() { public void setRunTime(int runtime) { this.runTime = runtime; } - + public int getRunTime() { return runTime; } From 1de6826828e293f0fbb6eda323ac6c185800529c Mon Sep 17 00:00:00 2001 From: jezzaindahouse Date: Fri, 25 Mar 2016 18:59:38 +0000 Subject: [PATCH 304/459] Updated Pylon Setup Recipes + No more Essence for XP Setup --- configCivcraft.yml | 167 ++++++++++++++++++++++++++++++++------------- 1 file changed, 118 insertions(+), 49 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 07064f1c..595a019a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4290,14 +4290,6 @@ recipes: type: UPGRADE factory: Emerald Extractor input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 32 potato: material: BAKED_POTATO amount: 512 @@ -4338,18 +4330,28 @@ recipes: fuel_consumption_intervall: 5m factory: Basic Pylon input: - goldblocks: - material: GOLD_BLOCK - amount: 8 - redstoneblocks: - material: REDSTONE_BLOCK - amount: 8 - ironblocks: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 10 + enchantmenttable: + material: ENCHANTMENT_TABLE + amount: 5 + ironblocks: material: IRON_BLOCK - amount: 8 - glass: + amount: 32 + goldenapples: + material: GOLDEN_APPLE + amount: 16 + compactedglass: material: GLASS - amount: 512 + amount: 8 + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE + amount: 10 + lore: + - Compacted item Upgrade_to_Advanced_Pylon: type: UPGRADE name: Upgrade to Advanced Pylon @@ -4357,21 +4359,42 @@ recipes: fuel_consumption_intervall: 5m factory: Advanced Pylon input: - diamondblocks: - material: DIAMOND_BLOCK - amount: 4 - goldblocks: - material: GOLD_BLOCK - amount: 48 - redstoneblocks: - material: REDSTONE_BLOCK - amount: 48 - ironblocks: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 32 + enderchests: + material: ENDER_CHEST + amount: 10 + ironblocks: material: IRON_BLOCK amount: 48 - glass: + goldenapples: + material: GOLDEN_APPLE + amount: 32 + compactedglass: material: GLASS - amount: 2048 + amount: 32 + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE + amount: 20 + lore: + - Compacted item + emerald: + material: EMERALD_BLOCK + amount: 42 + compactedstone: + material: STONE + amount: 32 + lore: + - Compacted item + compactedlogs: + material: LOG + amount: 32 + durability: -1 + lore: + - Compacted item Upgrade_to_Expert_Pylon: type: UPGRADE name: Upgrade to Expert Pylon @@ -4379,28 +4402,74 @@ recipes: fuel_consumption_intervall: 5m factory: Expert Pylon input: - diamondblock: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 64 + enderchests: + material: ENDER_CHEST + amount: 32 + diamondblocks: material: DIAMOND_BLOCK - amount: 24 - goldblocks: - material: GOLD_BLOCK - amount: 256 - redstoneblocks: - material: REDSTONE_BLOCK - amount: 256 - ironblocks: - material: IRON_BLOCK - amount: 256 - glass: + amount: 16 + goldenapples: + material: GOLDEN_APPLE + amount: 64 + compactedglass: material: GLASS - amount: 1280 - gunpowder: - material: SULPHUR - amount: 256 - logs: + amount: 64 + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE + amount: 48 + lore: + - Compacted item + emerald: + material: EMERALD_BLOCK + amount: 16 + lore: + - Compacted item + compactedstone: + material: STONE + amount: 512 + lore: + - Compacted item + compactedlogs: material: LOG - amount: 640 - durability: -1 + amount: 10 + durability: 0 + lore: + - Compacted item + compactedlogs: + material: LOG + amount: 10 + durability: 1 + lore: + - Compacted item + compactedlogs: + material: LOG + amount: 10 + durability: 2 + lore: + - Compacted item + compactedlogs: + material: LOG + amount: 10 + durability: 3 + lore: + - Compacted item + compactedlogs: + material: LOG_2 + amount: 10 + durability: 0 + lore: + - Compacted item + compactedlogs: + material: LOG_2 + amount: 10 + durability: 1 + lore: + - Compacted item #XP recipes Produce_Potash_Enrichement: From 86083dfe8b3036d69552731b391ab1ba39161dab Mon Sep 17 00:00:00 2001 From: jezzaindahouse Date: Fri, 25 Mar 2016 19:17:43 +0000 Subject: [PATCH 305/459] Update configCivcraft.yml --- configCivcraft.yml | 114 ++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 595a019a..2c91a313 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4336,7 +4336,7 @@ recipes: enchantmenttable: material: ENCHANTMENT_TABLE amount: 5 - ironblocks: + ironblocks: material: IRON_BLOCK amount: 32 goldenapples: @@ -4345,13 +4345,13 @@ recipes: compactedglass: material: GLASS amount: 8 - lore: - - Compacted item - netherquartzore: - material: QUARTZ_ORE + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE amount: 10 - lore: - - Compacted item + lore: + - Compacted item Upgrade_to_Advanced_Pylon: type: UPGRADE name: Upgrade to Advanced Pylon @@ -4365,7 +4365,7 @@ recipes: enderchests: material: ENDER_CHEST amount: 10 - ironblocks: + ironblocks: material: IRON_BLOCK amount: 48 goldenapples: @@ -4374,27 +4374,27 @@ recipes: compactedglass: material: GLASS amount: 32 - lore: - - Compacted item - netherquartzore: - material: QUARTZ_ORE + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE amount: 20 - lore: - - Compacted item - emerald: + lore: + - Compacted item + emerald: material: EMERALD_BLOCK amount: 42 - compactedstone: + compactedstone: material: STONE amount: 32 - lore: - - Compacted item + lore: + - Compacted item compactedlogs: material: LOG amount: 32 - durability: -1 - lore: - - Compacted item + durability: -1 + lore: + - Compacted item Upgrade_to_Expert_Pylon: type: UPGRADE name: Upgrade to Expert Pylon @@ -4408,7 +4408,7 @@ recipes: enderchests: material: ENDER_CHEST amount: 32 - diamondblocks: + diamondblocks: material: DIAMOND_BLOCK amount: 16 goldenapples: @@ -4417,59 +4417,59 @@ recipes: compactedglass: material: GLASS amount: 64 - lore: - - Compacted item - netherquartzore: - material: QUARTZ_ORE + lore: + - Compacted item + netherquartzore: + material: QUARTZ_ORE amount: 48 - lore: - - Compacted item - emerald: + lore: + - Compacted item + emerald: material: EMERALD_BLOCK amount: 16 - lore: - - Compacted item - compactedstone: + lore: + - Compacted item + compactedstone: material: STONE amount: 512 - lore: - - Compacted item + lore: + - Compacted item compactedlogs: material: LOG amount: 10 - durability: 0 - lore: - - Compacted item - compactedlogs: + durability: 0 + lore: + - Compacted item + compactedlogs: material: LOG amount: 10 - durability: 1 - lore: - - Compacted item - compactedlogs: + durability: 1 + lore: + - Compacted item + compactedlogs: material: LOG amount: 10 - durability: 2 - lore: - - Compacted item - compactedlogs: + durability: 2 + lore: + - Compacted item + compactedlogs: material: LOG amount: 10 - durability: 3 - lore: - - Compacted item - compactedlogs: + durability: 3 + lore: + - Compacted item + compactedlogs: material: LOG_2 amount: 10 - durability: 0 - lore: - - Compacted item - compactedlogs: + durability: 0 + lore: + - Compacted item + compactedlogs: material: LOG_2 amount: 10 - durability: 1 - lore: - - Compacted item + durability: 1 + lore: + - Compacted item #XP recipes Produce_Potash_Enrichement: From 139b2066cd15f16c53bd5a16cd91a75692a94d23 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 25 Mar 2016 23:01:27 +0100 Subject: [PATCH 306/459] Add factory to upgrade to ice factory --- configCivcraft.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index bfa3ac72..d8994bd5 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4331,6 +4331,22 @@ recipes: melon: material: MELON_BLOCK amount: 128 + Upgrade_to_Crystallization_Factory: + production_time: 10m + type: UPGRADE + name: Upgrade to Crystallization Factory + fuel_consumption_intervall: 20s + factory: Crystallization Factory + input: + snow: + material: SNOW_BLOCK + amount: 1024 + ice: + material: ICE + amount: 1024 + waterbucket: + material: WATER_BUCKET + amount: 4 Upgrade_to_Basic_Pylon: type: UPGRADE name: Upgrade to Basic Pylon @@ -4621,22 +4637,8 @@ recipes: xp: material: EMERALD amount: 128 - - Upgrade_to_Crystallization_Factory: - production_time: 10m - type: UPGRADE - name: Upgrade to Crystallization Factory - fuel_consumption_intervall: 20s - input: - snow: - material: SNOW_BLOCK - amount: 1024 - ice: - material: ICE - amount: 1024 - waterbucket: - material: WATER_BUCKET - amount: 4 + + #Pylon recipes Pylon_Basic: name: Extract Aether From 353e9413f60d23b3940e5d0a94785b6cebbd723e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 25 Mar 2016 22:32:28 +0000 Subject: [PATCH 307/459] Added Crates --- configCivcraft.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index d8994bd5..192ab991 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -280,6 +280,7 @@ factories: - Craft_any_type_of_wooden_door - Cut_any_type_of_Plank_Expert - Repair_Small_Factory + - Create_Crate finewoodworking: type: FCCUPGRADE name: Fine Woodworking @@ -5556,3 +5557,20 @@ recipes: packedice: material: PACKED_ICE amount: 64 + Create_Crate: + name: Create Crate + type: PRODUCTION + production_time: 10s + input: + chest: + material: CHEST + amount: 64 + iron: + material: IRON_INGOT + amount: 4 + output: + crates: + material: CHEST + amount: 64 + lore: + - Crate From 397f5c4861a5c046e7d4cc96fd5df21977ada5b5 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 25 Mar 2016 23:43:03 +0100 Subject: [PATCH 308/459] Add random recipes --- config.yml | 34 +++++++ .../igotyou/FactoryMod/ConfigParser.java | 24 +++++ .../recipes/RandomOutputRecipe.java | 95 +++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java diff --git a/config.yml b/config.yml index 26186576..9f580466 100644 --- a/config.yml +++ b/config.yml @@ -482,6 +482,7 @@ factories: #upgrading: # type: UPGRADE +# production_time: 1d # name: Upgrade to super duper factory # input: # diamond: @@ -508,6 +509,7 @@ factories: #enchanting: # type: ENCHANT # name: Enchant with Effiency 5 +# production_time: 10s # input: # diamond: # material: DIAMOND @@ -533,6 +535,38 @@ factories: #to any tool of this material or you can give this item an enchant with the same type as this recipe, but of a different level to use #this recipe as an upgrade to the enchant + +#7. Randomized output recipe + +#Random recipes allow you to specify multiple different outputs for a recipe and to assign a certain chance to each. The sum of all the +#chances should always be 1.0 + +#Example: + +#random: +# type: RANDOM +# production_time: 2s +# name: Stone or Dirt +# input: +# diamond: +# material: DIAMOND +# outputs: +# first: +# chance: 0.5 +# dirt: +# material: DIRT +# second: +# chance: 0.5 +# dirt: +# material: STONE + +#type has to be RANDOM here + +#input are the materials consumed + +#output is a list of item configurations with a chance for it each. It's important to note here that the items themselves still need be a level lower +#yaml structure wise than the chance + recipes: diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 5f1d2852..3a332782 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -5,6 +5,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import org.bukkit.Material; @@ -31,6 +32,8 @@ import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.PylonRecipe; +import com.github.igotyou.FactoryMod.recipes.RandomEnchantingRecipe; +import com.github.igotyou.FactoryMod.recipes.RandomOutputRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; @@ -497,6 +500,27 @@ private IRecipe parseRecipe(ConfigurationSection config) { ItemMap tool = parseItemMap(config.getConfigurationSection("enchant_item")); result = new DeterministicEnchantingRecipe(name, productionTime, inp, tool, enchant, level); break; + case "RANDOM": + ItemMap inpu = parseItemMap(config + .getConfigurationSection("input")); + if (config.getConfigurationSection("outputs") == null) { + plugin.severe("No outputs specified for recipe " + name); + return null; + } + Map outputs = new HashMap(); + double totalChance = 0.0; + for(String key : config.getConfigurationSection("outputs").getKeys(false)) { + double chance = config.getConfigurationSection("outputs").getConfigurationSection(key).getDouble("chance"); + totalChance += chance; + System.out.println("Checking for " + key); + ItemMap im = parseItemMap(config.getConfigurationSection("outputs").getConfigurationSection(key)); + outputs.put(im,chance); + } + if (Math.abs(totalChance - 1.0) > 0.001) { + plugin.warning("Sum of output chances for recipe " + name + " is not 1.0. Total sum is: " + totalChance); + } + result = new RandomOutputRecipe(name, productionTime, inpu, outputs); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java new file mode 100644 index 00000000..a82253a0 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -0,0 +1,95 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; + +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +public class RandomOutputRecipe extends InputRecipe { + private Map outputs; + private static Random rng; + private ItemMap lowestChanceMap; + + public RandomOutputRecipe(String name, int productionTime, ItemMap input, + Map outputs) { + super(name, productionTime, input); + this.outputs = outputs; + if (rng == null) { + rng = new Random(); + } + for(Entry entry : outputs.entrySet()) { + if (lowestChanceMap == null) { + lowestChanceMap = entry.getKey(); + continue; + } + if (entry.getValue() < outputs.get(lowestChanceMap)) { + lowestChanceMap = entry.getKey(); + } + } + if (lowestChanceMap == null) { + lowestChanceMap = new ItemMap(new ItemStack(Material.STONE)); + } + } + + public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); + ItemMap toRemove = input.clone(); + ItemMap toAdd = getRandomOutput().clone(); + if (toRemove.isContainedIn(i)) { + if (toRemove.removeSafelyFrom(i)) { + for(ItemStack is: toAdd.getItemStackRepresentation()) { + i.addItem(is); + } + } + } + logAfterRecipeRun(i, f); + } + + public Map getOutputs() { + return outputs; + } + + public ItemMap getRandomOutput() { + double random = rng.nextDouble(); + double count = 0.0; + for(Entry entry : outputs.entrySet()) { + count += entry.getValue(); + if (count >= random) { + return entry.getKey(); + } + } + return null; + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = lowestChanceMap.getItemStackRepresentation().get(0); + ISUtils.setName(is, name); + return is; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public List getOutputRepresentation(Inventory i) { + List items = lowestChanceMap.getItemStackRepresentation(); + for (ItemStack is : items) { + ISUtils.addLore(is, ChatColor.LIGHT_PURPLE + "Randomized output"); + } + return items; + } + +} From 5127d6b4b611ae7836ecb87c4963ad43f1daa10f Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 25 Mar 2016 23:46:32 +0000 Subject: [PATCH 309/459] Added Random Flower Maker + Fixed Expert Pylon Creation --- configCivcraft.yml | 177 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 158 insertions(+), 19 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 192ab991..486f441d 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1878,17 +1878,150 @@ recipes: material: ACTIVATOR_RAIL amount: 96 Create_any_flower: - type: PRODUCTION + type: RANDOM name: Create any flower - production_time: 5s + production_time: 10s input: - identifiername: - material: STONE + seeds: + material: SEEDS + amount: 64 + waterbucket: + material: WATER_BUCKET amount: 1 output: - identifiername: - material: STONE - amount: 1 + 1: + chance: 0.08 + poppy: + material: RED_ROSE + durability: 0 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 2: + chance: 0.08 + blueorchid: + material: RED_ROSE + durability: 1 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 3: + chance: 0.08 + allium: + material: RED_ROSE + durability: 2 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 4: + chance: 0.08 + azurebluet: + material: RED_ROSE + durability: 3 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 5: + chance: 0.08 + redtulip: + material: RED_ROSE + durability: 4 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 6: + chance: 0.08 + orangetulip: + material: RED_ROSE + durability: 5 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 7: + chance: 0.08 + whitetulip: + material: RED_ROSE + durability: 6 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 8: + chance: 0.08 + pinktulip: + material: RED_ROSE + durability: 7 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 9: + chance: 0.08 + oxeyedaisy: + material: RED_ROSE + durability: 8 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 10: + chance: 0.08 + yellowflower: + material: YELLOW_FLOWER + amount: 4 + emptybucket: + material: BUCKET + amount: 1 + 11: + chance: 0.025 + sunflower: + material: DOUBLE_PLANT + durability: 0 + amount: 1 + emptybucket: + material: BUCKET + amount: 1 + 12: + chance: 0.025 + lilac: + material: DOUBLE_PLANT + durability: 1 + amount: 1 + emptybucket: + material: BUCKET + amount: 1 + 13: + chance: 0.025 + rosebush: + material: DOUBLE_PLANT + durability: 4 + amount: 1 + emptybucket: + material: BUCKET + amount: 1 + 14: + chance: 0.025 + peony: + material: DOUBLE_PLANT + durability: 5 + amount: 1 + emptybucket: + material: BUCKET + amount: 1 + ihateflowers: + chance: 0.1 + deadbush: + material: DEAD_BUSH + amount: 1 + emptybucket: + material: BUCKET + amount: 1 Create_any_hostile_mob_egg: type: PRODUCTION name: Create any hostile mob egg @@ -2063,15 +2196,21 @@ recipes: Create_Poppy_Basic: type: PRODUCTION name: Grow Poppy - production_time: 8s + production_time: 16s input: - identifiername: - material: LEAVES - amount: 20 + seeds: + material: SEEDS + amount: 64 + water: + material: WATER_BUCKET + amount: 1 output: - identifiername: + roses: material: RED_ROSE - amount: 8 + amount: 4 + emptybucket: + material: BUCKET + amount: 1 Create_Powered_Rail: type: PRODUCTION name: Create Powered Rail @@ -4459,37 +4598,37 @@ recipes: amount: 512 lore: - Compacted item - compactedlogs: + compactedlogs1: material: LOG amount: 10 durability: 0 lore: - Compacted item - compactedlogs: + compactedlogs2: material: LOG amount: 10 durability: 1 lore: - Compacted item - compactedlogs: + compactedlogs3: material: LOG amount: 10 durability: 2 lore: - Compacted item - compactedlogs: + compactedlogs4: material: LOG amount: 10 durability: 3 lore: - Compacted item - compactedlogs: + compactedlogs5: material: LOG_2 amount: 10 durability: 0 lore: - Compacted item - compactedlogs: + compactedlogs6: material: LOG_2 amount: 10 durability: 1 From 04512740b64f8fc1163123b47c0f796dd4320b23 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 26 Mar 2016 00:00:56 +0000 Subject: [PATCH 310/459] Slight changes to Grow Random Flower --- configCivcraft.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 486f441d..30820d55 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -394,7 +394,7 @@ factories: type: FCCUPGRADE name: Flower Gardening recipes: - - Create_any_flower + - Grow_random_flower - Repair_Factory treemutator: type: FCCUPGRADE @@ -1877,9 +1877,9 @@ recipes: activator rail: material: ACTIVATOR_RAIL amount: 96 - Create_any_flower: + Grow_random_flower: type: RANDOM - name: Create any flower + name: Grow random flower production_time: 10s input: seeds: @@ -1888,7 +1888,7 @@ recipes: waterbucket: material: WATER_BUCKET amount: 1 - output: + outputs: 1: chance: 0.08 poppy: From 94fae13f7c5a6fee48572146e224b83c7acf7b5d Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 26 Mar 2016 01:37:38 +0000 Subject: [PATCH 311/459] Added Random Sapling/Leaves Mutator + Removed Create Poppy Advanced --- configCivcraft.yml | 205 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 170 insertions(+), 35 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 30820d55..a48bbe8b 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -368,7 +368,6 @@ factories: type: FCCUPGRADE name: Bio Lab recipes: - - Create_Poppy_Advanced - Mutate_Tall_Grass_Basic - Take_friendly_mob_egg_apart_Basic - Create_Podzol_Basic @@ -400,8 +399,8 @@ factories: type: FCCUPGRADE name: Tree Mutator recipes: - - Mutate_any_sapling_into_any_other - - Mutate_any_leaf_into_any_other + - Mutate_random_sapling + - Mutate_random_leaves - Grow_Concentrate_Of_Nature - Repair_Factory madscientist: @@ -2181,18 +2180,6 @@ recipes: material: DIRT durability: 2 amount: 64 - Create_Poppy_Advanced: - type: PRODUCTION - name: Create Poppy Advanced - production_time: 16s - input: - identifiername: - material: LEAVES - amount: 32 - output: - identifiername: - material: RED_ROSE - amount: 16 Create_Poppy_Basic: type: PRODUCTION name: Grow Poppy @@ -3042,30 +3029,178 @@ recipes: rabbit stew: material: RABBIT_STEW amount: 18 - Mutate_any_leaf_into_any_other: - type: PRODUCTION - name: Mutate any leaf into any other - production_time: 5s + Mutate_random_sapling: + type: RANDOM + name: Mutate random sapling + production_time: 10s input: - identifiername: - material: STONE - amount: 1 - output: - identifiername: - material: STONE + sapling: + material: SAPLING + amount: 64 + durability: -1 + waterbucket: + material: WATER_BUCKET amount: 1 - Mutate_any_sapling_into_any_other: - type: PRODUCTION - name: Mutate any sapling into any other - production_time: 5s + outputs: + 1: + chance: 0.125 + oaksapling: + material: SAPLING + amount: 48 + durability: 0 + emptybucket: + material: BUCKET + amount: 1 + 2: + chance: 0.125 + sprucesapling: + material: SAPLING + amount: 48 + durability: 1 + emptybucket: + material: BUCKET + amount: 1 + 3: + chance: 0.125 + birchsapling: + material: SAPLING + amount: 48 + durability: 2 + emptybucket: + material: BUCKET + amount: 1 + 4: + chance: 0.125 + junglesapling: + material: SAPLING + amount: 48 + durability: 3 + emptybucket: + material: BUCKET + amount: 1 + 5: + chance: 0.125 + acaciasapling: + material: SAPLING + amount: 48 + durability: 4 + emptybucket: + material: BUCKET + amount: 1 + 6: + chance: 0.125 + darkoaksapling: + material: SAPLING + amount: 48 + durability: 5 + emptybucket: + material: BUCKET + amount: 1 + 7: + chance: 0.125 + deadbush: + material: DEAD_BUSH + amount: 16 + emptybucket: + material: BUCKET + amount: 1 + 8: + chance: 0.125 + tallfern: + material: DOUBLE_PLANT + amount: 32 + durability: 3 + emptybucket: + material: BUCKET + amount: 1 + Mutate_random_leaves: + type: RANDOM + name: Mutate random leaves + production_time: 10s input: - identifiername: - material: STONE - amount: 1 - output: - identifiername: - material: STONE + sapling: + material: SAPLING + amount: 32 + durability: -1 + seeds: + material: SEEDS + amount: 32 + waterbucket: + material: WATER_BUCKET amount: 1 + outputs: + 1: + chance: 0.125 + oakleaves: + material: LEAVES + amount: 64 + durability: 0 + emptybucket: + material: BUCKET + amount: 1 + 2: + chance: 0.125 + spruceleaves: + material: LEAVES + amount: 64 + durability: 1 + emptybucket: + material: BUCKET + amount: 1 + 3: + chance: 0.125 + birchleaves: + material: LEAVES + amount: 64 + durability: 2 + emptybucket: + material: BUCKET + amount: 1 + 4: + chance: 0.125 + jungleleaves: + material: LEAVES + amount: 64 + durability: 3 + emptybucket: + material: BUCKET + amount: 1 + 5: + chance: 0.125 + acacialeaves: + material: LEAVES_2 + amount: 64 + durability: 0 + emptybucket: + material: BUCKET + amount: 1 + 6: + chance: 0.125 + darkoakleaves: + material: LEAVES_2 + amount: 64 + durability: 1 + emptybucket: + material: BUCKET + amount: 1 + 7: + chance: 0.125 + deadbush: + material: DEAD_BUSH + amount: 16 + durability: 0 + emptybucket: + material: BUCKET + amount: 1 + 8: + chance: 0.125 + tallgrass: + material: DOUBLE_PLANT + amount: 32 + durability: 2 + emptybucket: + material: BUCKET + amount: 1 Mutate_Large_Fern: type: PRODUCTION name: Mutate Large Fern From 1c9c9f9de7c6eee29413110427ec4b58ae8319b9 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 26 Mar 2016 01:50:01 +0000 Subject: [PATCH 312/459] Reworked poppy creation --- configCivcraft.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a48bbe8b..84bbf5f1 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -368,6 +368,7 @@ factories: type: FCCUPGRADE name: Bio Lab recipes: + - Create_Poppy_Advanced - Mutate_Tall_Grass_Basic - Take_friendly_mob_egg_apart_Basic - Create_Podzol_Basic @@ -2180,6 +2181,24 @@ recipes: material: DIRT durability: 2 amount: 64 + Create_Poppy_Advanced: + type: PRODUCTION + name: Create Poppy Advanced + production_time: 16s + input: + seeds: + material: SEEDS + amount: 64 + waterbucket: + material: WATER_BUCKET + amount: 1 + output: + identifiername: + material: RED_ROSE + amount: 4 + emptybucket: + material: BUCKET + amount: 1 Create_Poppy_Basic: type: PRODUCTION name: Grow Poppy @@ -2188,13 +2207,13 @@ recipes: seeds: material: SEEDS amount: 64 - water: + waterbucket: material: WATER_BUCKET amount: 1 output: roses: material: RED_ROSE - amount: 4 + amount: 2 emptybucket: material: BUCKET amount: 1 From 578d757ca3d718947a9d77ed0406aabeece4e47c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 03:02:57 +0100 Subject: [PATCH 313/459] Output unused recipes on startup --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 3a332782..51cafcfe 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -534,13 +535,15 @@ private IRecipe parseRecipe(ConfigurationSection config) { } public void assignRecipesToFactories() { + HashSet usedRecipes = new HashSet(); for (Entry> entry : recipeLists.entrySet()) { if (entry.getKey() instanceof FurnCraftChestEgg) { List recipeList = new LinkedList(); for (String recipeName : entry.getValue()) { IRecipe rec = recipes.get(recipeName); if (rec != null) { - recipeList.add(recipes.get(recipeName)); + recipeList.add(rec); + usedRecipes.add(rec); } else { plugin.severe("Could not find specified recipe " + recipeName @@ -550,6 +553,11 @@ public void assignRecipesToFactories() { ((FurnCraftChestEgg) entry.getKey()).setRecipes(recipeList); } } + for(IRecipe reci : recipes.values()) { + if (!usedRecipes.contains(reci)) { + plugin.warning("The recipe " + reci.getRecipeName() + ""); + } + } } public String getDefaultMenuFactory() { From be9a79670a9b52af7416c33882a6cfce6a10c8be Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 03:04:35 +0100 Subject: [PATCH 314/459] derp --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 51cafcfe..1bf46a89 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -513,7 +513,6 @@ private IRecipe parseRecipe(ConfigurationSection config) { for(String key : config.getConfigurationSection("outputs").getKeys(false)) { double chance = config.getConfigurationSection("outputs").getConfigurationSection(key).getDouble("chance"); totalChance += chance; - System.out.println("Checking for " + key); ItemMap im = parseItemMap(config.getConfigurationSection("outputs").getConfigurationSection(key)); outputs.put(im,chance); } @@ -555,7 +554,7 @@ public void assignRecipesToFactories() { } for(IRecipe reci : recipes.values()) { if (!usedRecipes.contains(reci)) { - plugin.warning("The recipe " + reci.getRecipeName() + ""); + plugin.warning("The recipe " + reci.getRecipeName() + " is specified in the config, but not used in any factory"); } } } From 164149f2f51b0617e3c108636cc70ad8a57bcc1c Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 04:50:21 +0100 Subject: [PATCH 315/459] Pylons only add weight while running --- src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 1c6e9948..528a42a6 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -100,11 +100,8 @@ private boolean skyView() { private ItemMap getCurrentOutput() { int weight = 0; for(FurnCraftChestFactory f : FurnCraftChestFactory.getPylonFactories()) { - for(IRecipe rec : f.getRecipes()) { - if (rec instanceof PylonRecipe) { - weight += ((PylonRecipe) rec).getWeight(); - break; - } + if (f.isActive() && f.getCurrentRecipe() instanceof PylonRecipe) { + weight += ((PylonRecipe) f.getCurrentRecipe()).getWeight(); } } currentGlobalWeight = weight; From 4b0dcb9bde6063426ccdf46b63a933724ec5c521 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 26 Mar 2016 12:14:43 +0000 Subject: [PATCH 316/459] Capitalised 'Compacted Item' --- configCivcraft.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 84bbf5f1..3987c206 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2290,12 +2290,12 @@ recipes: type: DECOMPACT name: De-compact Stack production_time: 1s - compact_lore: Compacted item + compact_lore: Compacted Item De-compact_Stack_Basic: type: DECOMPACT name: De-compact Stack production_time: 5s - compact_lore: Compacted item + compact_lore: Compacted Item Dye_Wool_to_Green_Wool: type: PRODUCTION name: Dye Wool to Green Wool @@ -3050,7 +3050,7 @@ recipes: amount: 18 Mutate_random_sapling: type: RANDOM - name: Mutate random sapling + name: Mutate Random Sapling production_time: 10s input: sapling: @@ -3134,7 +3134,7 @@ recipes: amount: 1 Mutate_random_leaves: type: RANDOM - name: Mutate random leaves + name: Mutate Random Leaves production_time: 10s input: sapling: @@ -4664,12 +4664,12 @@ recipes: material: GLASS amount: 8 lore: - - Compacted item + - Compacted Item netherquartzore: material: QUARTZ_ORE amount: 10 lore: - - Compacted item + - Compacted Item Upgrade_to_Advanced_Pylon: type: UPGRADE name: Upgrade to Advanced Pylon @@ -4693,12 +4693,12 @@ recipes: material: GLASS amount: 32 lore: - - Compacted item + - Compacted Item netherquartzore: material: QUARTZ_ORE amount: 20 lore: - - Compacted item + - Compacted Item emerald: material: EMERALD_BLOCK amount: 42 @@ -4706,13 +4706,13 @@ recipes: material: STONE amount: 32 lore: - - Compacted item + - Compacted Item compactedlogs: material: LOG amount: 32 durability: -1 lore: - - Compacted item + - Compacted Item Upgrade_to_Expert_Pylon: type: UPGRADE name: Upgrade to Expert Pylon @@ -4736,58 +4736,58 @@ recipes: material: GLASS amount: 64 lore: - - Compacted item + - Compacted Item netherquartzore: material: QUARTZ_ORE amount: 48 lore: - - Compacted item + - Compacted Item emerald: material: EMERALD_BLOCK amount: 16 lore: - - Compacted item + - Compacted Item compactedstone: material: STONE amount: 512 lore: - - Compacted item + - Compacted Item compactedlogs1: material: LOG amount: 10 durability: 0 lore: - - Compacted item + - Compacted Item compactedlogs2: material: LOG amount: 10 durability: 1 lore: - - Compacted item + - Compacted Item compactedlogs3: material: LOG amount: 10 durability: 2 lore: - - Compacted item + - Compacted Item compactedlogs4: material: LOG amount: 10 durability: 3 lore: - - Compacted item + - Compacted Item compactedlogs5: material: LOG_2 amount: 10 durability: 0 lore: - - Compacted item + - Compacted Item compactedlogs6: material: LOG_2 amount: 10 durability: 1 lore: - - Compacted item + - Compacted Item #XP recipes Produce_Potash_Enrichement: From e240cedc44f47becba5055f249fe2e7b0203ed17 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 15:32:24 +0100 Subject: [PATCH 317/459] Fix issue with unloaded chests across chunkborders --- .../igotyou/FactoryMod/factories/Sorter.java | 5 ++++ .../structures/FurnCraftChestStructure.java | 29 ++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 7b228356..555dea46 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -173,6 +173,11 @@ public void sortStack() { int leftToSort = sortAmount; for (BlockFace bf : MultiBlockStructure.allBlockSides) { if (center.getRelative(bf).getState() instanceof InventoryHolder) { + Block b = center.getRelative(bf); + if (b.getType() == Material.CHEST || b.getType() == Material.TRAPPED_CHEST) { + //load adjacent chunk for double chest + MultiBlockStructure.getAdjacentBlocks(b); + } Inventory relInv = ((InventoryHolder) center.getRelative(bf) .getState()).getInventory(); ItemMap im = assignedMaterials.get(bf); diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index 7c5cca21..fc765d7a 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -29,32 +29,38 @@ public FurnCraftChestStructure(Block center) { case SOUTH: if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.NORTH).getLocation(); + furnace = center.getRelative(BlockFace.NORTH) + .getLocation(); } case NORTH: if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.SOUTH).getLocation(); + furnace = center.getRelative(BlockFace.SOUTH) + .getLocation(); } case WEST: if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.EAST).getLocation(); + furnace = center.getRelative(BlockFace.EAST) + .getLocation(); } case EAST: if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.WEST).getLocation(); + furnace = center.getRelative(BlockFace.WEST) + .getLocation(); } case UP: if (center.getRelative(BlockFace.DOWN).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.DOWN).getLocation(); + furnace = center.getRelative(BlockFace.DOWN) + .getLocation(); } case DOWN: if (center.getRelative(BlockFace.UP).getType() == Material.FURNACE) { chest = b.getLocation(); - furnace = center.getRelative(BlockFace.UP).getLocation(); + furnace = center.getRelative(BlockFace.UP) + .getLocation(); } } @@ -71,8 +77,10 @@ public void recheckComplete() { complete = craftingTable != null && craftingTable.getBlock().getType() == Material.WORKBENCH && furnace != null - && (furnace.getBlock().getType() == Material.FURNACE || furnace.getBlock().getType() == Material.BURNING_FURNACE) - && chest != null && chest.getBlock().getType() == Material.CHEST; + && (furnace.getBlock().getType() == Material.FURNACE || furnace + .getBlock().getType() == Material.BURNING_FURNACE) + && chest != null + && chest.getBlock().getType() == Material.CHEST; } public FurnCraftChestStructure(List blocks) { @@ -94,6 +102,11 @@ public Block getFurnace() { } public Block getChest() { + // sometimes a double chest will go across chunk borders and the other + // half of the chest might be unloaded. To load the other half and the + // full inventory this is needed to load the chunk + MultiBlockStructure.searchForBlockOnAllSides(chest.getBlock(), + Material.CHEST); return chest.getBlock(); } From da51d3d1fae4d9a1d9c3a7c11fd2f77720d0f9fe Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 18:56:45 +0100 Subject: [PATCH 318/459] Fix names for pylon repair recipes --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 3987c206..0cc336ec 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4996,7 +4996,7 @@ recipes: health_gained: 1000 Repair_Advanced_Pylon: type: REPAIR - name: Repair Basic Pylon + name: Repair Advanced Pylon production_time: 10s input: xp: @@ -5005,7 +5005,7 @@ recipes: health_gained: 1000 Repair_Expert_Pylon: type: REPAIR - name: Repair Basic Pylon + name: Repair Expert Pylon production_time: 10s input: xp: From 70876d4691db776677c5e28fd0e13d5decc14769 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 26 Mar 2016 21:24:04 +0100 Subject: [PATCH 319/459] Shift clicking chest inventory should now fit and properly build up --- pom.xml | 2 +- .../FurnCraftChestInteractionManager.java | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index a80ad8fb..c8ffd9d9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.0.9 + 2.1.0 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 8ab2c515..30f67cf8 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,6 +1,7 @@ package com.github.igotyou.FactoryMod.interactionManager; import java.util.HashMap; +import java.util.List; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -13,6 +14,7 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; @@ -109,8 +111,12 @@ public void leftClick(Player p, Block b, BlockFace bf) { ClickableInventory ci = new ClickableInventory(54, fccf .getCurrentRecipe().getRecipeName()); int index = 4; - for (ItemStack is : ((InputRecipe) fccf.getCurrentRecipe()) - .getInputRepresentation(fccf.getInventory())) { + List inp = ((InputRecipe) fccf.getCurrentRecipe()) + .getInputRepresentation(fccf.getInventory()); + if (inp.size() > 18) { + inp = new ItemMap(inp).getLoredItemCountRepresentation(); + } + for (ItemStack is : inp) { Clickable c = new Clickable(is) { @Override public void clicked(Player arg0) { @@ -127,7 +133,7 @@ public void clicked(Player arg0) { index -= (((index % 9) - 4) * 2); } else { if ((index % 9) == 0) { - index += 9; + index += 13; } else { index += (((4 - (index % 9)) * 2) + 1); } @@ -135,8 +141,12 @@ public void clicked(Player arg0) { } index = 49; - for (ItemStack is : ((InputRecipe) fccf.getCurrentRecipe()) - .getOutputRepresentation(fccf.getInventory())) { + List outp = ((InputRecipe) fccf.getCurrentRecipe()) + .getOutputRepresentation(fccf.getInventory()); + if (outp.size() > 18) { + outp = new ItemMap(outp).getLoredItemCountRepresentation(); + } + for (ItemStack is : outp) { Clickable c = new Clickable(is) { @Override public void clicked(Player arg0) { @@ -152,7 +162,7 @@ public void clicked(Player arg0) { index -= (((index % 9) - 4) * 2); } else { if ((index % 9) == 0) { - index -= 9; + index -= 13; } else { index += (((4 - (index % 9)) * 2) + 1); } From b02a8d2758312692eb922e5ea7aafd1968dbfebc Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 27 Mar 2016 00:29:27 +0000 Subject: [PATCH 320/459] Added Dowsing Factory + Pylon Locator Recipe --- configCivcraft.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 0cc336ec..1a50eb97 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -598,6 +598,7 @@ factories: - Repair_Factory - Upgrade_to_Redstone_Circularity_Factory - Upgrade_to_Redstone_Mechanics_Factory + - Upgrade_to_Dowsing_Factory redstonecircularityfactory: type: FCCUPGRADE name: Redstone Circularity Factory @@ -653,7 +654,7 @@ factories: type: FCCUPGRADE name: Expert Pylon recipes: - - Pylon_Expert + - Pylon_Expert - Repair_Expert_Pylon crystallizationfactory: type: FCCUPGRADE @@ -662,6 +663,12 @@ factories: - Pack_Snow_To_Ice - Compress_Ice_To_Packed_Ice - Repair_Factory + dowsingfactory: + type: FCCUPGRADE + name: Dowsing Factory + recipes: + - Create_Pylon_Locator + - Repair_Advanced_Factory #Pipes normalpipe: @@ -5867,3 +5874,24 @@ recipes: amount: 64 lore: - Crate + Create_Pylon_Locator + name: Create Pylon Locator + type: PRODUCTION + production_time: 20s + input: + compass: + material: COMPASS + amount: 1 + xp: + material: EMERALD_BLOCK + amount: 150 + output: + basiccompass: + material: COMPASS + amount: 1 + lore: + - Shows all Active, + - Inactive and Upgrading Pylons + enchants: + dura: + enchant: DURABILITY From f5acb497acc6931afb87ba79bb059526b696e92c Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 27 Mar 2016 00:46:43 +0000 Subject: [PATCH 321/459] Changes --- configCivcraft.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 1a50eb97..eef75a45 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4795,7 +4795,22 @@ recipes: durability: 1 lore: - Compacted Item - + Upgrade_to_Dowsing_Factory + type: UPGRADE + name: Upgrade to Dowsing Factory + production_time: 8hr + fuel_consumption_intervall: 5m + factory: Dowsing Factory + input: + redstoneblocks: + material: REDSTONE_BLOCK + amount: 32 + compass: + material: COMPASS + amount: 1 + xp: + material: EMERALD_BLOCK + amount: 256 #XP recipes Produce_Potash_Enrichement: name: Produce Potash Enrichment @@ -5874,10 +5889,11 @@ recipes: amount: 64 lore: - Crate - Create_Pylon_Locator + Create_Pylon_Locator: name: Create Pylon Locator type: PRODUCTION - production_time: 20s + production_time: 1d + fuel_consumption_intervall: 15m input: compass: material: COMPASS @@ -5890,8 +5906,7 @@ recipes: material: COMPASS amount: 1 lore: - - Shows all Active, - - Inactive and Upgrading Pylons + - Shows all Active, Inactive and Upgrading Pylons enchants: dura: enchant: DURABILITY From be093ef8b52807f5e88bdd752f144eefcc642b8a Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 27 Mar 2016 00:48:11 +0000 Subject: [PATCH 322/459] Lore change so it fits --- configCivcraft.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index eef75a45..23c27f49 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5906,7 +5906,8 @@ recipes: material: COMPASS amount: 1 lore: - - Shows all Active, Inactive and Upgrading Pylons + - Shows all Active, + - Inactive and Upgrading Pylons enchants: dura: enchant: DURABILITY From 5916c07bdf70e9c15fa8c42395c1d5ece631f3d6 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 27 Mar 2016 02:17:10 +0100 Subject: [PATCH 323/459] Buffed upgrade cost for Dowsing Factory --- configCivcraft.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 23c27f49..4017eeed 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4804,13 +4804,16 @@ recipes: input: redstoneblocks: material: REDSTONE_BLOCK - amount: 32 + amount: 64 compass: material: COMPASS amount: 1 + map: + material: MAP + amount: 1 xp: material: EMERALD_BLOCK - amount: 256 + amount: 512 #XP recipes Produce_Potash_Enrichement: name: Produce Potash Enrichment From 90eb45175ff3b98572d54eaa265c17f16dd35c1e Mon Sep 17 00:00:00 2001 From: PatchyKnowly Date: Sun, 27 Mar 2016 12:13:19 +0100 Subject: [PATCH 324/459] fix fancy stone ratios currently the recipes for andesite/diorite/granite cost you 5 charcoal to get you half the output you'd get from crafting a stack manually this buffs the recipes from 50% to 140% output and reduces the coal cost by 1 (1 coal to 24 output) to bring them in-line with the factory's cobble->stone recipe, which seems fair as they're only decorative blocks in the first place. --- configCivcraft.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 4017eeed..5e2e6987 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1520,7 +1520,7 @@ recipes: Craft_Polished_Andesite: type: PRODUCTION name: Craft Polished Andesite - production_time: 10s + production_time: 8s input: andesite: material: STONE @@ -1530,11 +1530,11 @@ recipes: polished andesite: material: STONE durability: 6 - amount: 32 + amount: 88 Craft_Polished_Diorite: type: PRODUCTION name: Craft Polished Diorite - production_time: 10s + production_time: 8s input: andesite: material: STONE @@ -1544,11 +1544,11 @@ recipes: polished andesite: material: STONE durability: 4 - amount: 32 + amount: 88 Craft_Polished_Granite: type: PRODUCTION name: Craft Polished Granite - production_time: 10s + production_time: 8s input: andesite: material: STONE @@ -1558,7 +1558,7 @@ recipes: polished andesite: material: STONE durability: 2 - amount: 32 + amount: 88 Craft_Prismarine_Basic: type: PRODUCTION name: Craft Prismarine From 07cad3793de6078634a70e67478ae45b1f2ffc29 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 27 Mar 2016 19:30:47 +0100 Subject: [PATCH 325/459] Fix to a bunch of issues --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 5e2e6987..dbd9f2a8 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4795,10 +4795,10 @@ recipes: durability: 1 lore: - Compacted Item - Upgrade_to_Dowsing_Factory + Upgrade_to_Dowsing_Factory: type: UPGRADE name: Upgrade to Dowsing Factory - production_time: 8hr + production_time: 8h fuel_consumption_intervall: 5m factory: Dowsing Factory input: From 5b923a22a258ea9e1e6681063b65750417b20d44 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 27 Mar 2016 23:46:15 +0200 Subject: [PATCH 326/459] Remove previously existing factory for fmc --- .../github/igotyou/FactoryMod/commands/commands/Create.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Create.java b/src/com/github/igotyou/FactoryMod/commands/commands/Create.java index 9d9d999c..f12d4713 100644 --- a/src/com/github/igotyou/FactoryMod/commands/commands/Create.java +++ b/src/com/github/igotyou/FactoryMod/commands/commands/Create.java @@ -19,6 +19,7 @@ import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; import com.github.igotyou.FactoryMod.eggs.PipeEgg; import com.github.igotyou.FactoryMod.eggs.SorterEgg; +import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; @@ -61,6 +62,10 @@ public boolean execute(CommandSender sender, String[] args) { } Set transparent = null; List view = ((Player) sender).getLineOfSight(transparent, 10); + Factory exis = manager.getFactoryAt(view.get(view.size() - 1)); + if (exis != null) { + manager.removeFactory(exis); + } if (egg instanceof FurnCraftChestEgg) { FurnCraftChestEgg fcce = (FurnCraftChestEgg) egg; if (view.get(view.size() - 1).getType() == Material.WORKBENCH) { From 9ac2ca9360ee1c7ddd6947b69e0948e8fcb6ded1 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Mon, 28 Mar 2016 16:53:44 +0100 Subject: [PATCH 327/459] Added Easter, Diet's Repair Changes + Expert Pylon Upgrade nerf --- configCivcraft.yml | 229 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 187 insertions(+), 42 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index dbd9f2a8..67baf55c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,7 @@ factories: - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic - Burn_Charcoal_from_Logs_Basic + - Break_Easter_Egg - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory @@ -725,70 +726,85 @@ recipes: name: Repair Factory production_time: 60s input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 1 +# eye of ender: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY +# amount: 1 + emerald: + material: EMERALD + amount: 1 health_gained: 1500 Repair_Small_Factory: type: REPAIR name: Repair Factory production_time: 30s input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 1 +# eye of ender: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY +# amount: 1 + emerald: + material: EMERALD + amount: 3 health_gained: 800 Repair_Factory: type: REPAIR name: Repair Factory production_time: 30s input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 1 +# eye of ender: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY +# amount: 1 + emeraldblock: + material: EMERALD_BLOCK + amount: 1 health_gained: 350 Repair_Advanced_Factory: type: REPAIR name: Repair Advanced Factory production_time: 15s input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 1 +# eye of ender: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY +# amount: 1 + emeraldblock: + material: EMERALD_BLOCK + amount: 3 health_gained: 225 Repair_Expert_Factory: type: REPAIR - name: Repair Advanced Factory + name: Repair Expert Factory production_time: 10s input: - eye of ender: - material: EYE_OF_ENDER - lore: - - Essence - enchants: - dura: - enchant: DURABILITY - amount: 1 +# eye of ender: +# material: EYE_OF_ENDER +# lore: +# - Essence +# enchants: +# dura: +# enchant: DURABILITY +# amount: 1 + emeraldblock: + material: EMERALD_BLOCK + amount: 5 health_gained: 65 Bake_Bread_Advanced: type: PRODUCTION @@ -4751,7 +4767,7 @@ recipes: - Compacted Item emerald: material: EMERALD_BLOCK - amount: 16 + amount: 9 lore: - Compacted Item compactedstone: @@ -5914,3 +5930,132 @@ recipes: enchants: dura: enchant: DURABILITY + Break_Easter_Egg: + name: Break Easter Egg + type: RANDOM + production_time: 16s + input: + easteregg: + material: EGG + amount: 1 + lore: + - '[Easter Egg]' + enchants: + dura: + enchant: DURABILITY + outputs: + 1: + chance: 0.1 + badegg1: + material: DIRT + amount: 5 + 2: + chance: 0.1 + badegg2: + material: GRAVEL + amount: 5 + 3: + chance: 0.1 + badegg3: + material: COAL + amount: 5 + 4: + chance: 0.1 + badegg4: + material: DEAD_BUSH + amount: 5 + 5: + chance: 0.05 + badegg5: + material: BROWN_MUSHROOM + amount: 10 + 55: + chance: 0.05 + badegg6: + material: RED_MUSHROOM + amount: 10 + 6: + chance: 0.1 + goodegg1: + material: EGG + amount: 1 + lore: + - Goldinegg + enchants: + dura: + enchant: DURABILITY + 7: + chance: 0.1 + goodegg2: + material: DIAMOND + amount: 1 + 8: + chance: 0.1 + goodegg3: + material: CAKE + amount: 1 + 9: + chance: 0.1 + goodegg4: + material: GOLDEN_APPLE + amount: 1 + 10: + chance: 0.0175 + record1: + material: GOLD_RECORD + amount: 1 + 11: + chance: 0.0075 + record2: + material: GREEN_RECORD + amount: 1 + 12: + chance: 0.0075 + record3: + material: RECORD_3 + amount: 1 + 13: + chance: 0.0075 + record4: + material: RECORD_4 + amount: 1 + 14: + chance: 0.0075 + record5: + material: RECORD_5 + amount: 1 + 15: + chance: 0.0075 + record6: + material: RECORD_6 + amount: 1 + 16: + chance: 0.0075 + record7: + material: RECORD_7 + amount: 1 + 17: + chance: 0.0075 + record8: + material: RECORD_8 + amount: 1 + 18: + chance: 0.0075 + record9: + material: RECORD_9 + amount: 1 + 19: + chance: 0.0075 + record10: + material: RECORD_10 + amount: 1 + 20: + chance: 0.0075 + record11: + material: RECORD_11 + amount: 1 + 21: + chance: 0.0075 + record12: + material: RECORD_12 + amount: 1 From bc1b751668bd6fff12de3f7f46be1499a82ddf73 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Mon, 28 Mar 2016 16:58:53 +0100 Subject: [PATCH 328/459] Shortened easter egg break time + Very rare chance of Bastion --- configCivcraft.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 67baf55c..96aa0973 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5933,7 +5933,7 @@ recipes: Break_Easter_Egg: name: Break Easter Egg type: RANDOM - production_time: 16s + production_time: 5s input: easteregg: material: EGG @@ -6055,7 +6055,12 @@ recipes: material: RECORD_11 amount: 1 21: - chance: 0.0075 + chance: 0.0065 record12: material: RECORD_12 amount: 1 + 22: + chance: 0.001 + bastion: + material: SPONGE + amount: 1 From 70431e7ea6379a9e6270cb0c65f6b74c822e2b0d Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Mon, 28 Mar 2016 18:41:17 +0100 Subject: [PATCH 329/459] woopsies --- configCivcraft.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 96aa0973..283d5eac 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5943,6 +5943,7 @@ recipes: enchants: dura: enchant: DURABILITY + level: 0 outputs: 1: chance: 0.1 From 5e2de99100adbcfdbb7798d4037701481e1572b8 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 28 Mar 2016 22:55:57 +0200 Subject: [PATCH 330/459] Add runnable to save factory data on a regular base --- config.yml | 3 +++ src/com/github/igotyou/FactoryMod/ConfigParser.java | 11 +++++++++++ .../igotyou/FactoryMod/utility/FileHandler.java | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 9f580466..2598bb7f 100644 --- a/config.yml +++ b/config.yml @@ -159,6 +159,9 @@ decay_amount: 21 #Whether the yaml identifier or the factory name should be used when assigning recipes to factories, default to false use_recipe_yamlidentifiers: false +#How often factory data is saved automatically. Recommended value and default is 15 minutes. Set to -1 to disable +saving_intervall: 15m + #---------------------------------------------------------------------------------------------------------------------- #Factories diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 1bf46a89..12a939e2 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -9,6 +9,7 @@ import java.util.Map; import java.util.Map.Entry; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; @@ -101,6 +102,16 @@ public FactoryModManager parse() { int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); long gracePeriod = 50 * parseTime(config .getString("break_grace_period")); + long savingIntervall = parseTime(config.getString("saving_intervall", "15m")); + //save factories on a regular base, unless disabled + if (savingIntervall != -1) { + Bukkit.getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() { + @Override + public void run() { + FactoryMod.getManager().saveFactories(); + } + }, savingIntervall, savingIntervall); + } defaultMenuFactory = config.getString("default_menu_factory"); int globalPylonLimit = config.getInt("global_pylon_limit"); PylonRecipe.setGlobalLimit(globalPylonLimit); diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index e03ababc..e566877c 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -12,7 +12,6 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; @@ -37,8 +36,8 @@ public class FileHandler { private FactoryMod plugin; private FactoryModManager manager; - File saveFile; - File backup; + private File saveFile; + private File backup; public FileHandler(FactoryModManager manager) { plugin = FactoryMod.getPlugin(); From e08fa0a0f397e1f928fbb10323d7433c963b2bfd Mon Sep 17 00:00:00 2001 From: maxopoly Date: Tue, 29 Mar 2016 01:22:33 +0200 Subject: [PATCH 331/459] Dont compact entire chests at once and minor improvements --- .../igotyou/FactoryMod/recipes/CompactingRecipe.java | 10 ++++------ .../github/igotyou/FactoryMod/utility/FileHandler.java | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 13b6789b..42f0669e 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -59,13 +59,10 @@ public void applyEffect(Inventory i, Factory f) { for (ItemStack is : i.getContents()) { if (is != null) { if (compactable(is)) { - List loreList = new LinkedList(); - loreList.add(compactedLore); - for (ItemStack toRemove : input - .getItemStackRepresentation()) { - i.removeItem(toRemove); + if (input.removeSafelyFrom(i)) { + compact(is); } - compact(is); + break; } } } @@ -78,6 +75,7 @@ public List getInputRepresentation(Inventory i) { List result = new LinkedList(); if (i == null) { result.add(new ItemStack(Material.STONE, 64)); + result.addAll(input.getItemStackRepresentation()); return result; } result = createLoredStacksForInfo(i); diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index e566877c..377cc973 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -111,6 +111,7 @@ public void save(Collection factories) { } } config.save(saveFile); + plugin.info("Successfully saved factory data"); } catch (Exception e) { // In case anything goes wrong while saving we always keep the // latest valid backup From 11c20c0484ed3a057f5cb4d9978009d9a373f12e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Tue, 5 Apr 2016 20:35:08 +0100 Subject: [PATCH 332/459] Made repairs easy for Civtemp + Removed break easter Egg --- configCivcraft.yml | 146 ++------------------------------------------- 1 file changed, 5 insertions(+), 141 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 283d5eac..67019487 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,7 +35,6 @@ factories: - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic - Burn_Charcoal_from_Logs_Basic - - Break_Easter_Egg - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory @@ -735,7 +734,7 @@ recipes: # enchant: DURABILITY # amount: 1 emerald: - material: EMERALD + material: DIRT amount: 1 health_gained: 1500 Repair_Small_Factory: @@ -752,7 +751,7 @@ recipes: # enchant: DURABILITY # amount: 1 emerald: - material: EMERALD + material: DIRT amount: 3 health_gained: 800 Repair_Factory: @@ -769,7 +768,7 @@ recipes: # enchant: DURABILITY # amount: 1 emeraldblock: - material: EMERALD_BLOCK + material: DIRT amount: 1 health_gained: 350 Repair_Advanced_Factory: @@ -786,7 +785,7 @@ recipes: # enchant: DURABILITY # amount: 1 emeraldblock: - material: EMERALD_BLOCK + material: DIRT amount: 3 health_gained: 225 Repair_Expert_Factory: @@ -803,7 +802,7 @@ recipes: # enchant: DURABILITY # amount: 1 emeraldblock: - material: EMERALD_BLOCK + material: DIRT amount: 5 health_gained: 65 Bake_Bread_Advanced: @@ -5930,138 +5929,3 @@ recipes: enchants: dura: enchant: DURABILITY - Break_Easter_Egg: - name: Break Easter Egg - type: RANDOM - production_time: 5s - input: - easteregg: - material: EGG - amount: 1 - lore: - - '[Easter Egg]' - enchants: - dura: - enchant: DURABILITY - level: 0 - outputs: - 1: - chance: 0.1 - badegg1: - material: DIRT - amount: 5 - 2: - chance: 0.1 - badegg2: - material: GRAVEL - amount: 5 - 3: - chance: 0.1 - badegg3: - material: COAL - amount: 5 - 4: - chance: 0.1 - badegg4: - material: DEAD_BUSH - amount: 5 - 5: - chance: 0.05 - badegg5: - material: BROWN_MUSHROOM - amount: 10 - 55: - chance: 0.05 - badegg6: - material: RED_MUSHROOM - amount: 10 - 6: - chance: 0.1 - goodegg1: - material: EGG - amount: 1 - lore: - - Goldinegg - enchants: - dura: - enchant: DURABILITY - 7: - chance: 0.1 - goodegg2: - material: DIAMOND - amount: 1 - 8: - chance: 0.1 - goodegg3: - material: CAKE - amount: 1 - 9: - chance: 0.1 - goodegg4: - material: GOLDEN_APPLE - amount: 1 - 10: - chance: 0.0175 - record1: - material: GOLD_RECORD - amount: 1 - 11: - chance: 0.0075 - record2: - material: GREEN_RECORD - amount: 1 - 12: - chance: 0.0075 - record3: - material: RECORD_3 - amount: 1 - 13: - chance: 0.0075 - record4: - material: RECORD_4 - amount: 1 - 14: - chance: 0.0075 - record5: - material: RECORD_5 - amount: 1 - 15: - chance: 0.0075 - record6: - material: RECORD_6 - amount: 1 - 16: - chance: 0.0075 - record7: - material: RECORD_7 - amount: 1 - 17: - chance: 0.0075 - record8: - material: RECORD_8 - amount: 1 - 18: - chance: 0.0075 - record9: - material: RECORD_9 - amount: 1 - 19: - chance: 0.0075 - record10: - material: RECORD_10 - amount: 1 - 20: - chance: 0.0075 - record11: - material: RECORD_11 - amount: 1 - 21: - chance: 0.0065 - record12: - material: RECORD_12 - amount: 1 - 22: - chance: 0.001 - bastion: - material: SPONGE - amount: 1 From 6f1af0953a6019b1aff60a77987d41e98289f5a8 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Wed, 6 Apr 2016 20:41:03 +0200 Subject: [PATCH 333/459] Add repair recipe to emerald extractor --- configCivcraft.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 67019487..6b6e78ce 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -636,6 +636,7 @@ factories: - Produce_Potash_Enrichement - Produce_Vitamin_Enrichment - Produce_Nether_Enrichement + - Repair_Expert_Factory basicpylon: type: FCCUPGRADE name: Basic Pylon From 024c4abcccdff0c8cedc37e1b87ce7f1d7167934 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Wed, 6 Apr 2016 23:31:29 +0100 Subject: [PATCH 334/459] adding repair recipe to soup kitchen --- configCivcraft.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 6b6e78ce..76da5332 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -341,6 +341,7 @@ factories: - Make_Rabbit_Stew - Make_Mushroom_Stew - Brew_Soup_Concentrate + - Repair_Factory animalhusbandryfactorybasic: type: FCCUPGRADE name: Animal Husbandry Factory Basic From 6a299491b1f5d202bbd1943b1a44ef31663e44f1 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Thu, 7 Apr 2016 14:47:42 +0100 Subject: [PATCH 335/459] Aether less plentiful, xp recipes more balanced, expert pylon creation more balanced --- configCivcraft.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 76da5332..5cfcf111 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4630,7 +4630,7 @@ recipes: amount: 256 aether: material: GOLD_NUGGET - amount: 512 + amount: 192 lore: - Aether enchants: @@ -4746,16 +4746,16 @@ recipes: input: poisonouspotatoes: material: POISONOUS_POTATO - amount: 64 + amount: 128 enderchests: material: ENDER_CHEST - amount: 32 + amount: 64 diamondblocks: material: DIAMOND_BLOCK - amount: 16 + amount: 32 goldenapples: material: GOLDEN_APPLE - amount: 64 + amount: 256 compactedglass: material: GLASS amount: 64 @@ -4763,12 +4763,12 @@ recipes: - Compacted Item netherquartzore: material: QUARTZ_ORE - amount: 48 + amount: 32 lore: - Compacted Item emerald: material: EMERALD_BLOCK - amount: 9 + amount: 12 lore: - Compacted Item compactedstone: @@ -4839,7 +4839,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 128 + amount: 48 lore: - Aether enchants: @@ -4885,7 +4885,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 128 + amount: 48 lore: - Aether enchants: @@ -4900,7 +4900,8 @@ recipes: # enchant: DURABILITY carrots: material: CARROT_ITEM - amount: 256 + amount: 12 + lore: Compacted Item cocoa: material: INK_SACK amount: 92 @@ -4933,7 +4934,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 128 + amount: 48 lore: - Aether enchants: @@ -4985,7 +4986,7 @@ recipes: output: aether: material: GOLD_NUGGET - amount: 10 + amount: 3 lore: - Aether enchants: @@ -5001,7 +5002,7 @@ recipes: output: aether: material: GOLD_NUGGET - amount: 14 + amount: 5 lore: - Aether enchants: @@ -5017,7 +5018,7 @@ recipes: output: aether: material: GOLD_NUGGET - amount: 20 + amount: 7 lore: - Aether enchants: From 29a852d8e8feb0b732c87762dc89960776f12520 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Thu, 7 Apr 2016 16:15:11 +0100 Subject: [PATCH 336/459] Yay --- configCivcraft.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 5cfcf111..0b834082 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4752,7 +4752,7 @@ recipes: amount: 64 diamondblocks: material: DIAMOND_BLOCK - amount: 32 + amount: 16 goldenapples: material: GOLDEN_APPLE amount: 256 @@ -4839,7 +4839,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 48 + amount: 64 lore: - Aether enchants: @@ -4885,7 +4885,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 48 + amount: 64 lore: - Aether enchants: @@ -4901,7 +4901,8 @@ recipes: carrots: material: CARROT_ITEM amount: 12 - lore: Compacted Item + lore: + - Compacted Item cocoa: material: INK_SACK amount: 92 @@ -4934,7 +4935,7 @@ recipes: input: aether: material: GOLD_NUGGET - amount: 48 + amount: 64 lore: - Aether enchants: @@ -4980,13 +4981,13 @@ recipes: Pylon_Basic: name: Extract Aether type: PYLON - production_time: 2h + production_time: 4h fuel_consumption_intervall: 6m input: output: aether: material: GOLD_NUGGET - amount: 3 + amount: 10 lore: - Aether enchants: @@ -4997,12 +4998,12 @@ recipes: name: Extract Aether type: PYLON fuel_consumption_intervall: 6m - production_time: 1h + production_time: 2h input: output: aether: material: GOLD_NUGGET - amount: 5 + amount: 14 lore: - Aether enchants: @@ -5013,12 +5014,12 @@ recipes: name: Extract Aether type: PYLON fuel_consumption_intervall: 6m - production_time: 1h + production_time: 2h input: output: aether: material: GOLD_NUGGET - amount: 7 + amount: 20 lore: - Aether enchants: From f58c6c03987c9f1ac71f83679827f5209030f433 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Thu, 7 Apr 2016 16:16:47 +0100 Subject: [PATCH 337/459] Yay again --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 0b834082..0eb1ad97 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -4630,7 +4630,7 @@ recipes: amount: 256 aether: material: GOLD_NUGGET - amount: 192 + amount: 256 lore: - Aether enchants: From d705c501083022e8197ed4f35ed1dfb2fd604986 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 8 Apr 2016 02:32:23 +0200 Subject: [PATCH 338/459] Prevent pylon recipe from crashing gui if no factories exist on the map --- .../FactoryMod/recipes/PylonRecipe.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 528a42a6..9e984010 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -3,6 +3,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; +import java.util.Set; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -43,11 +44,11 @@ public void applyEffect(Inventory i, Factory f) { } } } - + public static void setGlobalLimit(int limit) { globalLimit = limit; } - + public static int getGlobalLimit() { return globalLimit; } @@ -99,13 +100,19 @@ private boolean skyView() { private ItemMap getCurrentOutput() { int weight = 0; - for(FurnCraftChestFactory f : FurnCraftChestFactory.getPylonFactories()) { - if (f.isActive() && f.getCurrentRecipe() instanceof PylonRecipe) { - weight += ((PylonRecipe) f.getCurrentRecipe()).getWeight(); + Set pylons = FurnCraftChestFactory + .getPylonFactories(); + if (pylons != null) { + //if not a single factory (not limited to pylon) is in the map, this will be null + for (FurnCraftChestFactory f : pylons) { + if (f.isActive() && f.getCurrentRecipe() instanceof PylonRecipe) { + weight += ((PylonRecipe) f.getCurrentRecipe()).getWeight(); + } } } currentGlobalWeight = weight; - double overload = Math.max(1.0, (float) currentGlobalWeight / (float)globalLimit); + double overload = Math.max(1.0, (float) currentGlobalWeight + / (float) globalLimit); double multiplier = 1.0 / overload; ItemMap actualOutput = new ItemMap(); for (Entry entry : output.getEntrySet()) { From bc4c1efa636c924ca3656b87bf5cd1e10f3fe24e Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 8 Apr 2016 02:35:47 +0200 Subject: [PATCH 339/459] Prevent further repairing if factory is at full health --- .../FactoryMod/factories/FurnCraftChestFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index fd02e2df..eb6ecc98 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -121,8 +121,8 @@ public void attemptToActivate(Player p) { && rm.atFullHealth()) { if (p != null) { p.sendMessage("This factory is already at full health!"); - return; } + return; } FactoryActivateEvent fae = new FactoryActivateEvent(this, p); Bukkit.getPluginManager().callEvent(fae); @@ -305,6 +305,13 @@ else if (currentProductionTimer >= currentRecipe runCount.get(currentRecipe) + 1); } currentProductionTimer = 0; + if (currentRecipe instanceof RepairRecipe + && rm.atFullHealth()) { + //already at full health, dont try to repair further + sendActivatorMessage(ChatColor.GOLD + name + " repaired to full health"); + deactivate(); + return; + } if (hasInputMaterials() && pm.powerAvailable()) { pm.setPowerCounter(0); scheduleUpdate(); From ddb30bb01c152409130c772551055542ead4b51b Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 8 Apr 2016 02:38:28 +0200 Subject: [PATCH 340/459] Removed unused class --- .../factories/FurnCraftChestFactory.java | 1 - .../FactoryMod/utility/StringUtils.java | 67 ------------------- 2 files changed, 68 deletions(-) delete mode 100644 src/com/github/igotyou/FactoryMod/utility/StringUtils.java diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index eb6ecc98..00aa598a 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -100,7 +100,6 @@ public FurnaceInventory getFurnaceInventory() { public void attemptToActivate(Player p) { LoggingUtils.log((p != null ? p.getName() : "Redstone") + " is attempting to activate " + getLogData()); - // TODO Citadel stuff mbs.recheckComplete(); if (active) { diff --git a/src/com/github/igotyou/FactoryMod/utility/StringUtils.java b/src/com/github/igotyou/FactoryMod/utility/StringUtils.java deleted file mode 100644 index d97345cc..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/StringUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; - -public class StringUtils { - - /** - * Formats a Location's coordinates as "world (x y z)" - */ - public static String formatCoords(Location loc) { - return String.format("%s (%d %d %d)", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); - } - - public static List splitLines(String paragraph, int lineLength) { - List lines = new ArrayList(); - int lineStart = 0; - int lastSpace = -1; - while (true) { - int nextSpace = paragraph.indexOf(' ', lastSpace + 1); - if (nextSpace == -1) { - // End of paragraph - lines.add(paragraph.substring(lineStart, paragraph.length())); - break; - } else if (nextSpace - lineStart > lineLength) { - if (lastSpace + 1 == lineStart) { - // Block of more than lineLength without a space in it - has to be one line - lastSpace = nextSpace; - } - - // End of line at last space - lines.add(paragraph.substring(lineStart, lastSpace)); - lineStart = lastSpace + 1; - } else { - lastSpace = nextSpace; - } - } - return lines; - } - - public static String limitLengthEllipsis(String in, int lengthLimit) { - return limitLengthEllipsis(in, lengthLimit, "..."); - } - - public static String limitLengthEllipsis(String in, int lengthLimit, String ellipsisText) { - if (in.length() > lengthLimit) { - return in.substring(0, lengthLimit - ellipsisText.length()) + ellipsisText; - } else { - return in; - } - } - - public static String combineLines(List lines) { - StringBuilder sb = new StringBuilder(); - boolean firstLine = true; - for (String line : lines) { - if (firstLine) { - sb.append("\n"); - firstLine = false; - } - sb.append(line); - } - return sb.toString(); - } -} From 66accf15873c94361aef09bc25c74e1fad9ddd71 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Fri, 8 Apr 2016 03:14:15 +0200 Subject: [PATCH 341/459] Catch another gui NPE --- .../github/igotyou/FactoryMod/recipes/PylonRecipe.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 9e984010..da6a7cc1 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -58,8 +58,9 @@ public List getOutputRepresentation(Inventory i) { List res = new LinkedList(); for (ItemStack is : currOut.getItemStackRepresentation()) { ISUtils.setLore(is, ChatColor.GOLD + "Currently there are " - + FurnCraftChestFactory.getPylonFactories().size() - + " pylons on the map", ChatColor.RED + + FurnCraftChestFactory.getPylonFactories() == null ? "0" + : FurnCraftChestFactory.getPylonFactories().size() + + " pylons on the map", ChatColor.RED + "Current global weight is " + currentGlobalWeight); res.add(is); } @@ -103,7 +104,8 @@ private ItemMap getCurrentOutput() { Set pylons = FurnCraftChestFactory .getPylonFactories(); if (pylons != null) { - //if not a single factory (not limited to pylon) is in the map, this will be null + // if not a single factory (not limited to pylon) is in the map, + // this will be null for (FurnCraftChestFactory f : pylons) { if (f.isActive() && f.getCurrentRecipe() instanceof PylonRecipe) { weight += ((PylonRecipe) f.getCurrentRecipe()).getWeight(); From 7861a71685d97de7dddc92e5e53812752f22f100 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 8 Apr 2016 20:43:04 +0100 Subject: [PATCH 342/459] Added Enchanting + XP Fuck --- configCivcraft.yml | 3951 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 3676 insertions(+), 275 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 0eb1ad97..4eb23859 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -41,6 +41,8 @@ factories: - Upgrade_to_Blacksmith - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor + - Upgrade_to_Basic_Forge + - Upgrade_to_Wood_Cauldron #Smelting stonesmelter: @@ -547,12 +549,9 @@ factories: recipes: - Craft_Redstone_Repeater_Basic - Craft_Dispenser_Basic - - Enchant_Efficiency_Basic - Repair_Small_Factory - Upgrade_to_Bastion_Factory - - Upgrade_to_Emerald_Extractor - Upgrade_to_Compactor_Basic - - Upgrade_to_Enchanter_Basic - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic @@ -622,22 +621,6 @@ factories: - Craft_Droppers - Craft_Redstone_Lamps - Repair_Advanced_Factory - basicenchanter: - type: FCCUPGRADE - name: Basic Enchanter - recipes: - - Upgrade_to_Tool_Enchanter - - Upgrade_to_Weapon_Enchanter - - Upgrade_to_Armour_Enchanter - - Repair_Advanced_Factory - xpfactory: - type: FCCUPGRADE - name: Emerald Extractor - recipes: - - Produce_Potash_Enrichement - - Produce_Vitamin_Enrichment - - Produce_Nether_Enrichement - - Repair_Expert_Factory basicpylon: type: FCCUPGRADE name: Basic Pylon @@ -671,6 +654,319 @@ factories: recipes: - Create_Pylon_Locator - Repair_Advanced_Factory + +## Enchanting + basicforge: + type: FCCUPGRADE + name: Basic Forge + recipes: + - Enchant_Efficiency_Pickaxe_Basic + - Enchant_Efficiency_Axe_Basic + - Enchant_Efficiency_Shovel_Basic + - Enchant_Unbreaking_Pickaxe_Basic + - Enchant_Unbreaking_Axe_Basic + - Enchant_Unbreaking_Shovel_Basic + - Enchant_Unbreaking_Sword_Basic + - Enchant_Sharpness_Basic + - Upgrade_to_Ember_Forge + - Upgrade_to_River_Forge + - Upgrade_to_Magic_Forge + - Upgrade_to_Mithril_Forge + - Upgrade_to_Archer_Forge + - Upgrade_to_Dagger_Forge + - Upgrade_to_Quick_Forge + - Upgrade_to_Rock_Forge +#Fire + emberforge: + type: FCCUPGRADE + name: Ember Forge + recipes: + - Enchant_Helmet_FireP_I + - Enchant_Chestplate_FireP_I + - Enchant_Leggings_FireP_I + - Enchant_Boots_FireP_I + - Enchant_Helmet_FireP_II + - Enchant_Chestplate_FireP_II + - Enchant_Leggings_FireP_II + - Enchant_Boots_FireP_II + - Enchant_Helmet_FireP_III + - Enchant_Chestplate_FireP_III + - Enchant_Leggings_FireP_III + - Enchant_Boots_FireP_III + - Enchant_FireAspect_I + - Upgrade_to_Magma_Forge + magmaforge: + type: FCCUPGRADE + name: Magma Forge + recipes: + - Enchant_Helmet_FireP_IV + - Enchant_Chestplate_FireP_IV + - Enchant_Leggings_FireP_IV + - Enchant_Boots_FireP_IV + - Enchant_Helmet_FireP_V + - Enchant_Chestplate_FireP_V + - Enchant_Leggings_FireP_V + - Enchant_Boots_FireP_V + - Enchant_Helmet_FireP_VI + - Enchant_Chestplate_FireP_VI + - Enchant_Leggings_FireP_VI + - Enchant_Boots_FireP_VI + - Enchant_Flame_I + - Enchant_FireAspect_II +#Water + riverforge: + type: FCCUPGRADE + name: River Forge + recipes: + - Enchant_DepthStrider_I + - Enchant_Respiration_I + - Enchant_Respiration_II + - Upgrade_to_Ocean_Forge +# - Enchant_FrostWalker_I + oceanforge: + type:FCCUPGRADE + name: Ocean Forge + recipes: + - Enchant_DepthStrider_II + - Enchant_AquaAffinity_I + - Enchant_Respiration_III +# - Enchant_FrostWalker_II +#Magic + magicforge: + type: FCCUPGRADE + name: Magic Forge + recipes: + - Enchant_FeatherFalling_I + - Enchant_FeatherFalling_II + - Enchant_BOA_I + - Enchant_BOA_II + - Enchant_BOA_III + - Upgrade_to_Arcane_Forge + arcaneforge: + type: FCCUPGRADE + name: Arcane Forge + recipes: + - Enchant_Infinity_I + - Enchant_Pickaxe_SilkTouch_I + - Enchant_Axe_SilkTouch_I + - Enchant_Shovel_SilkTouch_I + - Enchant_Shears_SilkTouch_I + - Enchant_FeatherFalling_III + - Enchant_FeatherFalling_IV + - Enchant_BOA_IV + - Enchant_BOA_V +#Armor + mithrilforge: + type: FCCUPGRADE + name: Mithril Forge + recipes: + - Enchant_Helmet_Protection_I + - Enchant_Chestplate_Protection_I + - Enchant_Leggings_Protection_I + - Enchant_Boots_Protection_I + - Enchant_Helmet_BlastProtection_I + - Enchant_Chestplate_BlastProtection_I + - Enchant_Leggings_BlastProtection_I + - Enchant_Boots_BlastProtection_I + - Enchant_Thorns_I + - Upgrade_to_Titanium_Forge + titaniumforge: + type: FCCUPGRADE + name: Titanium Forge + recipes: + - Enchant_Helmet_Protection_II + - Enchant_Chestplate_Protection_II + - Enchant_Leggings_Protection_II + - Enchant_Boots_Protection_II + - Enchant_Helmet_Protection_III + - Enchant_Chestplate_Protection_III + - Enchant_Leggings_Protection_III + - Enchant_Boots_Protection_III + - Enchant_Helmet_BlastProtection_II + - Enchant_Chestplate_BlastProtection_II + - Enchant_Leggings_BlastProtection_II + - Enchant_Boots_BlastProtection_II + - Enchant_Helmet_BlastProtection_III + - Enchant_Chestplate_BlastProtection_III + - Enchant_Leggings_BlastProtection_III + - Enchant_Boots_BlastProtection_III + - Enchant_Thorns_II + - Upgrade_to_Molten_Forge + moltenforge: + type: FCCUPGRADE + name: Molten Forge + recipes: + - Enchant_Helmet_Protection_IV + - Enchant_Chestplate_Protection_IV + - Enchant_Leggings_Protection_IV + - Enchant_Boots_Protection_IV + - Enchant_Helmet_BlastProtection_IV + - Enchant_Chestplate_BlastProtection_IV + - Enchant_Leggings_BlastProtection_IV + - Enchant_Boots_BlastProtection_IV + - Enchant_Thorns_III +#Archery + archerforge: + type: FCCUPGRADE + name: Archer Forge + recipes: + - Enchant_Power_I + - Enchant_Power_II + - Enchant_Helmet_ProjectileProtection_I + - Enchant_Chestplate_ProjectileProtection_I + - Enchant_Leggings_ProjectileProtection_I + - Enchant_Boots_ProjectileProtection_I + - Upgrade_to_Marksman_Forge + marksmanforge: + type: FCCUPGRADE + name: Marksman Forge + recipes: + - Enchant_Power_III + - Enchant_Power_IV + - Enchant_Helmet_ProjectileProtection_II + - Enchant_Chestplate_ProjectileProtection_II + - Enchant_Leggings_ProjectileProtection_II + - Enchant_Boots_ProjectileProtection_II + - Enchant_Helmet_ProjectileProtection_III + - Enchant_Chestplate_ProjectileProtection_III + - Enchant_Leggings_ProjectileProtection_III + - Enchant_Boots_ProjectileProtection_III + - Enchant_Punch_I + - Upgrade_to_Sniper_Forge + sniperforge: + type: FCCUPGRADE + name: Sniper Forge + recipes: + - Enchant_Power_V + - Enchant_Helmet_ProjectileProtection_IV + - Enchant_Chestplate_ProjectileProtection_IV + - Enchant_Leggings_ProjectileProtection_IV + - Enchant_Boots_ProjectileProtection_IV + - Enchant_Punch_II +#Swords + daggerforge: + type: FCCUPGRADE + name: Dagger Forge + recipes: + - Enchant_Sharpness_I + - Enchant_Sharpness_II + - Enchant_Smite_I + - Enchant_Smite_II + - Upgrade_to_Sword_Forge + swordforge: + type: FCCUPGRADE + name: Sword Forge + recipes: + - Enchant_Sharpness_III + - Enchant_Sharpness_IV + - Enchant_Smite_III + - Enchant_Smite_IV + - Enchant_Knockback_I + - Upgrade_to_Blade_Forge + bladeforge: + type: FCCUPGRADE + name: Blade Forge + recipes: + - Enchant_Sharpness_V + - Enchant_Smite_V + - Enchant_Knockback_II +#Efficiency + quickforge: + type: FCCUPGRADE + name: Quick Forge + recipes: + - Enchant_Pickaxe_Efficiency_I + - Enchant_Axe_Efficiency_I + - Enchant_Shovel_Efficiency_I + - Enchant_Pickaxe_Efficiency_II + - Enchant_Axe_Efficiency_II + - Enchant_Shovel_Efficiency_II + - Upgrade_to_Rapid_Forge + rapidforge: + type: FCCUPGRADE + name: Rapid Forge + recipes: + - Enchant_Pickaxe_Efficiency_III + - Enchant_Axe_Efficiency_III + - Enchant_Shovel_Efficiency_III + - Enchant_Pickaxe_Efficiency_IV + - Enchant_Axe_Efficiency_IV + - Enchant_Shovel_Efficiency_IV + - Upgrade_to_Sonic_Forge + sonicforge: + type: FCCUPGRADE + name: Sonic Forge + recipes: + - Enchant_Pickaxe_Efficiency_V + - Enchant_Axe_Efficiency_V + - Enchant_Shovel_Efficiency_V +#Unbreaking + rockforge: + type: FCCUPGRADE + name: Rock Forge + recipes: + - Enchant_Pickaxe_Unbreaking_I + - Enchant_Axe_Unbreaking_I + - Enchant_Shovel_Unbreaking_I + - Enchant_Helmet_Unbreaking_I + - Enchant_Chestplate_Unbreaking_I + - Enchant_Leggings_Unbreaking_I + - Enchant_Boots_Unbreaking_I + - Enchant_Sword_Unbreaking_I + - Enchant_Bow_Unbreaking_I + - Upgrade_to_Metal_Forge + metalforge: + type: FCCUPGRADE + name: Metal Forge + recipes: + - Enchant_Pickaxe_Unbreaking_II + - Enchant_Axe_Unbreaking_II + - Enchant_Shovel_Unbreaking_II + - Enchant_Helmet_Unbreaking_II + - Enchant_Chestplate_Unbreaking_II + - Enchant_Leggings_Unbreaking_II + - Enchant_Boots_Unbreaking_II + - Enchant_Sword_Unbreaking_II + - Enchant_Bow_Unbreaking_II + - Upgrade_to_Carbon_Forge + carbonforge: + type: FCCUPGRADE + name: Carbon Forge + recipes: + - Enchant_Pickaxe_Unbreaking_III + - Enchant_Axe_Unbreaking_III + - Enchant_Shovel_Unbreaking_III + - Enchant_Helmet_Unbreaking_III + - Enchant_Chestplate_Unbreaking_III + - Enchant_Leggings_Unbreaking_III + - Enchant_Boots_Unbreaking_III + - Enchant_Sword_Unbreaking_III + - Enchant_Bow_Unbreaking_III + +## XP Production + woodcauldron: + type: FCCUPGRADE + name: Wood Cauldron + recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment + - Upgrade_to_Iron_Cauldron + ironcauldron: + type: FCCUPGRADE + name: Iron Cauldron + recipes: + - Lead_Enrichment + - Copper_Enrichment + - Tin_Enrichment + - Upgrade_to_Diamond_Cauldron + diamondcauldron: + type: FCCUPGRADE + name: Diamond Cauldron + recipes: + - Amethyst_Enrichment + - Topaz_Enrichment + - Ruby_Enrichment #Pipes normalpipe: @@ -721,7 +1017,8 @@ factories: sort_time: 1s sort_amount: 64 maximum_materials_per_side: 10 -recipes: + +# Recipes: Repair_Rudimentary_Factory: type: REPAIR name: Repair Factory @@ -2374,25 +2671,6 @@ recipes: material: WOOL durability: 4 amount: 64 - Enchant_Efficiency_Basic: - type: PRODUCTION - name: Enchant Efficiency - production_time: 5s - input: - diamond pickaxe: - material: DIAMOND_PICKAXE - amount: 1 - emerald block: - material: EMERALD_BLOCK - amount: 1 - output: - diamond pickaxe: - material: DIAMOND_PICKAXE - amount: 1 - enchants: - efficiency: - enchant: DIG_SPEED - level: 1 Extract_Diamonds: type: PRODUCTION name: Extract Diamonds @@ -3782,19 +4060,6 @@ recipes: material: DIAMOND_PICKAXE amount: 8 factory: Quartz Factory - Upgrade_to_Armour_Enchanter: - production_time: 3600s - type: UPGRADE - name: Upgrade to Armour Enchanter - fuel_consumption_intervall: 30s - input: - emerald block: - material: EMERALD_BLOCK - amount: 256 - diamond block: - material: DIAMOND_BLOCK - amount: 64 - factory: Armour Enchanter Upgrade_to_Bakery: production_time: 2h type: UPGRADE @@ -4028,16 +4293,6 @@ recipes: material: DIAMOND_BLOCK amount: 32 factory: Diamond Tools Forge - Upgrade_to_Enchanter_Basic: - production_time: 3600s - type: UPGRADE - name: Upgrade to Enchanter Basic - fuel_consumption_intervall: 30s - input: - emerald block: - material: EMERALD_BLOCK - amount: 32 - factory: Enchanter Basic Upgrade_to_Farmstead_Factory: production_time: 10m type: UPGRADE @@ -4535,16 +4790,6 @@ recipes: material: STONE amount: 256 factory: Stonebrick Smelter - Upgrade_to_Tool_Enchanter: - production_time: 3600s - type: UPGRADE - name: Upgrade to Tool Enchanter - fuel_consumption_intervall: 30s - input: - emerald block: - material: EMERALD_BLOCK - amount: 32 - factory: Tool Enchanter Upgrade_to_Tree_Mutator: production_time: 1800s type: UPGRADE @@ -4556,16 +4801,6 @@ recipes: durability: -1 amount: 128 factory: Tree Mutator - Upgrade_to_Weapon_Enchanter: - production_time: 3600s - type: UPGRADE - name: Upgrade to Weapon Enchanter - fuel_consumption_intervall: 30s - input: - emerald block: - material: EMERALD_BLOCK - amount: 32 - factory: Weapon Enchanter Upgrade_to_Wood_Processor: production_time: 10m type: UPGRADE @@ -4609,46 +4844,6 @@ recipes: material: STONE durability: 5 amount: 256 - Upgrade_to_Emerald_Extractor: - name: Upgrade to Emerald Extractor - production_time: 4h - fuel_consumption_intervall: 2m - type: UPGRADE - factory: Emerald Extractor - input: - potato: - material: BAKED_POTATO - amount: 512 - carrots: - material: CARROT_ITEM - amount: 512 - mushroom: - material: BROWN_MUSHROOM - amount: 256 - yesdiet_more_mushroom: - material: RED_MUSHROOM - amount: 256 - aether: - material: GOLD_NUGGET - amount: 256 - lore: - - Aether - enchants: - dura: - enchant: DURABILITY - vines: - material: VINE - amount: 128 - grass: - material: LONG_GRASS - amount: 256 - durability: 1 - pumpkin: - material: PUMPKIN - amount: 256 - melon: - material: MELON_BLOCK - amount: 128 Upgrade_to_Crystallization_Factory: production_time: 10m type: UPGRADE @@ -4831,151 +5026,6 @@ recipes: xp: material: EMERALD_BLOCK amount: 512 -#XP recipes - Produce_Potash_Enrichement: - name: Produce Potash Enrichment - type: PRODUCTION - production_time: 15s - input: - aether: - material: GOLD_NUGGET - amount: 64 - lore: - - Aether - enchants: - dura: - enchant: DURABILITY -# essence: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY - potato: - material: BAKED_POTATO - amount: 256 - sugar: - material: SUGAR - amount: 256 - melon: - material: MELON_BLOCK - amount: 32 - redrose: - material: RED_ROSE - amount: 8 - brown_mushroom: - material: BROWN_MUSHROOM - amount: 64 - oaksapling: - material: SAPLING - amount: 4 - sprucelog: - material: LOG - amount: 32 - durability: 1 - output: - emeralds: - material: EMERALD - amount: 128 - Produce_Vitamin_Enrichment: - type: PRODUCTION - name: Produce Vitamin Enrichment - production_time: 15s - input: - aether: - material: GOLD_NUGGET - amount: 64 - lore: - - Aether - enchants: - dura: - enchant: DURABILITY -# essence: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY - carrots: - material: CARROT_ITEM - amount: 12 - lore: - - Compacted Item - cocoa: - material: INK_SACK - amount: 92 - durability: 3 - grass: - material: LONG_GRASS - durability: 1 - amount: 32 - rose: - material: RED_ROSE - amount: 8 - brownmushrooms: - material: BROWN_MUSHROOM - amount: 64 - oaksapling: - material: SAPLING - amount: 4 - junglelog: - material: LOG - durability: 3 - amount: 32 - output: - xp: - material: EMERALD - amount: 128 - Produce_Nether_Enrichement: - type: PRODUCTION - name: Produce Nether Enrichment - production_time: 15s - input: - aether: - material: GOLD_NUGGET - amount: 64 - lore: - - Aether - enchants: - dura: - enchant: DURABILITY -# essence: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY - vines: - material: VINE - amount: 128 - netherwart: - material: NETHER_STALK - amount: 64 - cactus: - material: CACTUS - amount: 256 - yellow_flower: - material: YELLOW_FLOWER - amount: 8 - redmushroom: - material: RED_MUSHROOM - amount: 64 - birchsapling: - material: SAPLING - durability: 2 - amount: 4 - darkoaklog: - material: LOG_2 - durability: 1 - amount: 32 - output: - xp: - material: EMERALD - amount: 128 - #Pylon recipes Pylon_Basic: @@ -5036,7 +5086,7 @@ recipes: input: xp: material: EMERALD - amount: 100 + amount: 56 health_gained: 1000 Repair_Advanced_Pylon: type: REPAIR @@ -5044,8 +5094,8 @@ recipes: production_time: 10s input: xp: - material: EMERALD - amount: 140 + material: EMERALD_BLOCK + amount: 34 health_gained: 1000 Repair_Expert_Pylon: type: REPAIR @@ -5053,8 +5103,8 @@ recipes: production_time: 10s input: xp: - material: EMERALD - amount: 200 + material: EMERALD_BLOCK + amount: 75 health_gained: 1000 @@ -5316,9 +5366,6 @@ recipes: lore: - Ocean Concentrate - - - #Dying recipes Dye_Glass_White: name: Dye Glass White @@ -5933,3 +5980,3357 @@ recipes: enchants: dura: enchant: DURABILITY + +## XP Generation Recipes +# Upgrades + + Upgrade_to_Wood_Cauldron: + production_time: 1h + type: UPGRADE + name: Upgrade to Wood Cauldron + factory: Wood Cauldron + fuel_consumption_intervall: 1m + input: + logs: + material: LOG + amount: 1024 + durability: -1 + aether: + material: GOLD_NUGGET + amount: 180 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + Upgrade_to_Iron_Cauldron: + production_time: 2h + type: UPGRADE + name: Upgrade to Iron Cauldron + factory: Iron Cauldron + fuel_consumption_intervall: 1m + input: + ironblocks: + material: IRON_BLOCK + amount: 384 + aether: + material: GOLD_NUGGET + amount: 500 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + xp: + material: EMERALD_BLOCK + amount: 22 + Upgrade_to_Diamond_Cauldron: + production_time: 4h + type: UPGRADE + name: Upgrade to Diamond Cauldron + factory: Diamond Cauldron + fuel_consumption_intervall: 1m + input: + ironblocks: + material: IRON_BLOCK + amount: 384 + aether: + material: GOLD_NUGGET + amount: 500 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + xp: + material: EMERALD_BLOCK + amount: 22 + +# Enrichments + + Aspen_Enrichment: + name: Aspen Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + wheat: + material: WHEAT + amount: 64 + logs: + material: LOG + amount: 128 + durability: -1 + netherwart: + material: NETHER_WARTS + amount: 32 + aether: + material: GOLD_NUGGET + amount: 30 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD + amount: 20 + Cypress_Enrichment: + name: Cypress Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + carrots: + material: CARROT_ITEM + amount: 64 + logs: + material: LOG + amount: 128 + durability: -1 + cactus: + material: CACTUS + amount: 64 + aether: + material: GOLD_NUGGET + amount: 30 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD + amount: 20 + Pine_Enrichment: + name: Pine Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + potatoes: + material: POTATO_ITEM + amount: 64 + logs: + material: LOG + amount: 128 + durability: -1 + sugarcane: + material: SUGAR_CANE + amount: 64 + aether: + material: GOLD_NUGGET + amount: 30 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD + amount: 20 + + Lead_Enrichment: + name: Lead Enrichment + type: PRODUCTION + production_time: 2h + fuel_consumption_intervall: 6m + input: + wheat: + material: WHEAT + amount: 320 + acacialogs: + material: LOG_2 + amount: 640 + durability: 0 + netherwart: + material: NETHER_WARTS + amount: 160 + melons: + material: MELON_BLOCK + amount: 128 + chicken: + material: RAW_CHICKEN + amount: 32 + aether: + material: GOLD_NUGGET + amount: 168 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + Copper_Enrichment: + name: Copper Enrichment + type: PRODUCTION + production_time: 2h + fuel_consumption_intervall: 6m + input: + carrots: + material: CARROT_ITEM + amount: 320 + sprucelogs: + material: LOG + amount: 640 + durability: 1 + cactus: + material: CACTUS + amount: 320 + cocoa: + material: COCOA + amount: 256 + beef: + material: RAW_BEEF + amount: 32 + aether: + material: GOLD_NUGGET + amount: 168 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + Tin_Enrichment: + name: Tin Enrichment + type: PRODUCTION + production_time: 2h + fuel_consumption_intervall: 6m + input: + potatoes: + material: POTATO_ITEM + amount: 320 + birchlogs: + material: LOG + amount: 640 + durability: 2 + sugarcane: + material: SUGAR_CANE + amount: 320 + pumpkins: + material: PUMPKIN + amount: 128 + pork: + material: RAW_PORK + amount: 32 + aether: + material: GOLD_NUGGET + amount: 168 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + + Amethyst_Enrichment: + name: Amethyst Enrichment + type: PRODUCTION + production_time: 3h + fuel_consumption_intervall: 6m + input: + wheat: + material: WHEAT + amount: 25 + lore: + - Compacted Item + acacialogs: + material: LOG_2 + amount: 50 + durability: 0 + lore: + - Compacted Item + junglesaplings: + material: SAPLING + amount: 4 + durability: 3 + lore: + - Compacted Item + netherwart: + material: NETHER_WARTS + amount: 15 + lore: + - Compacted Item + melons: + material: MELON_BLOCK + amount: 10 + lore: + - Compacted Item + chicken: + material: RAW_CHICKEN + amount: 160 + inksacs: + material: INK_SACK + amount: 64 + apples: + material: APPLE + amount: 1 + lore: + - Compacted Item + aether: + material: GOLD_NUGGET + amount: 960 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 + Topaz_Enrichment: + name: Topaz Enrichment + type: PRODUCTION + production_time: 3h + fuel_consumption_intervall: 6m + input: + carrots: + material: CARROT_ITEM + amount: 25 + lore: + - Compacted Item + sprucelogs: + material: LOG + amount: 50 + durability: 1 + lore: + - Compacted Item + darkoaksaplings: + material: SAPLING + amount: 2 + durability: 5 + lore: + - Compacted Item + cactus: + material: CACTUS + amount: 25 + lore: + - Compacted Item + cocoa: + material: COCOA + amount: 20 + lore: + - Compacted Item + beef: + material: RAW_BEEF + amount: 160 + clownfish: + material: RAW_FISH + amount: 3 + durability: 3 + eggs: + material: EGG + amount: 32 + lore: + - Compacted Item + aether: + material: GOLD_NUGGET + amount: 960 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 + Ruby_Enrichment: + name: Ruby Enrichment + type: PRODUCTION + production_time: 3h + fuel_consumption_intervall: 6m + input: + potatoes: + material: POTATO_ITEM + amount: 25 + lore: + - Compacted Item + birchlogs: + material: LOG + amount: 50 + durability: 2 + lore: + - Compacted Item + oaksaplings: + material: SAPLING + amount: 6 + durability: 0 + lore: + - Compacted Item + sugarcane: + material: SUGAR_CANE + amount: 25 + lore: + - Compacted Item + pumpkins: + material: PUMPKIN + amount: 10 + lore: + - Compacted Item + pork: + material: RAW_PORK + amount: 160 + salmon: + material: RAW_FISH + amount: 19 + durability: 1 + vines: + material: VINE + amount: 6 + lore: + - Compacted Item + aether: + material: GOLD_NUGGET + amount: 960 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 + +##Enchanting Recipes +#Upgrades + + Upgrade_to_Ember_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Ember Forge + factory: Ember Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 350 + Upgrade_to_Magma_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Magma Forge + factory: Magma Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 16 + lore: + - Compacted Item + Upgrade_to_River_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to River Forge + factory: River Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 250 + Upgrade_to_Ocean_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Ocean Forge + factory: Ocean Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 12 + lore: + - Compacted Item + Upgrade_to_Magic_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Magic Forge + factory: Magic Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 500 + Upgrade_to_Arcane_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Arcane Forge + factory: Arcane Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 23 + lore: + - Compacted Item + Upgrade_to_Mithril_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Mithril Forge + factory: Mithril Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 500 + Upgrade_to_Titanium_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Titanium Forge + factory: Titanium Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 160 + Upgrade_to_Meteor_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Meteor Forge + factory: Meteor Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 23 + lore: + - Compacted Item + Upgrade_to_Archer_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Archer Forge + factory: Archer Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 450 + Upgrade_to_Marksman_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Marksman Forge + factory: Marksman Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 144 + Upgrade_to_Sniper_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Sniper Forge + factory: Sniper Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 21 + lore: + - Compacted Item + Upgrade_to_Dagger_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Dagger Forge + factory: Dagger Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 500 + Upgrade_to_Sword_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Sword Forge + factory: Sword Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 160 + Upgrade_to_Blade_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Blade Forge + factory: Blade Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 23 + lore: + - Compacted Item + Upgrade_to_Quick_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Quick Forge + factory: Quick Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 350 + Upgrade_to_Rapid_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Rapid Forge + factory: Rapid Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 112 + Upgrade_to_Sonic_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Sonic Forge + factory: Sonic Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 16 + lore: + - Compacted Item + Upgrade_to_Rock_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Rock Forge + factory: Rock Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 400 + Upgrade_to_Metal_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Metal Forge + factory: Metal Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 118 + Upgrade_to_Carbon_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Carbon Forge + factory: Carbon Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD_BLOCK + amount: 18 + lore: + - Compacted Item + +#FireProtection + + Enchant_Helmet_FireP_I: + type: ENCHANT + name: Enchant Helmet with Fire Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_FIRE + level: 1 + enchant_item: + boots: + material: DIAMOND_HELMET + Enchant_Chestplate_FireP_I: + type: ENCHANT + name: Enchant Chestplate with Fire Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_FIRE + level: 1 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_FireP_I: + type: ENCHANT + name: Enchant Leggings with Fire Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_FIRE + level: 1 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + Enchant_Boots_FireP_I: + type: ENCHANT + name: Enchant Boots with Fire Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_FIRE + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_Helmet_FireP_II: + type: ENCHANT + name: Enchant Helmet with Fire Protection II + production_time: 20s + input: + emeralds: + material: EMERALD + amount: 20 + enchant: PROTECTION_FIRE + level: 2 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 1 + Enchant_Chestplate_FireP_II: + type: ENCHANT + name: Enchant Chestplate with Fire Protection II + production_time: 20s + input: + emeralds: + material: EMERALD + amount: 20 + enchant: PROTECTION_FIRE + level: 2 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 1 + Enchant_Leggings_FireP_II: + type: ENCHANT + name: Enchant Leggings with Fire Protection II + production_time: 20s + input: + emeralds: + material: EMERALD + amount: 20 + enchant: PROTECTION_FIRE + level: 2 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 1 + Enchant_Boots_FireP_II: + type: ENCHANT + name: Enchant Boots with Fire Protection II + production_time: 20s + input: + emeralds: + material: EMERALD + amount: 20 + enchant: PROTECTION_FIRE + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 1 + Enchant_Helmet_FireP_III: + type: ENCHANT + name: Enchant Helmet with Fire Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: PROTECTION_FIRE + level: 3 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 2 + Enchant_Chestplate_FireP_III: + type: ENCHANT + name: Enchant Chestplate with Fire Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: PROTECTION_FIRE + level: 3 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 2 + Enchant_Leggings_FireP_III: + type: ENCHANT + name: Enchant Leggings with Fire Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: PROTECTION_FIRE + level: 3 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 2 + Enchant_Boots_FireP_III: + type: ENCHANT + name: Enchant Boots with Fire Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: PROTECTION_FIRE + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 2 + Enchant_Helmet_FireP_IV: + type: ENCHANT + name: Enchant Helmet with Fire Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_FIRE + level: 4 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 3 + Enchant_Chestplate_FireP_IV: + type: ENCHANT + name: Enchant Chestplate with Fire Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_FIRE + level: 4 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 3 + Enchant_Leggings_FireP_IV: + type: ENCHANT + name: Enchant Leggings with Fire Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_FIRE + level: 4 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 3 + Enchant_Boots_FireP_IV: + type: ENCHANT + name: Enchant Boots with Fire Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_FIRE + level: 4 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 3 + Enchant_Helmet_FireP_V: + type: ENCHANT + name: Enchant Helmet with Fire Protection V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: PROTECTION_FIRE + level: 5 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 4 + Enchant_Chestplate_FireP_V: + type: ENCHANT + name: Enchant Chestplate with Fire Protection V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: PROTECTION_FIRE + level: 5 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 4 + Enchant_Leggings_FireP_V: + type: ENCHANT + name: Enchant Leggings with Fire Protection V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: PROTECTION_FIRE + level: 5 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 4 + Enchant_Boots_FireP_V: + type: ENCHANT + name: Enchant Boots with Fire Protection V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: PROTECTION_FIRE + level: 5 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 4 + Enchant_Helmet_FireP_VI: + type: ENCHANT + name: Enchant Helmet with Fire Protection VI + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 900 + enchant: PROTECTION_FIRE + level: 6 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 5 + Enchant_Chestplate_FireP_VI: + type: ENCHANT + name: Enchant Chestplate with Fire Protection VI + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 900 + enchant: PROTECTION_FIRE + level: 6 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 5 + Enchant_Leggings_FireP_VI: + type: ENCHANT + name: Enchant Leggings with Fire Protection VI + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 900 + enchant: PROTECTION_FIRE + level: 6 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 5 + Enchant_Boots_FireP_VI: + type: ENCHANT + name: Enchant Boots with Fire Protection VI + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 900 + enchant: PROTECTION_FIRE + level: 6 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_FIRE + level: 5 + +#Flame + + Enchant_Flame_I: + type: ENCHANT + name: Enchant Bow with Flame I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1500 + enchant: ARROW_FIRE + level: 1 + enchant_item: + bow: + material: BOW + +#Fire Aspect + + Enchant_FireAspect_I: + type: ENCHANT + name: Enchant Sword with Fire Aspect I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: FIRE_ASPECT + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_FireAspect_II: + type: ENCHANT + name: Enchant Sword with Fire Aspect II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1250 + enchant: FIRE_ASPECT + level: 2 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + fireaspect1: + enchant: FIRE_ASPECT + level: 1 + +#Depth Strider + + Enchant_DepthStrider_I: + type: ENCHANT + name: Enchant Boots with Depth Strider I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DEPTH_STRIDER + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_DepthStrider_II: + type: ENCHANT + name: Enchant Boots with Depth Strider II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: DEPTH_STRIDER + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + depthstrider1: + enchant: DEPTH_STRIDER + level: 1 + Enchant_DepthStrider_III: + type: ENCHANT + name: Enchant Boots with Depth Strider III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: DEPTH_STRIDER + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + depthstrider2: + enchant: DEPTH_STRIDER + level: 2 + +#Respiration + + Enchant_Respiration_I: + type: ENCHANT + name: Enchant Helmet with Respiration I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: OXYGEN + level: 1 + enchant_item: + helmet: + material: DIAMOND_HELMET + Enchant_Respiration_II: + type: ENCHANT + name: Enchant Helmet with Respiration II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: OXYGEN + level: 2 + enchant_item: + helmet: + material: DIAMOND_HELMET + enchants: + respiration1: + enchant: OXYGEN + level: 1 + Enchant_Respiration_III: + type: ENCHANT + name: Enchant Helmet with Respiration III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 600 + enchant: OXYGEN + level: 3 + enchant_item: + helmet: + material: DIAMOND_HELMET + enchants: + respiration2: + enchant: OXYGEN + level: 2 + +#Frost Walker +#Until 1.9 + +#Aqua Affinity + + Enchant_AquaAffinity_I: + type: ENCHANT + name: Enchant Helmet with Aqua Affinity + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: WATER_WORKER + level: 1 + enchant_item: + helmet: + material: DIAMOND_HELMET + +#Feather Falling + + Enchant_FeatherFalling_I: + type: ENCHANT + name: Enchant Boots with FeatherFalling I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_FALL + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_FeatherFalling_II: + type: ENCHANT + name: Enchant Boots with FeatherFalling II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_FALL + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + featherfalling1: + enchant: PROTECTION_FALL + level: 1 + Enchant_FeatherFalling_III: + type: ENCHANT + name: Enchant Boots with FeatherFalling III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: PROTECTION_FALL + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + featherfalling2: + enchant: PROTECTION_FALL + level: 2 + Enchant_FeatherFalling_IV: + type: ENCHANT + name: Enchant Boots with FeatherFalling IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: PROTECTION_FALL + level: 4 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + featherfalling3: + enchant: PROTECTION_FALL + level: 3 + +#BOA + + Enchant_BOA_I: + type: ENCHANT + name: Enchant Sword with Bane of Arthropods I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DAMAGE_ARTHROPODS + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_BOA_II: + type: ENCHANT + name: Enchant Sword with Bane of Arthropods II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: DAMAGE_ARTHROPODS + level: 2 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + baneofarthropods1: + enchant: DAMAGE_ARTHROPODS + level: 1 + Enchant_BOA_III: + type: ENCHANT + name: Enchant Sword with Bane of Arthropods III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 120 + enchant: DAMAGE_ARTHROPODS + level: 3 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + baneofarthropods2: + enchant: DAMAGE_ARTHROPODS + level: 2 + Enchant_BOA_IV: + type: ENCHANT + name: Enchant Sword with Bane of Arthropods IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 240 + enchant: DAMAGE_ARTHROPODS + level: 4 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + baneofarthropods3: + enchant: DAMAGE_ARTHROPODS + level: 3 + Enchant_BOA_V: + type: ENCHANT + name: Enchant Sword with Bane of Arthropods V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 600 + enchant: DAMAGE_ARTHROPODS + level: 5 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + baneofarthropods4: + enchant: DAMAGE_ARTHROPODS + level: 4 + +#Infinity + + Enchant_Infinity_I: + name: Enchant Bow with Infinity + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1500 + enchant: ARROW_INFINITE + level: 1 + enchant_item: + bow: + material: BOW + +#Silk Touch + + Enchant_Pickaxe_SilkTouch_I: + name: Enchant Pickaxe with Silk Touch + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_PICKAXE + Enchant_Axe_SilkTouch_I: + name: Enchant Axe with Silk Touch + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_AXE + Enchant_Shovel_SilkTouch_I: + name: Enchant Shovel with Silk Touch + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_SPADE + Enchant_Shears_SilkTouch_I: + name: Enchant Shears with Silk Touch + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 4000 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: SHEARS + +#Protection + + Enchant_Helmet_Protection_I: + type: ENCHANT + name: Enchant Helmet with Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + enchant_item: + boots: + material: DIAMOND_HELMET + Enchant_Chestplate_Protection_I: + type: ENCHANT + name: Enchant Chestplate with Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_Protection_I: + type: ENCHANT + name: Enchant Leggings with Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + Enchant_Boots_Protection_I: + type: ENCHANT + name: Enchant Boots with Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_Helmet_Protection_II: + type: ENCHANT + name: Enchant Helmet with Protection II + production_time: 100s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + Enchant_Chestplate_Protection_II: + type: ENCHANT + name: Enchant Chestplate with Protection II + production_time: 100s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + Enchant_Leggings_Protection_II: + type: ENCHANT + name: Enchant Leggings with Protection II + production_time: 100s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + Enchant_Boots_Protection_II: + type: ENCHANT + name: Enchant Boots with Protection II + production_time: 100s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 1 + Enchant_Helmet_Protection_III: + type: ENCHANT + name: Enchant Helmet with Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + Enchant_Chestplate_Protection_III: + type: ENCHANT + name: Enchant Chestplate with Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + Enchant_Leggings_Protection_III: + type: ENCHANT + name: Enchant Leggings with Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + Enchant_Boots_Protection_III: + type: ENCHANT + name: Enchant Boots with Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 2 + Enchant_Helmet_Protection_IV: + type: ENCHANT + name: Enchant Helmet with Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 750 + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + Enchant_Chestplate_Protection_IV: + type: ENCHANT + name: Enchant Chestplate with Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 750 + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + Enchant_Leggings_Protection_IV: + type: ENCHANT + name: Enchant Leggings with Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 750 + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + Enchant_Boots_Protection_IV: + type: ENCHANT + name: Enchant Boots with Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 750 + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + fireprot1: + enchant: PROTECTION_ENVIRONMENTAL + level: 3 + +#BlastProtectionrotection + + Enchant_Helmet_BlastProtection_I: + type: ENCHANT + name: Enchant Helmet with Blast Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_EXPLOSIONS + level: 1 + enchant_item: + boots: + material: DIAMOND_HELMET + Enchant_Chestplate_BlastProtection_I: + type: ENCHANT + name: Enchant Chestplate with Blast Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_EXPLOSIONS + level: 1 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_BlastProtection_I: + type: ENCHANT + name: Enchant Leggings with Blast Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_EXPLOSIONS + level: 1 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + Enchant_Boots_BlastProtection_I: + type: ENCHANT + name: Enchant Boots with Blast Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_EXPLOSIONS + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_Helmet_BlastProtection_II: + type: ENCHANT + name: Enchant Helmet with Blast Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_EXPLOSIONS + level: 2 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 1 + Enchant_Chestplate_BlastProtection_II: + type: ENCHANT + name: Enchant Chestplate with Blast Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_EXPLOSIONS + level: 2 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 1 + Enchant_Leggings_BlastProtection_II: + type: ENCHANT + name: Enchant Leggings with Blast Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_EXPLOSIONS + level: 2 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 1 + Enchant_Boots_BlastProtection_II: + type: ENCHANT + name: Enchant Boots with Blast Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_EXPLOSIONS + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 1 + Enchant_Helmet_BlastProtection_III: + type: ENCHANT + name: Enchant Helmet with Blast Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: PROTECTION_EXPLOSIONS + level: 3 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 2 + Enchant_Chestplate_BlastProtection_III: + type: ENCHANT + name: Enchant Chestplate with Blast Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: PROTECTION_EXPLOSIONS + level: 3 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 2 + Enchant_Leggings_BlastProtection_III: + type: ENCHANT + name: Enchant Leggings with Blast Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: PROTECTION_EXPLOSIONS + level: 3 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 2 + Enchant_Boots_BlastProtection_III: + type: ENCHANT + name: Enchant Boots with Blast Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: PROTECTION_EXPLOSIONS + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 2 + Enchant_Helmet_BlastProtection_IV: + type: ENCHANT + name: Enchant Helmet with Blast Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: PROTECTION_EXPLOSIONS + level: 4 + enchant_item: + helmet: + material: DIAMOND_HELMET + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 3 + Enchant_Chestplate_BlastProtection_IV: + type: ENCHANT + name: Enchant Chestplate with Blast Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: PROTECTION_EXPLOSIONS + level: 4 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 3 + Enchant_Leggings_BlastProtection_IV: + type: ENCHANT + name: Enchant Leggings with Blast Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: PROTECTION_EXPLOSIONS + level: 4 + enchant_item: + leggings: + material: DIAMOND_LEGGINGS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 3 + Enchant_Boots_BlastProtection_IV: + type: ENCHANT + name: Enchant Boots with Blast Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: PROTECTION_EXPLOSIONS + level: 4 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + blastprot1: + enchant: PROTECTION_EXPLOSIONS + level: 3 + +#Thorns + + Enchant_Thorns_I: + type: ENCHANT + name: Enchant Chestplate with Thorns I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: THORNS + level: 1 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + Enchant_Thorns_II: + type: ENCHANT + name: Enchant Chestplate with Thorns II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 450 + enchant: THORNS + level: 2 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + thorns1: + enchant: THORNS + level: 1 + +#Power + + Enchant_Power_I: + type: ENCHANT + name: Enchant Bow with Power I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: ARROW_DAMAGE + level: 1 + enchant_item: + bow: + material: BOW + Enchant_Power_II: + type: ENCHANT + name: Enchant Bow with Power II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: ARROW_DAMAGE + level: 2 + enchant_item: + bow: + material: BOW + enchants: + power1: + enchant: ARROW_DAMAGE + level: 1 + Enchant_Power_III: + type: ENCHANT + name: Enchant Bow with Power III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: ARROW_DAMAGE + level: 3 + enchant_item: + bow: + material: BOW + enchants: + power2: + enchant: ARROW_DAMAGE + level: 2 + Enchant_Power_IV: + type: ENCHANT + name: Enchant Bow with Power IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: ARROW_DAMAGE + level: 4 + enchant_item: + bow: + material: BOW + enchants: + power3: + enchant: ARROW_DAMAGE + level: 3 + Enchant_Power + Enchant_Power_V: + type: ENCHANT + name: Enchant Bow with Power V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 2000 + enchant: ARROW_DAMAGE + level: 5 + enchant_item: + bow: + material: BOW + enchants: + power4: + enchant: ARROW_DAMAGE + level: 4 + Enchant_Power + +#Projectile Protection + + Enchant_Helmet_ProjectileProtection_I: + type: ENCHANT + name: Enchant Helmet with Projectile Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_PROJECTILE + level: 1 + enchant_item: + boots: + material: DIAMOND_HELMET + Enchant_Chestplate_ProjectileProtection_I: + type: ENCHANT + name: Enchant Chestplate with Projectile Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_PROJECTILE + level: 1 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_ProjectileProtection_I: + type: ENCHANT + name: Enchant Leggings with Projectile Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_PROJECTILE + level: 1 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + Enchant_Boots_ProjectileProtection_I: + type: ENCHANT + name: Enchant Boots with Projectile Protection I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: PROTECTION_PROJECTILE + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_Helmet_ProjectileProtection_II: + type: ENCHANT + name: Enchant Helmet with Projectile Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_PROJECTILE + level: 2 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 1 + Enchant_Chestplate_ProjectileProtection_II: + type: ENCHANT + name: Enchant Chestplate with Projectile Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_PROJECTILE + level: 2 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 1 + Enchant_Leggings_ProjectileProtection_II: + type: ENCHANT + name: Enchant Leggings with Projectile Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_PROJECTILE + level: 2 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 1 + Enchant_Boots_ProjectileProtection_II: + type: ENCHANT + name: Enchant Boots with Projectile Protection II + production_time: 30s + input: + emeralds: + material: EMERALD + amount: 30 + enchant: PROTECTION_PROJECTILE + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 1 + Enchant_Helmet_ProjectileProtection_III: + type: ENCHANT + name: Enchant Helmet with Projectile Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_PROJECTILE + level: 3 + enchant_item: + boots: + material: DIAMOND_HELMET + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 2 + Enchant_Chestplate_ProjectileProtection_III: + type: ENCHANT + name: Enchant Chestplate with Projectile Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_PROJECTILE + level: 3 + enchant_item: + boots: + material: DIAMOND_CHESTPLATE + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 2 + Enchant_Leggings_ProjectileProtection_III: + type: ENCHANT + name: Enchant Leggings with Projectile Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_PROJECTILE + level: 3 + enchant_item: + boots: + material: DIAMOND_LEGGINGS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 2 + Enchant_Boots_ProjectileProtection_III: + type: ENCHANT + name: Enchant Boots with Projectile Protection III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: PROTECTION_PROJECTILE + level: 3 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 2 + Enchant_Helmet_ProjectileProtection_IV: + type: ENCHANT + name: Enchant Helmet with Projectile Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_PROJECTILE + level: 4 + enchant_item: + helmet: + material: DIAMOND_HELMET + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 3 + Enchant_Chestplate_ProjectileProtection_IV: + type: ENCHANT + name: Enchant Chestplate with Projectile Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_PROJECTILE + level: 4 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 3 + Enchant_Leggings_ProjectileProtection_IV: + type: ENCHANT + name: Enchant Leggings with Projectile Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_PROJECTILE + level: 4 + enchant_item: + leggings: + material: DIAMOND_LEGGINGS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 3 + Enchant_Boots_ProjectileProtection_IV: + type: ENCHANT + name: Enchant Boots with Projectile Protection IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 250 + enchant: PROTECTION_PROJECTILE + level: 4 + enchant_item: + boots: + material: DIAMOND_BOOTS + enchants: + projprot1: + enchant: PROTECTION_PROJECTILE + level: 3 + +#Punch + + Enchant_Punch_I: + type: ENCHANT + name: Enchant Bow with Punch I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: ARROW_KNOCKBACK + level: 1 + enchant_item: + bow: + material: BOW + Enchant_Punch_II: + type: ENCHANT + name: Enchant Bow with Punch II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 800 + enchant: ARROW_KNOCKBACK + level: 2 + enchant_item: + bow: + material: BOW + enchants: + power1: + enchant: ARROW_KNOCKBACK + level: 1 + +#Sharpness + + Enchant_Sharpness_I: + type: ENCHANT + name: Enchant Sword with Sharpness I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DAMAGE_ALL + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Sharpness_II: + type: ENCHANT + name: Enchant Sword with Sharpness II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DAMAGE_ALL + level: 2 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + sharpness1: + enchant: DAMAGE_ALL + level: 1 + Enchant_Sharpness_III: + type: ENCHANT + name: Enchant Sword with Sharpness III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: DAMAGE_ALL + level: 3 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + sharpness2: + enchant: DAMAGE_ALL + level: 2 + Enchant_Sharpness_IV: + type: ENCHANT + name: Enchant Sword with Sharpness IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: DAMAGE_ALL + level: 4 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + sharpness3: + enchant: DAMAGE_ALL + level: 3 + Enchant_Sharpness_V: + type: ENCHANT + name: Enchant Sword with Sharpness V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 2000 + enchant: DAMAGE_ALL + level: 5 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + sharpness4: + enchant: DAMAGE_ALL + level: 4 + +#Smite + + Enchant_Smite_I: + type: ENCHANT + name: Enchant Sword with Smite I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DAMAGE_UNDEAD + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Smite_II: + type: ENCHANT + name: Enchant Sword with Smite II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 40 + enchant: DAMAGE_UNDEAD + level: 2 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + smite1: + enchant: DAMAGE_UNDEAD + level: 1 + Enchant_Smite_III: + type: ENCHANT + name: Enchant Sword with Smite III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 120 + enchant: DAMAGE_UNDEAD + level: 3 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + smite2: + enchant: DAMAGE_UNDEAD + level: 2 + Enchant_Smite_IV: + type: ENCHANT + name: Enchant Sword with Smite IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 240 + enchant: DAMAGE_UNDEAD + level: 4 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + smite3: + enchant: DAMAGE_UNDEAD + level: 3 + Enchant_Smite_V: + type: ENCHANT + name: Enchant Sword with Smite V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 600 + enchant: DAMAGE_UNDEAD + level: 5 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + smite4: + enchant: DAMAGE_UNDEAD + level: 4 + +#Knockback + + Enchant_Knockback_I: + type: ENCHANT + name: Enchant Sword with Knockback I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 300 + enchant: KNOCKBACK + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Knockback_II: + type: ENCHANT + name: Enchant Sword with Knockback II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 800 + enchant: KNOCKBACK + level: 2 + enchant_item: + sword: + material: DIAMOND_SWORD + enchants: + knockback1: + enchant: KNOCKBACK + level: 1 + +#Efficiency + + Enchant_Pickaxe_Efficiency_I: + type: ENCHANT + name: Enchant Pickaxe with Efficiency I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + tool: + material: DIAMOND_PICKAXE + Enchant_Pickaxe_Efficiency_II: + type: ENCHANT + name: Enchant Pickaxe with Efficiency II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 2 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + eff1: + enchant: DIG_SPEED + level: 1 + Enchant_Pickaxe_Efficiency_III: + type: ENCHANT + name: Enchant Pickaxe with Efficiency III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: DIG_SPEED + level: 3 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + eff2: + enchant: DIG_SPEED + level: 2 + Enchant_Pickaxe_Efficiency_IV: + type: ENCHANT + name: Enchant Pickaxe with Efficiency IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DIG_SPEED + level: 4 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + eff3: + enchant: DIG_SPEED + level: 3 + Enchant_Pickaxe_Efficiency_V: + type: ENCHANT + name: Enchant Pickaxe with Efficiency V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DIG_SPEED + level: 5 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + eff4: + enchant: DIG_SPEED + level: 4 + Enchant_Axe_Efficiency_I: + type: ENCHANT + name: Enchant Axe with Efficiency I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + tool: + material: DIAMOND_AXE + Enchant_Axe_Efficiency_II: + type: ENCHANT + name: Enchant Axe with Efficiency II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 2 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + eff1: + enchant: DIG_SPEED + level: 1 + Enchant_Axe_Efficiency_III: + type: ENCHANT + name: Enchant Axe with Efficiency III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: DIG_SPEED + level: 3 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + eff2: + enchant: DIG_SPEED + level: 2 + Enchant_Axe_Efficiency_IV: + type: ENCHANT + name: Enchant Axe with Efficiency IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DIG_SPEED + level: 4 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + eff3: + enchant: DIG_SPEED + level: 3 + Enchant_Axe_Efficiency_V: + type: ENCHANT + name: Enchant Axe with Efficiency V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DIG_SPEED + level: 5 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + eff4: + enchant: DIG_SPEED + level: 4 + Enchant_Shovel_Efficiency_I: + type: ENCHANT + name: Enchant Shovel with Efficiency I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + tool: + material: DIAMOND_SPADE + Enchant_Shovel_Efficiency_II: + type: ENCHANT + name: Enchant Shovel with Efficiency II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 2 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + eff1: + enchant: DIG_SPEED + level: 1 + Enchant_Shovel_Efficiency_III: + type: ENCHANT + name: Enchant Shovel with Efficiency III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 60 + enchant: DIG_SPEED + level: 3 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + eff2: + enchant: DIG_SPEED + level: 2 + Enchant_Shovel_Efficiency_IV: + type: ENCHANT + name: Enchant Shovel with Efficiency IV + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DIG_SPEED + level: 4 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + eff3: + enchant: DIG_SPEED + level: 3 + Enchant_Shovel_Efficiency_V: + type: ENCHANT + name: Enchant Shovel with Efficiency V + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DIG_SPEED + level: 5 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + eff4: + enchant: DIG_SPEED + level: 4 + +#Unbreaking Tools + + Enchant_Pickaxe_Unbreaking_I: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_PICKAXE + Enchant_Pickaxe_Unbreaking_II: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DURABILITY + level: 2 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Pickaxe_Unbreaking_III: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: DIAMOND_PICKAXE + enchants: + ub2: + enchant: DURABILITY + level: 2 + Enchant_Axe_Unbreaking_I: + type: ENCHANT + name: Enchant Axe with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_AXE + Enchant_Axe_Unbreaking_II: + type: ENCHANT + name: Enchant Axe with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DURABILITY + level: 2 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Axe_Unbreaking_III: + type: ENCHANT + name: Enchant Axe with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: DIAMOND_AXE + enchants: + ub2: + enchant: DURABILITY + level: 2 + Enchant_Shovel_Unbreaking_I: + type: ENCHANT + name: Enchant Shovel with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_SPADE + Enchant_Shovel_Unbreaking_II: + type: ENCHANT + name: Enchant Shovel with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DURABILITY + level: 2 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Shovel_Unbreaking_III: + type: ENCHANT + name: Enchant Shovel with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: DIAMOND_SPADE + enchants: + ub2: + enchant: DURABILITY + level: 2 + +#Unbreaking Swords + + Enchant_Sword_Unbreaking_I: + type: ENCHANT + name: Enchant Sword with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 75 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_SWORD + Enchant_Sword_Unbreaking_II: + type: ENCHANT + name: Enchant Sword with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 2 + enchant_item: + tool: + material: DIAMOND_SWORD + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Sword_Unbreaking_III: + type: ENCHANT + name: Enchant Sword with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: DIAMOND_SWORD + enchants: + ub2: + enchant: DURABILITY + level: 2 + +#Unbreaking Bows + + Enchant_Bow_Unbreaking_I: + type: ENCHANT + name: Enchant Bow with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: BOW + Enchant_Bow_Unbreaking_II: + type: ENCHANT + name: Enchant Bow with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 150 + enchant: DURABILITY + level: 2 + enchant_item: + tool: + material: BOW + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Bow_Unbreaking_III: + type: ENCHANT + name: Enchant Bow with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 400 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: BOW + enchants: + ub2: + enchant: DURABILITY + level: 2 + +#Unbreaking Armour + + Enchant_Helmet_Unbreaking_I: + type: ENCHANT + name: Enchant Helmet with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 75 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_HELMET + Enchant_Chestplate_Unbreaking_I: + type: ENCHANT + name: Enchant Chestplate with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 75 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_Unbreaking_I: + type: ENCHANT + name: Enchant Leggings with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 75 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_LEGGINGS + Enchant_Boots_Unbreaking_I: + type: ENCHANT + name: Enchant Boots with Unbreaking I + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 75 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_BOOTS + Enchant_Helmet_Unbreaking_II: + type: ENCHANT + name: Enchant Helmet with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: DIAMOND_HELMET + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Chestplate_Unbreaking_II: + type: ENCHANT + name: Enchant Chestplate with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: DIAMOND_CHESTPLATE + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Leggings_Unbreaking_II: + type: ENCHANT + name: Enchant Leggings with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: DIAMOND_LEGGINGS + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Boots_Unbreaking_II: + type: ENCHANT + name: Enchant Boots with Unbreaking II + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: DIAMOND_BOOTS + enchants: + ub1: + enchant: DURABILITY + level: 1 + Enchant_Helmet_Unbreaking_III: + type: ENCHANT + name: Enchant Helmet with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: DIAMOND_HELMET + enchants: + ub2: + enchant: DURABILITY + level: 2 + Enchant_Chestplate_Unbreaking_III: + type: ENCHANT + name: Enchant Chestplate with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: DIAMOND_CHESTPLATE + enchants: + ub2: + enchant: DURABILITY + level: 2 + Enchant_Leggings_Unbreaking_III: + type: ENCHANT + name: Enchant Leggings with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: DIAMOND_LEGGINGS + enchants: + ub2: + enchant: DURABILITY + level: 2 + Enchant_Boots_Unbreaking_III: + type: ENCHANT + name: Enchant Boots with Unbreaking III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 500 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: DIAMOND_BOOTS + enchants: + ub2: + enchant: DURABILITY + level: 2 + +#Basic Enchantments + + Enchant_Efficiency_Pickaxe_Basic: + type: ENCHANT + name: Enchant Pickaxe with Efficiency + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_PICKAXE + Enchant_Efficiency_Axe_Basic: + type: ENCHANT + name: Enchant Axe with Efficiency + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_AXE + Enchant_Efficiency_Shovel_Basic: + type: ENCHANT + name: Enchant Shovel with Efficiency + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 20 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_SPADE + Enchant_Unbreaking_Pickaxe_Basic: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_PICKAXE + Enchant_Unbreaking_Axe_Basic: + type: ENCHANT + name: Enchant Axe with Unbreaking + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_AXE + Enchant_Unbreaking_Shovel_Basic: + type: ENCHANT + name: Enchant Shovel with Unbreaking + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_SPADE + Enchant_Unbreaking_Sword_Basic: + type: ENCHANT + name: Enchant Sword with Unbreaking + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_SWORD + Enchant_Sharpness_Sword_Basic: + type: ENCHANT + name: Enchant Sword with Sharpness + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DAMAGE_ALL + level: 1 + enchant_item: + armor: + material: DIAMOND_SWORD From e7a836d7657cb4fcf150adb79b06c8566ccec1f6 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 8 Apr 2016 21:07:48 +0100 Subject: [PATCH 343/459] Made XP Factories sound nicer (Cauldrons out/Transmuters in) --- configCivcraft.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 4eb23859..87f7cf43 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -42,7 +42,7 @@ factories: - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor - Upgrade_to_Basic_Forge - - Upgrade_to_Wood_Cauldron + - Upgrade_to_Apprentice_Transmuter #Smelting stonesmelter: @@ -946,23 +946,23 @@ factories: ## XP Production woodcauldron: type: FCCUPGRADE - name: Wood Cauldron + name: Apprentice Transmuter recipes: - Aspen_Enrichment - Cypress_Enrichment - Pine_Enrichment - - Upgrade_to_Iron_Cauldron + - Upgrade_to_Adept_Transmuter ironcauldron: type: FCCUPGRADE - name: Iron Cauldron + name: Adept Transmuter recipes: - Lead_Enrichment - Copper_Enrichment - Tin_Enrichment - - Upgrade_to_Diamond_Cauldron + - Upgrade_to_Alchemist_Transmuter diamondcauldron: type: FCCUPGRADE - name: Diamond Cauldron + name: Alchemist Transmuter recipes: - Amethyst_Enrichment - Topaz_Enrichment @@ -5984,11 +5984,11 @@ factories: ## XP Generation Recipes # Upgrades - Upgrade_to_Wood_Cauldron: + Upgrade_to_Apprentice_Transmuter: production_time: 1h type: UPGRADE - name: Upgrade to Wood Cauldron - factory: Wood Cauldron + name: Upgrade to Apprentice Transmuter + factory: Apprentice Transmuter fuel_consumption_intervall: 1m input: logs: @@ -6003,11 +6003,11 @@ factories: enchants: dura: enchant: DURABILITY - Upgrade_to_Iron_Cauldron: + Upgrade_to_Adept_Transmuter: production_time: 2h type: UPGRADE - name: Upgrade to Iron Cauldron - factory: Iron Cauldron + name: Upgrade to Adept Transmuter + factory: Adept Transmuter fuel_consumption_intervall: 1m input: ironblocks: @@ -6024,11 +6024,11 @@ factories: xp: material: EMERALD_BLOCK amount: 22 - Upgrade_to_Diamond_Cauldron: + Upgrade_to_Alchemist_Transmuter: production_time: 4h type: UPGRADE - name: Upgrade to Diamond Cauldron - factory: Diamond Cauldron + name: Upgrade to Alchemist Transmuter + factory: Alchemist Transmuter fuel_consumption_intervall: 1m input: ironblocks: From 6ab9614ca5de393a04d9d72793cc1f5d72942b1a Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 8 Apr 2016 21:12:17 +0100 Subject: [PATCH 344/459] Changed 'Alchemist' to 'Grandmaster' --- configCivcraft.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 87f7cf43..e7dad59c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -959,10 +959,10 @@ factories: - Lead_Enrichment - Copper_Enrichment - Tin_Enrichment - - Upgrade_to_Alchemist_Transmuter + - Upgrade_to_Grandmaster_Transmuter diamondcauldron: type: FCCUPGRADE - name: Alchemist Transmuter + name: Grandmaster Transmuter recipes: - Amethyst_Enrichment - Topaz_Enrichment @@ -6024,11 +6024,11 @@ factories: xp: material: EMERALD_BLOCK amount: 22 - Upgrade_to_Alchemist_Transmuter: + Upgrade_to_Grandmaster_Transmuter: production_time: 4h type: UPGRADE - name: Upgrade to Alchemist Transmuter - factory: Alchemist Transmuter + name: Upgrade to Grandmaster Transmuter + factory: Grandmaster Transmuter fuel_consumption_intervall: 1m input: ironblocks: From e19c4f689892706278e2e6c513220c3ba6fc9dbc Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 11:11:43 +0100 Subject: [PATCH 345/459] Made Pylon Locator Much Cheaper After feedback from both community and the balance discussion Slack, it is agreed that the current cost of making something to detect the location of pylons is too expensive. A cheaper way to locate pylons should be tested at least, and we can make a final decision once this plays out. --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index e7dad59c..9b6aab5a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5025,7 +5025,7 @@ factories: amount: 1 xp: material: EMERALD_BLOCK - amount: 512 + amount: 128 #Pylon recipes Pylon_Basic: @@ -5969,7 +5969,7 @@ factories: amount: 1 xp: material: EMERALD_BLOCK - amount: 150 + amount: 64 output: basiccompass: material: COMPASS From 97930d87cbd83ffbaeced87fa0759dff7ddab21d Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 13:42:15 +0100 Subject: [PATCH 346/459] Updated Grandmaster Transmuter Creation Recipe --- configCivcraft.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 9b6aab5a..61d2892e 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6032,11 +6032,11 @@ factories: fuel_consumption_intervall: 1m input: ironblocks: - material: IRON_BLOCK - amount: 384 + material: DIAMOND_BLOCK + amount: 32 aether: material: GOLD_NUGGET - amount: 500 + amount: 3000 lore: - Aether enchants: @@ -6044,7 +6044,7 @@ factories: enchant: DURABILITY xp: material: EMERALD_BLOCK - amount: 22 + amount: 384 # Enrichments From df25d39f5c6dac760e3e023355ea0b6a99d6a3e3 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 15:20:35 +0100 Subject: [PATCH 347/459] Fixed YAML, re-added Emerald Extractor (removed recipes) --- configCivcraft.yml | 59 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 61d2892e..a94a982c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -621,6 +621,11 @@ factories: - Craft_Droppers - Craft_Redstone_Lamps - Repair_Advanced_Factory + xpfactory: + type: FCCUPGRADE + name: Emerald Extractor + recipes: + - Repair_Expert_Factory basicpylon: type: FCCUPGRADE name: Basic Pylon @@ -654,7 +659,6 @@ factories: recipes: - Create_Pylon_Locator - Repair_Advanced_Factory - ## Enchanting basicforge: type: FCCUPGRADE @@ -722,15 +726,15 @@ factories: - Enchant_Respiration_I - Enchant_Respiration_II - Upgrade_to_Ocean_Forge -# - Enchant_FrostWalker_I +# - Enchant_FrostWalker_I oceanforge: - type:FCCUPGRADE + type: FCCUPGRADE name: Ocean Forge recipes: - Enchant_DepthStrider_II - Enchant_AquaAffinity_I - Enchant_Respiration_III -# - Enchant_FrostWalker_II +# - Enchant_FrostWalker_II #Magic magicforge: type: FCCUPGRADE @@ -5106,9 +5110,6 @@ factories: material: EMERALD_BLOCK amount: 75 health_gained: 1000 - - - #Bastion recipes Brew_Soup_Concentrate: name: Brew Soup Concentrate @@ -5980,7 +5981,46 @@ factories: enchants: dura: enchant: DURABILITY - + Upgrade_to_Emerald_Extractor: + name: Upgrade to Emerald Extractor + production_time: 4h + fuel_consumption_intervall: 2m + type: UPGRADE + factory: Emerald Extractor + input: + potato: + material: BAKED_POTATO + amount: 512 + carrots: + material: CARROT_ITEM + amount: 512 + mushroom: + material: BROWN_MUSHROOM + amount: 256 + yesdiet_more_mushroom: + material: RED_MUSHROOM + amount: 256 + aether: + material: GOLD_NUGGET + amount: 256 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + vines: + material: VINE + amount: 128 + grass: + material: LONG_GRASS + amount: 256 + durability: 1 + pumpkin: + material: PUMPKIN + amount: 256 + melon: + material: MELON_BLOCK + amount: 128 ## XP Generation Recipes # Upgrades @@ -8034,7 +8074,6 @@ factories: power3: enchant: ARROW_DAMAGE level: 3 - Enchant_Power Enchant_Power_V: type: ENCHANT name: Enchant Bow with Power V @@ -8052,8 +8091,6 @@ factories: power4: enchant: ARROW_DAMAGE level: 4 - Enchant_Power - #Projectile Protection Enchant_Helmet_ProjectileProtection_I: From 5ee644f101fc2f685c12f18866d6d5fdd04de5c8 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 16:36:15 +0200 Subject: [PATCH 348/459] Output missing type location during parsing --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 12a939e2..d48dd8a5 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -190,7 +190,12 @@ private void parseFactories(ConfigurationSection config) { */ private void parseFactory(ConfigurationSection config) { IFactoryEgg egg = null; - switch (config.getString("type")) { + String type = config.getString("type"); + if (type == null) { + plugin.warning("No type specified for factory at " + config.getCurrentPath()+". Skipping it."); + return; + } + switch (type) { case "FCC": // Furnace, chest, craftingtable egg = parseFCCFactory(config); if (egg == null) { From a0725f8b2e62617b9c3a943365cedc5c63b410f0 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 16:41:29 +0200 Subject: [PATCH 349/459] Readd recipe identifier --- configCivcraft.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index a94a982c..12cb3a62 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1023,6 +1023,7 @@ factories: maximum_materials_per_side: 10 # Recipes: +recipes: Repair_Rudimentary_Factory: type: REPAIR name: Repair Factory From 08f47f4bf3638f596e7ac939626ac8f4ab17cfdc Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 16:48:58 +0200 Subject: [PATCH 350/459] Fix pork identifier in config --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 12cb3a62..7abf03ea 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6262,7 +6262,7 @@ recipes: material: PUMPKIN amount: 128 pork: - material: RAW_PORK + material: PORK amount: 32 aether: material: GOLD_NUGGET @@ -6424,7 +6424,7 @@ recipes: lore: - Compacted Item pork: - material: RAW_PORK + material: PORK amount: 160 salmon: material: RAW_FISH From 4e7bec5f20de84f7b030593a996368dd8f65d435 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 16:49:20 +0200 Subject: [PATCH 351/459] Output more information about invalid configs --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index d48dd8a5..3ddbd49a 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -435,9 +435,18 @@ private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { private IRecipe parseRecipe(ConfigurationSection config) { IRecipe result; String name = config.getString("name"); + if (name == null) { + plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); + return null; + } int productionTime = (int) parseTime(config .getString("production_time")); - switch (config.getString("type")) { + String type = config.getString("type"); + if (type == null) { + plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); + return null; + } + switch (type) { case "PRODUCTION": ItemMap input = parseItemMap(config .getConfigurationSection("input")); From d519afdbcb7c045a897505a758c1460c713dc200 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 16:04:17 +0100 Subject: [PATCH 352/459] Go away tabs --- configCivcraft.yml | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 7abf03ea..c0ddcc4a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -42,7 +42,6 @@ factories: - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor - Upgrade_to_Basic_Forge - - Upgrade_to_Apprentice_Transmuter #Smelting stonesmelter: @@ -313,6 +312,7 @@ factories: - Upgrade_to_Soup_kitchen - Upgrade_to_Bio_Lab - Upgrade_to_Animal_Husbandry_Factory_Basic + - Upgrade_to_Apprentice_Transmuter bakery: type: FCCUPGRADE name: Bakery @@ -1022,8 +1022,8 @@ factories: sort_amount: 64 maximum_materials_per_side: 10 -# Recipes: recipes: + Repair_Rudimentary_Factory: type: REPAIR name: Repair Factory @@ -6447,7 +6447,6 @@ recipes: xp: material: EMERALD_BLOCK amount: 140 - ##Enchanting Recipes #Upgrades @@ -6677,7 +6676,6 @@ recipes: amount: 18 lore: - Compacted Item - #FireProtection Enchant_Helmet_FireP_I: @@ -7072,7 +7070,6 @@ recipes: fireprot1: enchant: PROTECTION_FIRE level: 5 - #Flame Enchant_Flame_I: @@ -7088,7 +7085,6 @@ recipes: enchant_item: bow: material: BOW - #Fire Aspect Enchant_FireAspect_I: @@ -7120,8 +7116,7 @@ recipes: enchants: fireaspect1: enchant: FIRE_ASPECT - level: 1 - + level: 1 #Depth Strider Enchant_DepthStrider_I: @@ -7171,7 +7166,6 @@ recipes: depthstrider2: enchant: DEPTH_STRIDER level: 2 - #Respiration Enchant_Respiration_I: @@ -7221,7 +7215,6 @@ recipes: respiration2: enchant: OXYGEN level: 2 - #Frost Walker #Until 1.9 @@ -7240,7 +7233,6 @@ recipes: enchant_item: helmet: material: DIAMOND_HELMET - #Feather Falling Enchant_FeatherFalling_I: @@ -7307,7 +7299,6 @@ recipes: featherfalling3: enchant: PROTECTION_FALL level: 3 - #BOA Enchant_BOA_I: @@ -7391,10 +7382,9 @@ recipes: baneofarthropods4: enchant: DAMAGE_ARTHROPODS level: 4 - #Infinity - Enchant_Infinity_I: + Enchant_Infinity_I: name: Enchant Bow with Infinity production_time: 1m input: @@ -7406,10 +7396,9 @@ recipes: enchant_item: bow: material: BOW - #Silk Touch - Enchant_Pickaxe_SilkTouch_I: + Enchant_Pickaxe_SilkTouch_I: name: Enchant Pickaxe with Silk Touch production_time: 1m input: @@ -7421,7 +7410,7 @@ recipes: enchant_item: pickaxe: material: DIAMOND_PICKAXE - Enchant_Axe_SilkTouch_I: + Enchant_Axe_SilkTouch_I: name: Enchant Axe with Silk Touch production_time: 1m input: @@ -7433,7 +7422,7 @@ recipes: enchant_item: pickaxe: material: DIAMOND_AXE - Enchant_Shovel_SilkTouch_I: + Enchant_Shovel_SilkTouch_I: name: Enchant Shovel with Silk Touch production_time: 1m input: @@ -7445,7 +7434,7 @@ recipes: enchant_item: pickaxe: material: DIAMOND_SPADE - Enchant_Shears_SilkTouch_I: + Enchant_Shears_SilkTouch_I: name: Enchant Shears with Silk Touch production_time: 1m input: @@ -7457,7 +7446,6 @@ recipes: enchant_item: pickaxe: material: SHEARS - #Protection Enchant_Helmet_Protection_I: @@ -7716,7 +7704,6 @@ recipes: fireprot1: enchant: PROTECTION_ENVIRONMENTAL level: 3 - #BlastProtectionrotection Enchant_Helmet_BlastProtection_I: @@ -7975,7 +7962,6 @@ recipes: blastprot1: enchant: PROTECTION_EXPLOSIONS level: 3 - #Thorns Enchant_Thorns_I: @@ -8008,7 +7994,6 @@ recipes: thorns1: enchant: THORNS level: 1 - #Power Enchant_Power_I: @@ -8350,7 +8335,6 @@ recipes: projprot1: enchant: PROTECTION_PROJECTILE level: 3 - #Punch Enchant_Punch_I: @@ -8383,7 +8367,6 @@ recipes: power1: enchant: ARROW_KNOCKBACK level: 1 - #Sharpness Enchant_Sharpness_I: @@ -8467,7 +8450,6 @@ recipes: sharpness4: enchant: DAMAGE_ALL level: 4 - #Smite Enchant_Smite_I: @@ -8551,7 +8533,6 @@ recipes: smite4: enchant: DAMAGE_UNDEAD level: 4 - #Knockback Enchant_Knockback_I: @@ -8830,7 +8811,6 @@ recipes: eff4: enchant: DIG_SPEED level: 4 - #Unbreaking Tools Enchant_Pickaxe_Unbreaking_I: @@ -8974,7 +8954,6 @@ recipes: ub2: enchant: DURABILITY level: 2 - #Unbreaking Swords Enchant_Sword_Unbreaking_I: @@ -9024,7 +9003,6 @@ recipes: ub2: enchant: DURABILITY level: 2 - #Unbreaking Bows Enchant_Bow_Unbreaking_I: @@ -9074,7 +9052,6 @@ recipes: ub2: enchant: DURABILITY level: 2 - #Unbreaking Armour Enchant_Helmet_Unbreaking_I: @@ -9265,7 +9242,6 @@ recipes: ub2: enchant: DURABILITY level: 2 - #Basic Enchantments Enchant_Efficiency_Pickaxe_Basic: From 76ced3ab9a1c957daa60072a2aa74c7fd89e39ef Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 16:10:19 +0100 Subject: [PATCH 353/459] Spaces --- configCivcraft.yml | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c0ddcc4a..21bcaf4c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -7384,11 +7384,11 @@ recipes: level: 4 #Infinity - Enchant_Infinity_I: - name: Enchant Bow with Infinity - production_time: 1m - input: - emeralds: + Enchant_Infinity_I: + name: Enchant Bow with Infinity + production_time: 1m + input: + emeralds: material: EMERALD amount: 1500 enchant: ARROW_INFINITE @@ -7398,11 +7398,11 @@ recipes: material: BOW #Silk Touch - Enchant_Pickaxe_SilkTouch_I: - name: Enchant Pickaxe with Silk Touch - production_time: 1m - input: - emeralds: + Enchant_Pickaxe_SilkTouch_I: + name: Enchant Pickaxe with Silk Touch + production_time: 1m + input: + emeralds: material: EMERALD amount: 1000 enchant: SILK_TOUCH @@ -7410,11 +7410,11 @@ recipes: enchant_item: pickaxe: material: DIAMOND_PICKAXE - Enchant_Axe_SilkTouch_I: - name: Enchant Axe with Silk Touch - production_time: 1m - input: - emeralds: + Enchant_Axe_SilkTouch_I: + name: Enchant Axe with Silk Touch + production_time: 1m + input: + emeralds: material: EMERALD amount: 1000 enchant: SILK_TOUCH @@ -7422,11 +7422,11 @@ recipes: enchant_item: pickaxe: material: DIAMOND_AXE - Enchant_Shovel_SilkTouch_I: - name: Enchant Shovel with Silk Touch - production_time: 1m - input: - emeralds: + Enchant_Shovel_SilkTouch_I: + name: Enchant Shovel with Silk Touch + production_time: 1m + input: + emeralds: material: EMERALD amount: 1000 enchant: SILK_TOUCH @@ -7434,11 +7434,11 @@ recipes: enchant_item: pickaxe: material: DIAMOND_SPADE - Enchant_Shears_SilkTouch_I: - name: Enchant Shears with Silk Touch - production_time: 1m - input: - emeralds: + Enchant_Shears_SilkTouch_I: + name: Enchant Shears with Silk Touch + production_time: 1m + input: + emeralds: material: EMERALD amount: 4000 enchant: SILK_TOUCH From d648a2d611c425fa5e9cf730426a6f612e739361 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 16:19:21 +0100 Subject: [PATCH 354/459] Added Basic Forge --- configCivcraft.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 21bcaf4c..b3ddf966 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -948,7 +948,7 @@ factories: - Enchant_Bow_Unbreaking_III ## XP Production - woodcauldron: + apprenticetransmuter: type: FCCUPGRADE name: Apprentice Transmuter recipes: @@ -956,7 +956,7 @@ factories: - Cypress_Enrichment - Pine_Enrichment - Upgrade_to_Adept_Transmuter - ironcauldron: + adepttransmuter: type: FCCUPGRADE name: Adept Transmuter recipes: @@ -964,13 +964,14 @@ factories: - Copper_Enrichment - Tin_Enrichment - Upgrade_to_Grandmaster_Transmuter - diamondcauldron: + grandmastertransmuter: type: FCCUPGRADE name: Grandmaster Transmuter recipes: - Amethyst_Enrichment - Topaz_Enrichment - Ruby_Enrichment + #Pipes normalpipe: @@ -6450,6 +6451,16 @@ recipes: ##Enchanting Recipes #Upgrades + Upgrade_to_Basic_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Basic Forge + factory: Basic Forge + fuel_consumption_intervall: 1m + input: + emeralds: + material: EMERALD + amount: 100 Upgrade_to_Ember_Forge: production_time: 1h type: UPGRADE From 27169f49645b5b9b857c363e252b376de6d1c42e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 16:24:35 +0100 Subject: [PATCH 355/459] Fixes to Little Config Things --- configCivcraft.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index b3ddf966..750ab8aa 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -555,6 +555,7 @@ factories: - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic + - Upgrade_to_Emerald_Extractor bastionfactory: type: FCCUPGRADE name: Bastion Factory @@ -732,6 +733,7 @@ factories: name: Ocean Forge recipes: - Enchant_DepthStrider_II + - Enchant_DepthStrider_III - Enchant_AquaAffinity_I - Enchant_Respiration_III # - Enchant_FrostWalker_II @@ -7397,6 +7399,7 @@ recipes: Enchant_Infinity_I: name: Enchant Bow with Infinity + type: ENCHANT production_time: 1m input: emeralds: @@ -7410,6 +7413,7 @@ recipes: #Silk Touch Enchant_Pickaxe_SilkTouch_I: + type: ENCHANT name: Enchant Pickaxe with Silk Touch production_time: 1m input: @@ -7422,6 +7426,7 @@ recipes: pickaxe: material: DIAMOND_PICKAXE Enchant_Axe_SilkTouch_I: + type: ENCHANT name: Enchant Axe with Silk Touch production_time: 1m input: @@ -7435,6 +7440,7 @@ recipes: material: DIAMOND_AXE Enchant_Shovel_SilkTouch_I: name: Enchant Shovel with Silk Touch + type: ENCHANT production_time: 1m input: emeralds: @@ -7447,6 +7453,7 @@ recipes: material: DIAMOND_SPADE Enchant_Shears_SilkTouch_I: name: Enchant Shears with Silk Touch + type: ENCHANT production_time: 1m input: emeralds: @@ -9346,7 +9353,7 @@ recipes: enchant_item: armor: material: DIAMOND_SWORD - Enchant_Sharpness_Sword_Basic: + Enchant_Sharpness_Basic: type: ENCHANT name: Enchant Sword with Sharpness production_time: 1m From cfc16e3c66a0b5b3fe08dcf276ccbc33350e331d Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 16:51:17 +0100 Subject: [PATCH 356/459] More --- configCivcraft.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 750ab8aa..dcc5eddf 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -797,10 +797,10 @@ factories: - Enchant_Leggings_BlastProtection_III - Enchant_Boots_BlastProtection_III - Enchant_Thorns_II - - Upgrade_to_Molten_Forge - moltenforge: + - Upgrade_to_Meteor_Forge + Meteorforge: type: FCCUPGRADE - name: Molten Forge + name: Meteor Forge recipes: - Enchant_Helmet_Protection_IV - Enchant_Chestplate_Protection_IV @@ -8002,7 +8002,7 @@ recipes: input: emeralds: material: EMERALD - amount: 450 + amount: 150 enchant: THORNS level: 2 enchant_item: @@ -8012,6 +8012,23 @@ recipes: thorns1: enchant: THORNS level: 1 + Enchant_Thorns_III: + type: ENCHANT + name: Enchant Chestplate with Thorns III + production_time: 1m + input: + emeralds: + material: EMERALD + amount: 450 + enchant: THORNS + level: 3 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + thorns2: + enchant: THORNS + level: 2 #Power Enchant_Power_I: From 870db8e1cfa7eefe4821a0e5bbf58404e69b311b Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 17:29:08 +0100 Subject: [PATCH 357/459] Removed silk shears, added previous tier recipes --- configCivcraft.yml | 209 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 168 insertions(+), 41 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index dcc5eddf..bf42eb4f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -687,16 +687,16 @@ factories: name: Ember Forge recipes: - Enchant_Helmet_FireP_I - - Enchant_Chestplate_FireP_I - - Enchant_Leggings_FireP_I - - Enchant_Boots_FireP_I - Enchant_Helmet_FireP_II - - Enchant_Chestplate_FireP_II - - Enchant_Leggings_FireP_II - - Enchant_Boots_FireP_II - Enchant_Helmet_FireP_III + - Enchant_Chestplate_FireP_I + - Enchant_Chestplate_FireP_II - Enchant_Chestplate_FireP_III + - Enchant_Leggings_FireP_I + - Enchant_Leggings_FireP_II - Enchant_Leggings_FireP_III + - Enchant_Boots_FireP_I + - Enchant_Boots_FireP_II - Enchant_Boots_FireP_III - Enchant_FireAspect_I - Upgrade_to_Magma_Forge @@ -704,19 +704,32 @@ factories: type: FCCUPGRADE name: Magma Forge recipes: + - Enchant_Helmet_FireP_I + - Enchant_Helmet_FireP_II + - Enchant_Helmet_FireP_III - Enchant_Helmet_FireP_IV - - Enchant_Chestplate_FireP_IV - - Enchant_Leggings_FireP_IV - - Enchant_Boots_FireP_IV - Enchant_Helmet_FireP_V - - Enchant_Chestplate_FireP_V - - Enchant_Leggings_FireP_V - - Enchant_Boots_FireP_V - Enchant_Helmet_FireP_VI + - Enchant_Chestplate_FireP_I + - Enchant_Chestplate_FireP_II + - Enchant_Chestplate_FireP_III + - Enchant_Chestplate_FireP_IV + - Enchant_Chestplate_FireP_V - Enchant_Chestplate_FireP_VI + - Enchant_Leggings_FireP_I + - Enchant_Leggings_FireP_II + - Enchant_Leggings_FireP_III + - Enchant_Leggings_FireP_IV + - Enchant_Leggings_FireP_V - Enchant_Leggings_FireP_VI + - Enchant_Boots_FireP_I + - Enchant_Boots_FireP_II + - Enchant_Boots_FireP_III + - Enchant_Boots_FireP_IV + - Enchant_Boots_FireP_V - Enchant_Boots_FireP_VI - Enchant_Flame_I + - Enchant_FireAspect_I - Enchant_FireAspect_II #Water riverforge: @@ -732,9 +745,12 @@ factories: type: FCCUPGRADE name: Ocean Forge recipes: + - Enchant_DepthStrider_I - Enchant_DepthStrider_II - Enchant_DepthStrider_III - Enchant_AquaAffinity_I + - Enchant_Respiration_I + - Enchant_Respiration_II - Enchant_Respiration_III # - Enchant_FrostWalker_II #Magic @@ -756,9 +772,13 @@ factories: - Enchant_Pickaxe_SilkTouch_I - Enchant_Axe_SilkTouch_I - Enchant_Shovel_SilkTouch_I - - Enchant_Shears_SilkTouch_I + - Enchant_FeatherFalling_I + - Enchant_FeatherFalling_II - Enchant_FeatherFalling_III - Enchant_FeatherFalling_IV + - Enchant_BOA_I + - Enchant_BOA_II + - Enchant_BOA_III - Enchant_BOA_IV - Enchant_BOA_V #Armor @@ -780,36 +800,73 @@ factories: type: FCCUPGRADE name: Titanium Forge recipes: + - Enchant_Helmet_Protection_I - Enchant_Helmet_Protection_II - - Enchant_Chestplate_Protection_II - - Enchant_Leggings_Protection_II - - Enchant_Boots_Protection_II - Enchant_Helmet_Protection_III + - Enchant_Chestplate_Protection_I + - Enchant_Chestplate_Protection_II - Enchant_Chestplate_Protection_III + - Enchant_Leggings_Protection_I + - Enchant_Leggings_Protection_II - Enchant_Leggings_Protection_III + - Enchant_Boots_Protection_I + - Enchant_Boots_Protection_II - Enchant_Boots_Protection_III + - Enchant_Helmet_BlastProtection_I - Enchant_Helmet_BlastProtection_II - - Enchant_Chestplate_BlastProtection_II - - Enchant_Leggings_BlastProtection_II - - Enchant_Boots_BlastProtection_II - Enchant_Helmet_BlastProtection_III + - Enchant_Chestplate_BlastProtection_I + - Enchant_Chestplate_BlastProtection_II - Enchant_Chestplate_BlastProtection_III + - Enchant_Leggings_BlastProtection_I + - Enchant_Leggings_BlastProtection_II - Enchant_Leggings_BlastProtection_III + - Enchant_Boots_BlastProtection_I + - Enchant_Boots_BlastProtection_II - Enchant_Boots_BlastProtection_III + - Enchant_Helmet_BlastProtection_III + - Enchant_Thorns_I - Enchant_Thorns_II - Upgrade_to_Meteor_Forge Meteorforge: type: FCCUPGRADE name: Meteor Forge recipes: + - Enchant_Helmet_Protection_I + - Enchant_Helmet_Protection_II + - Enchant_Helmet_Protection_III - Enchant_Helmet_Protection_IV + - Enchant_Chestplate_Protection_I + - Enchant_Chestplate_Protection_II + - Enchant_Chestplate_Protection_III - Enchant_Chestplate_Protection_IV + - Enchant_Leggings_Protection_I + - Enchant_Leggings_Protection_II + - Enchant_Leggings_Protection_III - Enchant_Leggings_Protection_IV + - Enchant_Boots_Protection_I + - Enchant_Boots_Protection_II + - Enchant_Boots_Protection_III - Enchant_Boots_Protection_IV + - Enchant_Helmet_BlastProtection_I + - Enchant_Helmet_BlastProtection_II + - Enchant_Helmet_BlastProtection_III - Enchant_Helmet_BlastProtection_IV + - Enchant_Chestplate_BlastProtection_I + - Enchant_Chestplate_BlastProtection_II + - Enchant_Chestplate_BlastProtection_III - Enchant_Chestplate_BlastProtection_IV + - Enchant_Leggings_BlastProtection_I + - Enchant_Leggings_BlastProtection_II + - Enchant_Leggings_BlastProtection_III - Enchant_Leggings_BlastProtection_IV - - Enchant_Boots_BlastProtection_IV + - Enchant_Boots_BlastProtection_I + - Enchant_Boots_BlastProtection_II + - Enchant_Boots_BlastProtection_III + - Enchant_Helmet_BlastProtection_III + - Enchant_Helmet_BlastProtection_IV + - Enchant_Thorns_I + - Enchant_Thorns_II - Enchant_Thorns_III #Archery archerforge: @@ -827,27 +884,52 @@ factories: type: FCCUPGRADE name: Marksman Forge recipes: + - Enchant_Power_I + - Enchant_Power_II - Enchant_Power_III - Enchant_Power_IV + - Enchant_Helmet_ProjectileProtection_I - Enchant_Helmet_ProjectileProtection_II - - Enchant_Chestplate_ProjectileProtection_II - - Enchant_Leggings_ProjectileProtection_II - - Enchant_Boots_ProjectileProtection_II - Enchant_Helmet_ProjectileProtection_III + - Enchant_Chestplate_ProjectileProtection_I + - Enchant_Chestplate_ProjectileProtection_II - Enchant_Chestplate_ProjectileProtection_III + - Enchant_Leggings_ProjectileProtection_I + - Enchant_Leggings_ProjectileProtection_II - Enchant_Leggings_ProjectileProtection_III + - Enchant_Boots_ProjectileProtection_I + - Enchant_Boots_ProjectileProtection_II - Enchant_Boots_ProjectileProtection_III + - Enchant_Helmet_ProjectileProtection_III - Enchant_Punch_I - Upgrade_to_Sniper_Forge sniperforge: type: FCCUPGRADE name: Sniper Forge recipes: + - Enchant_Power_I + - Enchant_Power_II + - Enchant_Power_III + - Enchant_Power_IV - Enchant_Power_V + - Enchant_Helmet_ProjectileProtection_I + - Enchant_Helmet_ProjectileProtection_II + - Enchant_Helmet_ProjectileProtection_III - Enchant_Helmet_ProjectileProtection_IV + - Enchant_Chestplate_ProjectileProtection_I + - Enchant_Chestplate_ProjectileProtection_II + - Enchant_Chestplate_ProjectileProtection_III - Enchant_Chestplate_ProjectileProtection_IV + - Enchant_Leggings_ProjectileProtection_I + - Enchant_Leggings_ProjectileProtection_II + - Enchant_Leggings_ProjectileProtection_III - Enchant_Leggings_ProjectileProtection_IV - - Enchant_Boots_ProjectileProtection_IV + - Enchant_Boots_ProjectileProtection_I + - Enchant_Boots_ProjectileProtection_II + - Enchant_Boots_ProjectileProtection_III + - Enchant_Helmet_ProjectileProtection_III + - Enchant_Helmet_ProjectileProtection_IV + - Enchant_Punch_I - Enchant_Punch_II #Swords daggerforge: @@ -863,8 +945,12 @@ factories: type: FCCUPGRADE name: Sword Forge recipes: + - Enchant_Sharpness_I + - Enchant_Sharpness_II - Enchant_Sharpness_III - Enchant_Sharpness_IV + - Enchant_Smite_I + - Enchant_Smite_II - Enchant_Smite_III - Enchant_Smite_IV - Enchant_Knockback_I @@ -873,8 +959,17 @@ factories: type: FCCUPGRADE name: Blade Forge recipes: + - Enchant_Sharpness_I + - Enchant_Sharpness_II + - Enchant_Sharpness_III + - Enchant_Sharpness_IV - Enchant_Sharpness_V + - Enchant_Smite_I + - Enchant_Smite_II + - Enchant_Smite_III + - Enchant_Smite_IV - Enchant_Smite_V + - Enchant_Knockback_I - Enchant_Knockback_II #Efficiency quickforge: @@ -882,29 +977,47 @@ factories: name: Quick Forge recipes: - Enchant_Pickaxe_Efficiency_I - - Enchant_Axe_Efficiency_I - - Enchant_Shovel_Efficiency_I - Enchant_Pickaxe_Efficiency_II + - Enchant_Axe_Efficiency_I - Enchant_Axe_Efficiency_II + - Enchant_Shovel_Efficiency_I - Enchant_Shovel_Efficiency_II - Upgrade_to_Rapid_Forge rapidforge: type: FCCUPGRADE name: Rapid Forge recipes: + - Enchant_Pickaxe_Efficiency_I + - Enchant_Pickaxe_Efficiency_II - Enchant_Pickaxe_Efficiency_III - - Enchant_Axe_Efficiency_III - - Enchant_Shovel_Efficiency_III - Enchant_Pickaxe_Efficiency_IV + - Enchant_Axe_Efficiency_I + - Enchant_Axe_Efficiency_II + - Enchant_Axe_Efficiency_III - Enchant_Axe_Efficiency_IV + - Enchant_Shovel_Efficiency_I + - Enchant_Shovel_Efficiency_II + - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Upgrade_to_Sonic_Forge sonicforge: type: FCCUPGRADE name: Sonic Forge recipes: + - Enchant_Pickaxe_Efficiency_I + - Enchant_Pickaxe_Efficiency_II + - Enchant_Pickaxe_Efficiency_III + - Enchant_Pickaxe_Efficiency_IV - Enchant_Pickaxe_Efficiency_V + - Enchant_Axe_Efficiency_I + - Enchant_Axe_Efficiency_II + - Enchant_Axe_Efficiency_III + - Enchant_Axe_Efficiency_IV - Enchant_Axe_Efficiency_V + - Enchant_Shovel_Efficiency_I + - Enchant_Shovel_Efficiency_II + - Enchant_Shovel_Efficiency_III + - Enchant_Shovel_Efficiency_IV - Enchant_Shovel_Efficiency_V #Unbreaking rockforge: @@ -925,28 +1038,55 @@ factories: type: FCCUPGRADE name: Metal Forge recipes: + - Enchant_Pickaxe_Unbreaking_I - Enchant_Pickaxe_Unbreaking_II + - Enchant_Axe_Unbreaking_I - Enchant_Axe_Unbreaking_II + - Enchant_Shovel_Unbreaking_I - Enchant_Shovel_Unbreaking_II + - Enchant_Helmet_Unbreaking_I - Enchant_Helmet_Unbreaking_II + - Enchant_Chestplate_Unbreaking_I - Enchant_Chestplate_Unbreaking_II + - Enchant_Leggings_Unbreaking_I - Enchant_Leggings_Unbreaking_II + - Enchant_Boots_Unbreaking_I - Enchant_Boots_Unbreaking_II + - Enchant_Sword_Unbreaking_I - Enchant_Sword_Unbreaking_II + - Enchant_Bow_Unbreaking_I - Enchant_Bow_Unbreaking_II - Upgrade_to_Carbon_Forge carbonforge: type: FCCUPGRADE name: Carbon Forge recipes: + - Enchant_Pickaxe_Unbreaking_I + - Enchant_Pickaxe_Unbreaking_II - Enchant_Pickaxe_Unbreaking_III + - Enchant_Axe_Unbreaking_I + - Enchant_Axe_Unbreaking_II - Enchant_Axe_Unbreaking_III + - Enchant_Shovel_Unbreaking_I + - Enchant_Shovel_Unbreaking_II - Enchant_Shovel_Unbreaking_III + - Enchant_Helmet_Unbreaking_I + - Enchant_Helmet_Unbreaking_II - Enchant_Helmet_Unbreaking_III + - Enchant_Chestplate_Unbreaking_I + - Enchant_Chestplate_Unbreaking_II - Enchant_Chestplate_Unbreaking_III + - Enchant_Leggings_Unbreaking_I + - Enchant_Leggings_Unbreaking_II - Enchant_Leggings_Unbreaking_III + - Enchant_Boots_Unbreaking_I + - Enchant_Boots_Unbreaking_II - Enchant_Boots_Unbreaking_III + - Enchant_Sword_Unbreaking_I + - Enchant_Sword_Unbreaking_II - Enchant_Sword_Unbreaking_III + - Enchant_Bow_Unbreaking_I + - Enchant_Bow_Unbreaking_II - Enchant_Bow_Unbreaking_III ## XP Production @@ -7451,19 +7591,6 @@ recipes: enchant_item: pickaxe: material: DIAMOND_SPADE - Enchant_Shears_SilkTouch_I: - name: Enchant Shears with Silk Touch - type: ENCHANT - production_time: 1m - input: - emeralds: - material: EMERALD - amount: 4000 - enchant: SILK_TOUCH - level: 1 - enchant_item: - pickaxe: - material: SHEARS #Protection Enchant_Helmet_Protection_I: From 94a707f9065cdfb2cbce1a55f47ccad6e57f54d3 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sat, 9 Apr 2016 17:34:27 +0100 Subject: [PATCH 358/459] Fix to recipe list --- configCivcraft.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index bf42eb4f..61004899 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -863,8 +863,7 @@ factories: - Enchant_Boots_BlastProtection_I - Enchant_Boots_BlastProtection_II - Enchant_Boots_BlastProtection_III - - Enchant_Helmet_BlastProtection_III - - Enchant_Helmet_BlastProtection_IV + - Enchant_Boots_BlastProtection_IV - Enchant_Thorns_I - Enchant_Thorns_II - Enchant_Thorns_III @@ -927,8 +926,7 @@ factories: - Enchant_Boots_ProjectileProtection_I - Enchant_Boots_ProjectileProtection_II - Enchant_Boots_ProjectileProtection_III - - Enchant_Helmet_ProjectileProtection_III - - Enchant_Helmet_ProjectileProtection_IV + - Enchant_Boots_ProjectileProtection_IV - Enchant_Punch_I - Enchant_Punch_II #Swords From d73283e496e879f38c4a92463cd3d7672d5423d5 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 18:38:45 +0200 Subject: [PATCH 359/459] Additional config parsing error messages --- .../igotyou/FactoryMod/ConfigParser.java | 4 +++ .../igotyou/FactoryMod/FactoryModManager.java | 33 +++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 3ddbd49a..bcce4e3b 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -146,6 +146,10 @@ public void run() { private void parseRecipes(ConfigurationSection config) { recipes = new HashMap(); for (String key : config.getKeys(false)) { + if (config.getConfigurationSection(key) == null) { + plugin.warning("Found invalid section that should not exist at " + config.getCurrentPath() + key); + continue; + } IRecipe recipe = parseRecipe(config.getConfigurationSection(key)); if (recipe == null) { plugin.warning(String.format("Recipe %s unable to be added.", key)); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 8ea6557b..cf03f082 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -244,9 +244,11 @@ public void attemptCreation(Block b, Player p) { .get(FurnCraftChestStructure.class); if (eggs != null) { IFactoryEgg egg = null; - for(Entry entry: eggs.entrySet()) { - if (entry.getKey().containedExactlyIn(((Chest) (fccs - .getChest().getState())).getInventory())) { + for (Entry entry : eggs + .entrySet()) { + if (entry.getKey().containedExactlyIn( + ((Chest) (fccs.getChest().getState())) + .getInventory())) { egg = entry.getValue(); break; } @@ -287,9 +289,11 @@ public void attemptCreation(Block b, Player p) { .get(PipeStructure.class); if (eggs != null) { IFactoryEgg egg = null; - for(Entry entry: eggs.entrySet()) { - if (entry.getKey().containedExactlyIn((((Dispenser) (ps - .getStart().getState())).getInventory()))) { + for (Entry entry : eggs + .entrySet()) { + if (entry.getKey().containedExactlyIn( + (((Dispenser) (ps.getStart().getState())) + .getInventory()))) { egg = entry.getValue(); break; } @@ -339,10 +343,11 @@ public void attemptCreation(Block b, Player p) { .get(BlockFurnaceStructure.class); if (eggs != null) { IFactoryEgg egg = null; - for(Entry entry: eggs.entrySet()) { - if (entry.getKey().containedExactlyIn(((Dropper) (bfs - .getCenter().getBlock().getState())) - .getInventory())) { + for (Entry entry : eggs + .entrySet()) { + if (entry.getKey().containedExactlyIn( + ((Dropper) (bfs.getCenter().getBlock() + .getState())).getInventory())) { egg = entry.getValue(); break; } @@ -401,6 +406,14 @@ private ItemMap calculateTotalSetupCost(IFactoryEgg egg) { if (recipe instanceof Upgraderecipe && ((Upgraderecipe) recipe).getEgg() == egg) { map = calculateTotalSetupCost(superEgg); + if (map == null) { + plugin.warning("Could not calculate total setupcost for " + + egg.getName() + + ". It's parent factory " + + superEgg.getName() + + " is impossible to set up"); + break; + } map = map.clone(); // so we dont mess with the original // setup costs map.merge(((Upgraderecipe) recipe).getInput()); From b546d7196407d91dc5b0a6773a1b41898e2b57ed Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 20:23:46 +0200 Subject: [PATCH 360/459] Add material return recipe for emerald extractor --- configCivcraft.yml | 11 +++ .../igotyou/FactoryMod/ConfigParser.java | 15 ++- .../recipes/FactoryMaterialReturnRecipe.java | 95 +++++++++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java diff --git a/configCivcraft.yml b/configCivcraft.yml index 61004899..fbb9c772 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -627,6 +627,7 @@ factories: name: Emerald Extractor recipes: - Repair_Expert_Factory + - Return_Materials basicpylon: type: FCCUPGRADE name: Basic Pylon @@ -9508,3 +9509,13 @@ recipes: enchant_item: armor: material: DIAMOND_SWORD + +#Destroy factory and returns the setup cost multiplied by a given factor + Return_Materials: + type: COSTRETURN + production_time: 10s + name: Destroy Factory + factor: 1.0 + input: + dirt: + material: DIRT diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index bcce4e3b..ecaa8c7b 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -30,6 +30,7 @@ import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DeterministicEnchantingRecipe; +import com.github.igotyou.FactoryMod.recipes.FactoryMaterialReturnRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; @@ -443,8 +444,12 @@ private IRecipe parseRecipe(ConfigurationSection config) { plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); return null; } - int productionTime = (int) parseTime(config - .getString("production_time")); + String prodTime = config.getString("production_time"); + if (prodTime == null) { + plugin.warning("No production time specied for recipe " + name + ". Skipping it"); + return null; + } + int productionTime = (int) parseTime(prodTime); String type = config.getString("type"); if (type == null) { plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); @@ -550,6 +555,12 @@ private IRecipe parseRecipe(ConfigurationSection config) { } result = new RandomOutputRecipe(name, productionTime, inpu, outputs); break; + case "COSTRETURN": + ItemMap costIn = parseItemMap(config + .getConfigurationSection("input")); + double factor = config.getDouble("factor", 1.0); + result = new FactoryMaterialReturnRecipe(name, productionTime, costIn, factor); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java new file mode 100644 index 00000000..12c446b0 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -0,0 +1,95 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.List; +import java.util.Map.Entry; + +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemFlag; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +public class FactoryMaterialReturnRecipe extends InputRecipe { + + private double factor; + + public FactoryMaterialReturnRecipe(String name, int productionTime, + ItemMap input, double factor) { + super(name, productionTime, input); + this.factor = factor; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public List getOutputRepresentation(Inventory i) { + BlockState bs = (BlockState) i.getHolder(); + Location loc = bs.getLocation(); + FurnCraftChestFactory fcc = (FurnCraftChestFactory) FactoryMod + .getManager().getFactoryAt(loc); + return FactoryMod.getManager().getTotalSetupCost(fcc) + .getItemStackRepresentation(); + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = new ItemStack(Material.WORKBENCH); + ISUtils.setName(is, name); + ItemMeta im = is.getItemMeta(); + im.addEnchant(Enchantment.DAMAGE_ALL, 1, true); + im.addItemFlags(ItemFlag.HIDE_ENCHANTS); + is.setItemMeta(im); + return is; + } + + public void applyEffect(Inventory i, final Factory f) { + FactoryMod.getManager().removeFactory(f); + for (Block b : f.getMultiBlockStructure().getRelevantBlocks()) { + b.setType(Material.AIR); + } + Bukkit.getScheduler().runTaskLater(FactoryMod.getPlugin(), + new Runnable() { + @Override + public void run() { + Location dropLoc = f.getMultiBlockStructure() + .getCenter(); + for (Entry items : FactoryMod + .getManager().getTotalSetupCost(f) + .getEntrySet()) { + int returnAmount = (int) (items.getValue() * factor); + ItemMap im = new ItemMap(); + im.addItemAmount(items.getKey(), returnAmount); + for (ItemStack is : im.getItemStackRepresentation()) { + if (is.getDurability() == -1) { + is.setDurability((short) 0); + } + dropLoc.getWorld().dropItemNaturally(dropLoc, + is); + } + } + dropLoc.getWorld().dropItemNaturally(dropLoc, new ItemStack(Material.WORKBENCH)); + dropLoc.getWorld().dropItemNaturally(dropLoc, new ItemStack(Material.FURNACE)); + dropLoc.getWorld().dropItemNaturally(dropLoc, new ItemStack(Material.CHEST)); + } + }, 1L); + } + + public double getFactor() { + return factor; + } +} From f181d0e0a00ff130c2b389a62c56ae63aaaabbfa Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sat, 9 Apr 2016 20:50:50 +0200 Subject: [PATCH 361/459] Fix few identifers --- configCivcraft.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index fbb9c772..94b79733 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6245,7 +6245,7 @@ recipes: amount: 128 durability: -1 netherwart: - material: NETHER_WARTS + material: NETHER_STALK amount: 32 aether: material: GOLD_NUGGET @@ -6330,7 +6330,7 @@ recipes: amount: 640 durability: 0 netherwart: - material: NETHER_WARTS + material: NETHER_STALK amount: 160 melons: material: MELON_BLOCK @@ -6367,8 +6367,9 @@ recipes: material: CACTUS amount: 320 cocoa: - material: COCOA + material: INK_SACK amount: 256 + durability: 3 beef: material: RAW_BEEF amount: 32 @@ -6443,7 +6444,7 @@ recipes: lore: - Compacted Item netherwart: - material: NETHER_WARTS + material: NETHER_STALK amount: 15 lore: - Compacted Item @@ -6504,8 +6505,9 @@ recipes: lore: - Compacted Item cocoa: - material: COCOA + material: INK_SACK amount: 20 + durability: 3 lore: - Compacted Item beef: From 1e3062f64304e549f5fc8ee08e14f88b78e4c2bb Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 10 Apr 2016 17:05:15 +0100 Subject: [PATCH 362/459] Temporarily removed meat cost + doubled XP outputs --- configCivcraft.yml | 54 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 94b79733..4daf9787 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6258,7 +6258,7 @@ recipes: output: xp: material: EMERALD - amount: 20 + amount: 40 Cypress_Enrichment: name: Cypress Enrichment type: PRODUCTION @@ -6286,7 +6286,7 @@ recipes: output: xp: material: EMERALD - amount: 20 + amount: 40 Pine_Enrichment: name: Pine Enrichment type: PRODUCTION @@ -6314,7 +6314,7 @@ recipes: output: xp: material: EMERALD - amount: 20 + amount: 40 Lead_Enrichment: name: Lead Enrichment @@ -6335,9 +6335,9 @@ recipes: melons: material: MELON_BLOCK amount: 128 - chicken: - material: RAW_CHICKEN - amount: 32 +# chicken: +# material: RAW_CHICKEN +# amount: 32 aether: material: GOLD_NUGGET amount: 168 @@ -6349,7 +6349,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 19 + amount: 38 Copper_Enrichment: name: Copper Enrichment type: PRODUCTION @@ -6370,9 +6370,9 @@ recipes: material: INK_SACK amount: 256 durability: 3 - beef: - material: RAW_BEEF - amount: 32 +# beef: +# material: RAW_BEEF +# amount: 32 aether: material: GOLD_NUGGET amount: 168 @@ -6384,7 +6384,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 19 + amount: 38 Tin_Enrichment: name: Tin Enrichment type: PRODUCTION @@ -6404,9 +6404,9 @@ recipes: pumpkins: material: PUMPKIN amount: 128 - pork: - material: PORK - amount: 32 +# pork: +# material: PORK +# amount: 32 aether: material: GOLD_NUGGET amount: 168 @@ -6418,7 +6418,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 19 + amount: 38 Amethyst_Enrichment: name: Amethyst Enrichment @@ -6453,9 +6453,9 @@ recipes: amount: 10 lore: - Compacted Item - chicken: - material: RAW_CHICKEN - amount: 160 +# chicken: +# material: RAW_CHICKEN +# amount: 160 inksacs: material: INK_SACK amount: 64 @@ -6475,7 +6475,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 140 + amount: 280 Topaz_Enrichment: name: Topaz Enrichment type: PRODUCTION @@ -6510,9 +6510,9 @@ recipes: durability: 3 lore: - Compacted Item - beef: - material: RAW_BEEF - amount: 160 +# beef: +# material: RAW_BEEF +# amount: 160 clownfish: material: RAW_FISH amount: 3 @@ -6533,7 +6533,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 140 + amount: 280 Ruby_Enrichment: name: Ruby Enrichment type: PRODUCTION @@ -6567,9 +6567,9 @@ recipes: amount: 10 lore: - Compacted Item - pork: - material: PORK - amount: 160 +# pork: +# material: PORK +# amount: 160 salmon: material: RAW_FISH amount: 19 @@ -6590,7 +6590,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 140 + amount: 280 ##Enchanting Recipes #Upgrades From fccfea59c35ccf6a6f9365cdfaa8c25d60e09a9e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Sun, 10 Apr 2016 18:55:15 +0100 Subject: [PATCH 363/459] Made lower tier XP recipes available for higher-tier factories. --- configCivcraft.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 4daf9787..a29e2747 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1101,6 +1101,9 @@ factories: type: FCCUPGRADE name: Adept Transmuter recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment - Lead_Enrichment - Copper_Enrichment - Tin_Enrichment @@ -1109,6 +1112,12 @@ factories: type: FCCUPGRADE name: Grandmaster Transmuter recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment + - Lead_Enrichment + - Copper_Enrichment + - Tin_Enrichment - Amethyst_Enrichment - Topaz_Enrichment - Ruby_Enrichment From d59808fe5534e8dc5655ccf7d050a92785302c62 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Sun, 10 Apr 2016 22:28:40 +0200 Subject: [PATCH 364/459] Add enchants unsafe --- pom.xml | 2 +- .../recipes/DeterministicEnchantingRecipe.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index c8ffd9d9..c1f4c2e9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.0 + 2.1.1 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index e4c7c3a2..372ff47c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -44,16 +44,20 @@ public boolean enoughMaterialAvailable(Inventory i) { public ItemStack getRecipeRepresentation() { ItemStack is = tool.getItemStackRepresentation().get(0); - is.removeEnchantment(enchant); - is.addEnchantment(enchant, level); + ItemMeta im = is.getItemMeta(); + im.removeEnchant(enchant); + is.addUnsafeEnchantment(enchant, level); + is.setItemMeta(im); ISUtils.setName(is, name); return is; } public List getOutputRepresentation(Inventory i) { ItemStack is = tool.getItemStackRepresentation().get(0); - is.removeEnchantment(enchant); - is.addEnchantment(enchant, level); + ItemMeta im = is.getItemMeta(); + im.removeEnchant(enchant); + is.addUnsafeEnchantment(enchant, level); + is.setItemMeta(im); if (i != null) { ISUtils.addLore( is, From 97ceb49268da6142b6d75aab42e858c41025e492 Mon Sep 17 00:00:00 2001 From: maxopoly Date: Mon, 11 Apr 2016 01:55:21 +0200 Subject: [PATCH 365/459] Fix determ enchant recipe gui for real this time --- .../FactoryMod/recipes/DeterministicEnchantingRecipe.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index 372ff47c..cd2ab171 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -46,7 +46,7 @@ public ItemStack getRecipeRepresentation() { ItemStack is = tool.getItemStackRepresentation().get(0); ItemMeta im = is.getItemMeta(); im.removeEnchant(enchant); - is.addUnsafeEnchantment(enchant, level); + im.addEnchant(enchant, level, true); is.setItemMeta(im); ISUtils.setName(is, name); return is; @@ -56,7 +56,7 @@ public List getOutputRepresentation(Inventory i) { ItemStack is = tool.getItemStackRepresentation().get(0); ItemMeta im = is.getItemMeta(); im.removeEnchant(enchant); - is.addUnsafeEnchantment(enchant, level); + im.addEnchant(enchant, level, true); is.setItemMeta(im); if (i != null) { ISUtils.addLore( From 6411913a83ca6aa110b3deb89f41b09a42a645ca Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Mon, 11 Apr 2016 14:45:42 +0100 Subject: [PATCH 366/459] Change enchant times from 1m to 15s --- configCivcraft.yml | 302 ++++++++++++++++++++++----------------------- 1 file changed, 151 insertions(+), 151 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 4daf9787..3bf42e2c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6835,7 +6835,7 @@ recipes: Enchant_Helmet_FireP_I: type: ENCHANT name: Enchant Helmet with Fire Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6848,7 +6848,7 @@ recipes: Enchant_Chestplate_FireP_I: type: ENCHANT name: Enchant Chestplate with Fire Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6861,7 +6861,7 @@ recipes: Enchant_Leggings_FireP_I: type: ENCHANT name: Enchant Leggings with Fire Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6874,7 +6874,7 @@ recipes: Enchant_Boots_FireP_I: type: ENCHANT name: Enchant Boots with Fire Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6955,7 +6955,7 @@ recipes: Enchant_Helmet_FireP_III: type: ENCHANT name: Enchant Helmet with Fire Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6972,7 +6972,7 @@ recipes: Enchant_Chestplate_FireP_III: type: ENCHANT name: Enchant Chestplate with Fire Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -6989,7 +6989,7 @@ recipes: Enchant_Leggings_FireP_III: type: ENCHANT name: Enchant Leggings with Fire Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7006,7 +7006,7 @@ recipes: Enchant_Boots_FireP_III: type: ENCHANT name: Enchant Boots with Fire Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7023,7 +7023,7 @@ recipes: Enchant_Helmet_FireP_IV: type: ENCHANT name: Enchant Helmet with Fire Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7040,7 +7040,7 @@ recipes: Enchant_Chestplate_FireP_IV: type: ENCHANT name: Enchant Chestplate with Fire Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7057,7 +7057,7 @@ recipes: Enchant_Leggings_FireP_IV: type: ENCHANT name: Enchant Leggings with Fire Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7074,7 +7074,7 @@ recipes: Enchant_Boots_FireP_IV: type: ENCHANT name: Enchant Boots with Fire Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7091,7 +7091,7 @@ recipes: Enchant_Helmet_FireP_V: type: ENCHANT name: Enchant Helmet with Fire Protection V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7108,7 +7108,7 @@ recipes: Enchant_Chestplate_FireP_V: type: ENCHANT name: Enchant Chestplate with Fire Protection V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7125,7 +7125,7 @@ recipes: Enchant_Leggings_FireP_V: type: ENCHANT name: Enchant Leggings with Fire Protection V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7142,7 +7142,7 @@ recipes: Enchant_Boots_FireP_V: type: ENCHANT name: Enchant Boots with Fire Protection V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7159,7 +7159,7 @@ recipes: Enchant_Helmet_FireP_VI: type: ENCHANT name: Enchant Helmet with Fire Protection VI - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7176,7 +7176,7 @@ recipes: Enchant_Chestplate_FireP_VI: type: ENCHANT name: Enchant Chestplate with Fire Protection VI - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7193,7 +7193,7 @@ recipes: Enchant_Leggings_FireP_VI: type: ENCHANT name: Enchant Leggings with Fire Protection VI - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7210,7 +7210,7 @@ recipes: Enchant_Boots_FireP_VI: type: ENCHANT name: Enchant Boots with Fire Protection VI - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7229,7 +7229,7 @@ recipes: Enchant_Flame_I: type: ENCHANT name: Enchant Bow with Flame I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7244,7 +7244,7 @@ recipes: Enchant_FireAspect_I: type: ENCHANT name: Enchant Sword with Fire Aspect I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7257,7 +7257,7 @@ recipes: Enchant_FireAspect_II: type: ENCHANT name: Enchant Sword with Fire Aspect II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7276,7 +7276,7 @@ recipes: Enchant_DepthStrider_I: type: ENCHANT name: Enchant Boots with Depth Strider I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7289,7 +7289,7 @@ recipes: Enchant_DepthStrider_II: type: ENCHANT name: Enchant Boots with Depth Strider II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7306,7 +7306,7 @@ recipes: Enchant_DepthStrider_III: type: ENCHANT name: Enchant Boots with Depth Strider III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7325,7 +7325,7 @@ recipes: Enchant_Respiration_I: type: ENCHANT name: Enchant Helmet with Respiration I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7338,7 +7338,7 @@ recipes: Enchant_Respiration_II: type: ENCHANT name: Enchant Helmet with Respiration II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7355,7 +7355,7 @@ recipes: Enchant_Respiration_III: type: ENCHANT name: Enchant Helmet with Respiration III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7377,7 +7377,7 @@ recipes: Enchant_AquaAffinity_I: type: ENCHANT name: Enchant Helmet with Aqua Affinity - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7392,7 +7392,7 @@ recipes: Enchant_FeatherFalling_I: type: ENCHANT name: Enchant Boots with FeatherFalling I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7405,7 +7405,7 @@ recipes: Enchant_FeatherFalling_II: type: ENCHANT name: Enchant Boots with FeatherFalling II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7422,7 +7422,7 @@ recipes: Enchant_FeatherFalling_III: type: ENCHANT name: Enchant Boots with FeatherFalling III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7439,7 +7439,7 @@ recipes: Enchant_FeatherFalling_IV: type: ENCHANT name: Enchant Boots with FeatherFalling IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7458,7 +7458,7 @@ recipes: Enchant_BOA_I: type: ENCHANT name: Enchant Sword with Bane of Arthropods I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7471,7 +7471,7 @@ recipes: Enchant_BOA_II: type: ENCHANT name: Enchant Sword with Bane of Arthropods II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7488,7 +7488,7 @@ recipes: Enchant_BOA_III: type: ENCHANT name: Enchant Sword with Bane of Arthropods III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7505,7 +7505,7 @@ recipes: Enchant_BOA_IV: type: ENCHANT name: Enchant Sword with Bane of Arthropods IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7522,7 +7522,7 @@ recipes: Enchant_BOA_V: type: ENCHANT name: Enchant Sword with Bane of Arthropods V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7541,7 +7541,7 @@ recipes: Enchant_Infinity_I: name: Enchant Bow with Infinity type: ENCHANT - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7556,7 +7556,7 @@ recipes: Enchant_Pickaxe_SilkTouch_I: type: ENCHANT name: Enchant Pickaxe with Silk Touch - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7569,7 +7569,7 @@ recipes: Enchant_Axe_SilkTouch_I: type: ENCHANT name: Enchant Axe with Silk Touch - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7582,7 +7582,7 @@ recipes: Enchant_Shovel_SilkTouch_I: name: Enchant Shovel with Silk Touch type: ENCHANT - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7597,7 +7597,7 @@ recipes: Enchant_Helmet_Protection_I: type: ENCHANT name: Enchant Helmet with Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7610,7 +7610,7 @@ recipes: Enchant_Chestplate_Protection_I: type: ENCHANT name: Enchant Chestplate with Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7623,7 +7623,7 @@ recipes: Enchant_Leggings_Protection_I: type: ENCHANT name: Enchant Leggings with Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7636,7 +7636,7 @@ recipes: Enchant_Boots_Protection_I: type: ENCHANT name: Enchant Boots with Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7717,7 +7717,7 @@ recipes: Enchant_Helmet_Protection_III: type: ENCHANT name: Enchant Helmet with Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7734,7 +7734,7 @@ recipes: Enchant_Chestplate_Protection_III: type: ENCHANT name: Enchant Chestplate with Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7751,7 +7751,7 @@ recipes: Enchant_Leggings_Protection_III: type: ENCHANT name: Enchant Leggings with Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7768,7 +7768,7 @@ recipes: Enchant_Boots_Protection_III: type: ENCHANT name: Enchant Boots with Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7785,7 +7785,7 @@ recipes: Enchant_Helmet_Protection_IV: type: ENCHANT name: Enchant Helmet with Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7802,7 +7802,7 @@ recipes: Enchant_Chestplate_Protection_IV: type: ENCHANT name: Enchant Chestplate with Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7819,7 +7819,7 @@ recipes: Enchant_Leggings_Protection_IV: type: ENCHANT name: Enchant Leggings with Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7836,7 +7836,7 @@ recipes: Enchant_Boots_Protection_IV: type: ENCHANT name: Enchant Boots with Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7855,7 +7855,7 @@ recipes: Enchant_Helmet_BlastProtection_I: type: ENCHANT name: Enchant Helmet with Blast Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7868,7 +7868,7 @@ recipes: Enchant_Chestplate_BlastProtection_I: type: ENCHANT name: Enchant Chestplate with Blast Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7881,7 +7881,7 @@ recipes: Enchant_Leggings_BlastProtection_I: type: ENCHANT name: Enchant Leggings with Blast Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7894,7 +7894,7 @@ recipes: Enchant_Boots_BlastProtection_I: type: ENCHANT name: Enchant Boots with Blast Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7975,7 +7975,7 @@ recipes: Enchant_Helmet_BlastProtection_III: type: ENCHANT name: Enchant Helmet with Blast Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -7992,7 +7992,7 @@ recipes: Enchant_Chestplate_BlastProtection_III: type: ENCHANT name: Enchant Chestplate with Blast Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8009,7 +8009,7 @@ recipes: Enchant_Leggings_BlastProtection_III: type: ENCHANT name: Enchant Leggings with Blast Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8026,7 +8026,7 @@ recipes: Enchant_Boots_BlastProtection_III: type: ENCHANT name: Enchant Boots with Blast Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8043,7 +8043,7 @@ recipes: Enchant_Helmet_BlastProtection_IV: type: ENCHANT name: Enchant Helmet with Blast Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8060,7 +8060,7 @@ recipes: Enchant_Chestplate_BlastProtection_IV: type: ENCHANT name: Enchant Chestplate with Blast Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8077,7 +8077,7 @@ recipes: Enchant_Leggings_BlastProtection_IV: type: ENCHANT name: Enchant Leggings with Blast Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8094,7 +8094,7 @@ recipes: Enchant_Boots_BlastProtection_IV: type: ENCHANT name: Enchant Boots with Blast Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8113,7 +8113,7 @@ recipes: Enchant_Thorns_I: type: ENCHANT name: Enchant Chestplate with Thorns I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8126,7 +8126,7 @@ recipes: Enchant_Thorns_II: type: ENCHANT name: Enchant Chestplate with Thorns II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8143,7 +8143,7 @@ recipes: Enchant_Thorns_III: type: ENCHANT name: Enchant Chestplate with Thorns III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8162,7 +8162,7 @@ recipes: Enchant_Power_I: type: ENCHANT name: Enchant Bow with Power I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8175,7 +8175,7 @@ recipes: Enchant_Power_II: type: ENCHANT name: Enchant Bow with Power II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8192,7 +8192,7 @@ recipes: Enchant_Power_III: type: ENCHANT name: Enchant Bow with Power III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8209,7 +8209,7 @@ recipes: Enchant_Power_IV: type: ENCHANT name: Enchant Bow with Power IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8226,7 +8226,7 @@ recipes: Enchant_Power_V: type: ENCHANT name: Enchant Bow with Power V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8245,7 +8245,7 @@ recipes: Enchant_Helmet_ProjectileProtection_I: type: ENCHANT name: Enchant Helmet with Projectile Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8258,7 +8258,7 @@ recipes: Enchant_Chestplate_ProjectileProtection_I: type: ENCHANT name: Enchant Chestplate with Projectile Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8271,7 +8271,7 @@ recipes: Enchant_Leggings_ProjectileProtection_I: type: ENCHANT name: Enchant Leggings with Projectile Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8284,7 +8284,7 @@ recipes: Enchant_Boots_ProjectileProtection_I: type: ENCHANT name: Enchant Boots with Projectile Protection I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8365,7 +8365,7 @@ recipes: Enchant_Helmet_ProjectileProtection_III: type: ENCHANT name: Enchant Helmet with Projectile Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8382,7 +8382,7 @@ recipes: Enchant_Chestplate_ProjectileProtection_III: type: ENCHANT name: Enchant Chestplate with Projectile Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8399,7 +8399,7 @@ recipes: Enchant_Leggings_ProjectileProtection_III: type: ENCHANT name: Enchant Leggings with Projectile Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8416,7 +8416,7 @@ recipes: Enchant_Boots_ProjectileProtection_III: type: ENCHANT name: Enchant Boots with Projectile Protection III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8433,7 +8433,7 @@ recipes: Enchant_Helmet_ProjectileProtection_IV: type: ENCHANT name: Enchant Helmet with Projectile Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8450,7 +8450,7 @@ recipes: Enchant_Chestplate_ProjectileProtection_IV: type: ENCHANT name: Enchant Chestplate with Projectile Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8467,7 +8467,7 @@ recipes: Enchant_Leggings_ProjectileProtection_IV: type: ENCHANT name: Enchant Leggings with Projectile Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8484,7 +8484,7 @@ recipes: Enchant_Boots_ProjectileProtection_IV: type: ENCHANT name: Enchant Boots with Projectile Protection IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8503,7 +8503,7 @@ recipes: Enchant_Punch_I: type: ENCHANT name: Enchant Bow with Punch I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8516,7 +8516,7 @@ recipes: Enchant_Punch_II: type: ENCHANT name: Enchant Bow with Punch II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8535,7 +8535,7 @@ recipes: Enchant_Sharpness_I: type: ENCHANT name: Enchant Sword with Sharpness I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8548,7 +8548,7 @@ recipes: Enchant_Sharpness_II: type: ENCHANT name: Enchant Sword with Sharpness II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8565,7 +8565,7 @@ recipes: Enchant_Sharpness_III: type: ENCHANT name: Enchant Sword with Sharpness III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8582,7 +8582,7 @@ recipes: Enchant_Sharpness_IV: type: ENCHANT name: Enchant Sword with Sharpness IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8599,7 +8599,7 @@ recipes: Enchant_Sharpness_V: type: ENCHANT name: Enchant Sword with Sharpness V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8618,7 +8618,7 @@ recipes: Enchant_Smite_I: type: ENCHANT name: Enchant Sword with Smite I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8631,7 +8631,7 @@ recipes: Enchant_Smite_II: type: ENCHANT name: Enchant Sword with Smite II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8648,7 +8648,7 @@ recipes: Enchant_Smite_III: type: ENCHANT name: Enchant Sword with Smite III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8665,7 +8665,7 @@ recipes: Enchant_Smite_IV: type: ENCHANT name: Enchant Sword with Smite IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8682,7 +8682,7 @@ recipes: Enchant_Smite_V: type: ENCHANT name: Enchant Sword with Smite V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8701,7 +8701,7 @@ recipes: Enchant_Knockback_I: type: ENCHANT name: Enchant Sword with Knockback I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8714,7 +8714,7 @@ recipes: Enchant_Knockback_II: type: ENCHANT name: Enchant Sword with Knockback II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8734,7 +8734,7 @@ recipes: Enchant_Pickaxe_Efficiency_I: type: ENCHANT name: Enchant Pickaxe with Efficiency I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8747,7 +8747,7 @@ recipes: Enchant_Pickaxe_Efficiency_II: type: ENCHANT name: Enchant Pickaxe with Efficiency II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8764,7 +8764,7 @@ recipes: Enchant_Pickaxe_Efficiency_III: type: ENCHANT name: Enchant Pickaxe with Efficiency III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8781,7 +8781,7 @@ recipes: Enchant_Pickaxe_Efficiency_IV: type: ENCHANT name: Enchant Pickaxe with Efficiency IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8798,7 +8798,7 @@ recipes: Enchant_Pickaxe_Efficiency_V: type: ENCHANT name: Enchant Pickaxe with Efficiency V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8815,7 +8815,7 @@ recipes: Enchant_Axe_Efficiency_I: type: ENCHANT name: Enchant Axe with Efficiency I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8828,7 +8828,7 @@ recipes: Enchant_Axe_Efficiency_II: type: ENCHANT name: Enchant Axe with Efficiency II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8845,7 +8845,7 @@ recipes: Enchant_Axe_Efficiency_III: type: ENCHANT name: Enchant Axe with Efficiency III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8862,7 +8862,7 @@ recipes: Enchant_Axe_Efficiency_IV: type: ENCHANT name: Enchant Axe with Efficiency IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8879,7 +8879,7 @@ recipes: Enchant_Axe_Efficiency_V: type: ENCHANT name: Enchant Axe with Efficiency V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8896,7 +8896,7 @@ recipes: Enchant_Shovel_Efficiency_I: type: ENCHANT name: Enchant Shovel with Efficiency I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8909,7 +8909,7 @@ recipes: Enchant_Shovel_Efficiency_II: type: ENCHANT name: Enchant Shovel with Efficiency II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8926,7 +8926,7 @@ recipes: Enchant_Shovel_Efficiency_III: type: ENCHANT name: Enchant Shovel with Efficiency III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8943,7 +8943,7 @@ recipes: Enchant_Shovel_Efficiency_IV: type: ENCHANT name: Enchant Shovel with Efficiency IV - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8960,7 +8960,7 @@ recipes: Enchant_Shovel_Efficiency_V: type: ENCHANT name: Enchant Shovel with Efficiency V - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8979,7 +8979,7 @@ recipes: Enchant_Pickaxe_Unbreaking_I: type: ENCHANT name: Enchant Pickaxe with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -8992,7 +8992,7 @@ recipes: Enchant_Pickaxe_Unbreaking_II: type: ENCHANT name: Enchant Pickaxe with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9009,7 +9009,7 @@ recipes: Enchant_Pickaxe_Unbreaking_III: type: ENCHANT name: Enchant Pickaxe with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9026,7 +9026,7 @@ recipes: Enchant_Axe_Unbreaking_I: type: ENCHANT name: Enchant Axe with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9039,7 +9039,7 @@ recipes: Enchant_Axe_Unbreaking_II: type: ENCHANT name: Enchant Axe with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9056,7 +9056,7 @@ recipes: Enchant_Axe_Unbreaking_III: type: ENCHANT name: Enchant Axe with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9073,7 +9073,7 @@ recipes: Enchant_Shovel_Unbreaking_I: type: ENCHANT name: Enchant Shovel with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9086,7 +9086,7 @@ recipes: Enchant_Shovel_Unbreaking_II: type: ENCHANT name: Enchant Shovel with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9103,7 +9103,7 @@ recipes: Enchant_Shovel_Unbreaking_III: type: ENCHANT name: Enchant Shovel with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9122,7 +9122,7 @@ recipes: Enchant_Sword_Unbreaking_I: type: ENCHANT name: Enchant Sword with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9135,7 +9135,7 @@ recipes: Enchant_Sword_Unbreaking_II: type: ENCHANT name: Enchant Sword with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9152,7 +9152,7 @@ recipes: Enchant_Sword_Unbreaking_III: type: ENCHANT name: Enchant Sword with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9171,7 +9171,7 @@ recipes: Enchant_Bow_Unbreaking_I: type: ENCHANT name: Enchant Bow with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9184,7 +9184,7 @@ recipes: Enchant_Bow_Unbreaking_II: type: ENCHANT name: Enchant Bow with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9201,7 +9201,7 @@ recipes: Enchant_Bow_Unbreaking_III: type: ENCHANT name: Enchant Bow with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9220,7 +9220,7 @@ recipes: Enchant_Helmet_Unbreaking_I: type: ENCHANT name: Enchant Helmet with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9233,7 +9233,7 @@ recipes: Enchant_Chestplate_Unbreaking_I: type: ENCHANT name: Enchant Chestplate with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9246,7 +9246,7 @@ recipes: Enchant_Leggings_Unbreaking_I: type: ENCHANT name: Enchant Leggings with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9259,7 +9259,7 @@ recipes: Enchant_Boots_Unbreaking_I: type: ENCHANT name: Enchant Boots with Unbreaking I - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9272,7 +9272,7 @@ recipes: Enchant_Helmet_Unbreaking_II: type: ENCHANT name: Enchant Helmet with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9289,7 +9289,7 @@ recipes: Enchant_Chestplate_Unbreaking_II: type: ENCHANT name: Enchant Chestplate with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9306,7 +9306,7 @@ recipes: Enchant_Leggings_Unbreaking_II: type: ENCHANT name: Enchant Leggings with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9323,7 +9323,7 @@ recipes: Enchant_Boots_Unbreaking_II: type: ENCHANT name: Enchant Boots with Unbreaking II - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9340,7 +9340,7 @@ recipes: Enchant_Helmet_Unbreaking_III: type: ENCHANT name: Enchant Helmet with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9357,7 +9357,7 @@ recipes: Enchant_Chestplate_Unbreaking_III: type: ENCHANT name: Enchant Chestplate with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9374,7 +9374,7 @@ recipes: Enchant_Leggings_Unbreaking_III: type: ENCHANT name: Enchant Leggings with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9391,7 +9391,7 @@ recipes: Enchant_Boots_Unbreaking_III: type: ENCHANT name: Enchant Boots with Unbreaking III - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9410,7 +9410,7 @@ recipes: Enchant_Efficiency_Pickaxe_Basic: type: ENCHANT name: Enchant Pickaxe with Efficiency - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9423,7 +9423,7 @@ recipes: Enchant_Efficiency_Axe_Basic: type: ENCHANT name: Enchant Axe with Efficiency - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9436,7 +9436,7 @@ recipes: Enchant_Efficiency_Shovel_Basic: type: ENCHANT name: Enchant Shovel with Efficiency - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9449,7 +9449,7 @@ recipes: Enchant_Unbreaking_Pickaxe_Basic: type: ENCHANT name: Enchant Pickaxe with Unbreaking - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9462,7 +9462,7 @@ recipes: Enchant_Unbreaking_Axe_Basic: type: ENCHANT name: Enchant Axe with Unbreaking - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9475,7 +9475,7 @@ recipes: Enchant_Unbreaking_Shovel_Basic: type: ENCHANT name: Enchant Shovel with Unbreaking - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9488,7 +9488,7 @@ recipes: Enchant_Unbreaking_Sword_Basic: type: ENCHANT name: Enchant Sword with Unbreaking - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD @@ -9501,7 +9501,7 @@ recipes: Enchant_Sharpness_Basic: type: ENCHANT name: Enchant Sword with Sharpness - production_time: 1m + production_time: 15s input: emeralds: material: EMERALD From 98292d51fcec4afd2059624e389512e47e7d292c Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Tue, 12 Apr 2016 17:22:18 +0100 Subject: [PATCH 367/459] Slight config fixes --- configCivcraft.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 3bf42e2c..ee8c2c8c 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -825,7 +825,6 @@ factories: - Enchant_Boots_BlastProtection_I - Enchant_Boots_BlastProtection_II - Enchant_Boots_BlastProtection_III - - Enchant_Helmet_BlastProtection_III - Enchant_Thorns_I - Enchant_Thorns_II - Upgrade_to_Meteor_Forge @@ -900,7 +899,6 @@ factories: - Enchant_Boots_ProjectileProtection_I - Enchant_Boots_ProjectileProtection_II - Enchant_Boots_ProjectileProtection_III - - Enchant_Helmet_ProjectileProtection_III - Enchant_Punch_I - Upgrade_to_Sniper_Forge sniperforge: From b4efb9da0aa6a33640ff257969378791a0a657b5 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Wed, 13 Apr 2016 17:03:46 +0100 Subject: [PATCH 368/459] Better XP Balance and Burn Charcoal Names (#246) * Better XP Balance and Burn Charcoal Names * Apples are also bad --- configCivcraft.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 5f212e4f..14c3bae9 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1407,7 +1407,7 @@ recipes: durability: 1 Burn_Charcoal_from_Logs_Expert: type: PRODUCTION - name: Burn Charcoal from Logs + name: Burn Charcoal from Normal Logs production_time: 45s input: log: @@ -1421,7 +1421,7 @@ recipes: durability: 1 Burn_Charcoal_from_Logs2_Expert: type: PRODUCTION - name: Burn Charcoal from Logs2 + name: Burn Charcoal from Acacia or Dark Oak production_time: 45s input: log: @@ -6249,7 +6249,7 @@ recipes: amount: 64 logs: material: LOG - amount: 128 + amount: 64 durability: -1 netherwart: material: NETHER_STALK @@ -6277,7 +6277,7 @@ recipes: amount: 64 logs: material: LOG - amount: 128 + amount: 64 durability: -1 cactus: material: CACTUS @@ -6305,7 +6305,7 @@ recipes: amount: 64 logs: material: LOG - amount: 128 + amount: 64 durability: -1 sugarcane: material: SUGAR_CANE @@ -6334,7 +6334,7 @@ recipes: amount: 320 acacialogs: material: LOG_2 - amount: 640 + amount: 320 durability: 0 netherwart: material: NETHER_STALK @@ -6368,7 +6368,7 @@ recipes: amount: 320 sprucelogs: material: LOG - amount: 640 + amount: 320 durability: 1 cactus: material: CACTUS @@ -6403,7 +6403,7 @@ recipes: amount: 320 birchlogs: material: LOG - amount: 640 + amount: 320 durability: 2 sugarcane: material: SUGAR_CANE @@ -6440,13 +6440,13 @@ recipes: - Compacted Item acacialogs: material: LOG_2 - amount: 50 + amount: 25 durability: 0 lore: - Compacted Item junglesaplings: material: SAPLING - amount: 4 + amount: 3 durability: 3 lore: - Compacted Item @@ -6468,9 +6468,7 @@ recipes: amount: 64 apples: material: APPLE - amount: 1 - lore: - - Compacted Item + amount: 32 aether: material: GOLD_NUGGET amount: 960 @@ -6496,13 +6494,13 @@ recipes: - Compacted Item sprucelogs: material: LOG - amount: 50 + amount: 25 durability: 1 lore: - Compacted Item darkoaksaplings: material: SAPLING - amount: 2 + amount: 1 durability: 5 lore: - Compacted Item @@ -6554,13 +6552,13 @@ recipes: - Compacted Item birchlogs: material: LOG - amount: 50 + amount: 25 durability: 2 lore: - Compacted Item oaksaplings: material: SAPLING - amount: 6 + amount: 4 durability: 0 lore: - Compacted Item From 62a6ffda6fcfea63dd070167deb2762ec846ca14 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Wed, 13 Apr 2016 22:11:58 +0100 Subject: [PATCH 369/459] Updated Pylon Repair Recipes (#247) --- configCivcraft.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 14c3bae9..d51d244f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5240,8 +5240,8 @@ recipes: input: xp: material: EMERALD - amount: 56 - health_gained: 1000 + amount: 28 + health_gained: 1250 Repair_Advanced_Pylon: type: REPAIR name: Repair Advanced Pylon @@ -5249,8 +5249,8 @@ recipes: input: xp: material: EMERALD_BLOCK - amount: 34 - health_gained: 1000 + amount: 17 + health_gained: 1250 Repair_Expert_Pylon: type: REPAIR name: Repair Expert Pylon @@ -5258,8 +5258,8 @@ recipes: input: xp: material: EMERALD_BLOCK - amount: 75 - health_gained: 1000 + amount: 38 + health_gained: 1250 #Bastion recipes Brew_Soup_Concentrate: name: Brew Soup Concentrate From cae9c16f5116d6f29c996119ce70a54855cf846e Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 14 Apr 2016 00:42:36 +0200 Subject: [PATCH 370/459] Add new permission system (#243) --- pom.xml | 4 +- .../igotyou/FactoryMod/ConfigParser.java | 4 +- .../github/igotyou/FactoryMod/FactoryMod.java | 2 - .../igotyou/FactoryMod/FactoryModManager.java | 24 ++++++- .../factories/FurnCraftChestFactory.java | 66 +++++++++++++++---- .../igotyou/FactoryMod/factories/Pipe.java | 1 - .../FurnCraftChestInteractionManager.java | 29 ++++---- .../PipeInteractionManager.java | 22 +++++-- .../SorterInteractionManager.java | 22 +++++-- 9 files changed, 123 insertions(+), 51 deletions(-) diff --git a/pom.xml b/pom.xml index c1f4c2e9..fafde4b0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.1 + 2.1.2 FactoryMod https://github.com/Civcraft/FactoryMod @@ -39,7 +39,7 @@ vg.civcraft.mc.namelayer NameLayer - 2.5.4 + 2.6 provided diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index ecaa8c7b..89d78bf1 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -73,6 +73,8 @@ public FactoryModManager parse() { FileConfiguration config = plugin.getConfig(); boolean citadelEnabled = plugin.getServer().getPluginManager() .isPluginEnabled("Citadel"); + boolean nameLayerEnabled = plugin.getServer().getPluginManager() + .isPluginEnabled("NameLayer"); boolean logInventories = config.getBoolean("log_inventories", true); Material factoryInteractionMaterial = Material.STICK; try { @@ -117,7 +119,7 @@ public void run() { int globalPylonLimit = config.getInt("global_pylon_limit"); PylonRecipe.setGlobalLimit(globalPylonLimit); manager = new FactoryModManager(plugin, factoryInteractionMaterial, - citadelEnabled, redstonePowerOn, redstoneRecipeChange, + citadelEnabled, nameLayerEnabled, redstonePowerOn, redstoneRecipeChange, logInventories, gracePeriod); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/com/github/igotyou/FactoryMod/FactoryMod.java index 71314cd9..ef2844d4 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/com/github/igotyou/FactoryMod/FactoryMod.java @@ -3,7 +3,6 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; -import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; @@ -29,7 +28,6 @@ public void onEnable() { mb = new MenuBuilder(cp.getDefaultMenuFactory()); manager.loadFactories(); registerListeners(); - FurnCraftChestInteractionManager.prep(); if (getServer().getPluginManager().isPluginEnabled("CivMenu")) { rm = ResponseManager.getResponseManager(this); } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index cf03f082..7471ef3c 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -16,6 +16,8 @@ import org.bukkit.entity.Player; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import vg.civcraft.mc.namelayer.GroupManager.PlayerType; +import vg.civcraft.mc.namelayer.permission.PermissionType; import com.github.igotyou.FactoryMod.eggs.FurnCraftChestEgg; import com.github.igotyou.FactoryMod.eggs.IFactoryEgg; @@ -47,6 +49,7 @@ public class FactoryModManager { private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; private boolean citadelEnabled; + private boolean nameLayerEnabled; private boolean logInventories; private int redstonePowerOn; private int redstoneRecipeChange; @@ -55,16 +58,33 @@ public class FactoryModManager { public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, - int redstonePowerOn, int redstoneRecipeChange, - boolean logInventories, long noHealthGracePeriod) { + boolean nameLayerEnabled, int redstonePowerOn, + int redstoneRecipeChange, boolean logInventories, + long noHealthGracePeriod) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; + this.nameLayerEnabled = nameLayerEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; this.noHealthGracePeriod = noHealthGracePeriod; fileHandler = new FileHandler(this); + + if(nameLayerEnabled) { + //register our own permissions + List memberAndAbove = new LinkedList(); + List modAndAbove = new LinkedList(); + memberAndAbove.add(PlayerType.MEMBERS); + memberAndAbove.add(PlayerType.MODS); + memberAndAbove.add(PlayerType.ADMINS); + memberAndAbove.add(PlayerType.OWNER); + modAndAbove.add(PlayerType.MODS); + modAndAbove.add(PlayerType.ADMINS); + modAndAbove.add(PlayerType.OWNER); + PermissionType.registerPermission("USE_FACTORY", memberAndAbove); + PermissionType.registerPermission("UPGRADE_FACTORY", modAndAbove); + } factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 00aa598a..361d13ea 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -17,6 +17,14 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; +import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; +import vg.civcraft.mc.namelayer.NameAPI; +import vg.civcraft.mc.namelayer.NameLayerPlugin; +import vg.civcraft.mc.namelayer.permission.PermissionType; + +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.events.FactoryActivateEvent; import com.github.igotyou.FactoryMod.events.RecipeExecuteEvent; import com.github.igotyou.FactoryMod.interactionManager.IInteractionManager; @@ -123,6 +131,24 @@ public void attemptToActivate(Player p) { } return; } + if (currentRecipe instanceof Upgraderecipe + && FactoryMod.getManager().isCitadelEnabled()) { + // only allow permitted members to upgrade the factory + ReinforcementManager rm = Citadel + .getReinforcementManager(); + PlayerReinforcement rein = (PlayerReinforcement) rm + .getReinforcement(mbs.getCenter()); + if (rein != null) { + if (p == null) { + return; + } + if (!NameAPI.getGroupManager().hasAccess(rein.getGroup().getName(), + p.getUniqueId(), PermissionType.getPermission("UPGRADE_FACTORY"))) { + p.sendMessage(ChatColor.RED + "You dont have permission to upgrade this factory"); + return; + } + } + } FactoryActivateEvent fae = new FactoryActivateEvent(this, p); Bukkit.getPluginManager().callEvent(fae); if (fae.isCancelled()) { @@ -133,8 +159,10 @@ public void attemptToActivate(Player p) { .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) .getFuelConsumptionIntervall() : pm .getPowerConsumptionIntervall(); - if (((FurnacePowerManager) pm).getFuelAmountAvailable() < (currentRecipe.getProductionTime() / consumptionIntervall)) { - p.sendMessage(ChatColor.RED + "You don't have enough fuel, the factory will run out of it before completing"); + if (((FurnacePowerManager) pm).getFuelAmountAvailable() < (currentRecipe + .getProductionTime() / consumptionIntervall)) { + p.sendMessage(ChatColor.RED + + "You don't have enough fuel, the factory will run out of it before completing"); } p.sendMessage(ChatColor.GREEN + "Activated " + name + " with recipe: " @@ -242,7 +270,8 @@ public void run() { // if the factory power source inventory has enough fuel for // at least 1 energyCycle if (pm.powerAvailable()) { - //check whether the furnace is on, minecraft sometimes turns it off + // check whether the furnace is on, minecraft sometimes + // turns it off if (getFurnace().getType() != Material.BURNING_FURNACE) { turnFurnaceOn(getFurnace()); } @@ -270,7 +299,8 @@ public void run() { } // if there is no fuel Available turn off the factory else { - sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of fuel"); + sendActivatorMessage(ChatColor.GOLD + name + + " deactivated, because it ran out of fuel"); deactivate(); } } @@ -282,15 +312,19 @@ else if (currentProductionTimer >= currentRecipe LoggingUtils.log("Executing recipe " + currentRecipe.getRecipeName() + " for " + getLogData()); - RecipeExecuteEvent ree = new RecipeExecuteEvent(this, (InputRecipe) currentRecipe); + RecipeExecuteEvent ree = new RecipeExecuteEvent(this, + (InputRecipe) currentRecipe); Bukkit.getPluginManager().callEvent(ree); if (ree.isCancelled()) { LoggingUtils.log("Executing recipe " - + currentRecipe.getRecipeName() + " for " - + getLogData() + " was cancelled over the event"); + + currentRecipe.getRecipeName() + " for " + + getLogData() + + " was cancelled over the event"); return; } - sendActivatorMessage(ChatColor.GOLD + currentRecipe.getRecipeName() + " in " + name + " completed"); + sendActivatorMessage(ChatColor.GOLD + + currentRecipe.getRecipeName() + " in " + name + + " completed"); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of @@ -306,8 +340,9 @@ else if (currentProductionTimer >= currentRecipe currentProductionTimer = 0; if (currentRecipe instanceof RepairRecipe && rm.atFullHealth()) { - //already at full health, dont try to repair further - sendActivatorMessage(ChatColor.GOLD + name + " repaired to full health"); + // already at full health, dont try to repair further + sendActivatorMessage(ChatColor.GOLD + name + + " repaired to full health"); deactivate(); return; } @@ -320,11 +355,14 @@ else if (currentProductionTimer >= currentRecipe } } } else { - sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of required materials"); + sendActivatorMessage(ChatColor.GOLD + + name + + " deactivated, because it ran out of required materials"); deactivate(); } } else { - sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because the factory was destroyed"); + sendActivatorMessage(ChatColor.GOLD + name + + " deactivated, because the factory was destroyed"); deactivate(); } } @@ -370,7 +408,7 @@ public void setRecipe(IRecipe pr) { public int getRunCount(IRecipe r) { return runCount.get(r); } - + private void sendActivatorMessage(String msg) { if (activator != null) { Player p = Bukkit.getPlayer(activator); @@ -397,7 +435,7 @@ public void setProductionTimer(int timer) { public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } - + public static void removePylon(Factory f) { pylonFactories.remove(f); } diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index a348af1a..2916153c 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -40,7 +40,6 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, } public void attemptToActivate(Player p) { - // TODO Citadel stuff LoggingUtils.log((p != null ? p.getName() : "Redstone") + "is attempting to activate " + getLogData()); mbs.recheckComplete(); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 30f67cf8..24384f01 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -18,6 +18,9 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; +import vg.civcraft.mc.namelayer.NameAPI; +import vg.civcraft.mc.namelayer.group.Group; +import vg.civcraft.mc.namelayer.permission.PermissionType; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; @@ -31,7 +34,6 @@ public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); - private static ReinforcementManager rm; private static MenuBuilder mb; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { @@ -46,16 +48,9 @@ public void setFactory(FurnCraftChestFactory fccf) { this.fccf = fccf; } - public static void prep() { - mb = FactoryMod.getMenuBuilder(); - if (FactoryMod.getManager().isCitadelEnabled()) { - rm = Citadel.getReinforcementManager(); - } else { - rm = null; - } - } - public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { + ReinforcementManager rm = FactoryMod.getManager().isCitadelEnabled() ? Citadel + .getReinforcementManager() : null; int threshold = FactoryMod.getManager().getRedstonePowerOn(); if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold @@ -95,14 +90,18 @@ public void leftClick(Player p, Block b, BlockFace bf) { return; } if (FactoryMod.getManager().isCitadelEnabled()) { + ReinforcementManager rm = Citadel.getReinforcementManager(); // is this cast safe? Let's just assume yes for now PlayerReinforcement rein = (PlayerReinforcement) rm .getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { - p.sendMessage(ChatColor.RED - + "You dont have permission to interact with this factory"); - FactoryMod.sendResponse("FactoryNoPermission", p); - return; + if (rein != null) { + Group g = rein.getGroup(); + if (!NameAPI.getGroupManager().hasAccess(g.getName(), p.getUniqueId(), PermissionType.getPermission("USE_FACTORY"))) { + p.sendMessage(ChatColor.RED + + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } } } if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index f1d84d35..5bf402c6 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -13,6 +13,9 @@ import vg.civcraft.mc.citadel.Citadel; import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; +import vg.civcraft.mc.namelayer.NameAPI; +import vg.civcraft.mc.namelayer.group.Group; +import vg.civcraft.mc.namelayer.permission.PermissionType; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.FactoryModManager; @@ -42,14 +45,19 @@ public void rightClick(Player p, Block b, BlockFace bf) { public void leftClick(Player p, Block b, BlockFace bf) { ItemStack hand = p.getItemInHand(); - if(FactoryMod.getManager().isCitadelEnabled()) { + if (FactoryMod.getManager().isCitadelEnabled()) { ReinforcementManager rm = Citadel.getReinforcementManager(); - //is this cast safe? Let's just assume yes for now - PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { - p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); - FactoryMod.sendResponse("FactoryNoPermission", p); - return; + // is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement) rm + .getReinforcement(b); + if (rein != null) { + Group g = rein.getGroup(); + if (!NameAPI.getGroupManager().hasAccess(g.getName(), p.getUniqueId(), PermissionType.getPermission("USE_FACTORY"))) { + p.sendMessage(ChatColor.RED + + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } } } if (b.equals(((PipeStructure) (pipe.getMultiBlockStructure())) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index 5e9444c3..2020f81f 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -11,6 +11,9 @@ import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; +import vg.civcraft.mc.namelayer.NameAPI; +import vg.civcraft.mc.namelayer.group.Group; +import vg.civcraft.mc.namelayer.permission.PermissionType; import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Sorter; @@ -49,14 +52,19 @@ public void rightClick(Player p, Block b, BlockFace bf) { } public void leftClick(Player p, Block b, BlockFace bf) { - if(FactoryMod.getManager().isCitadelEnabled()) { + if (FactoryMod.getManager().isCitadelEnabled()) { ReinforcementManager rm = Citadel.getReinforcementManager(); - //is this cast safe? Let's just assume yes for now - PlayerReinforcement rein = (PlayerReinforcement)rm.getReinforcement(b); - if (rein != null && !rein.getGroup().isMember(p.getUniqueId()) && !p.isOp()) { - p.sendMessage(ChatColor.RED + "You dont have permission to interact with this factory"); - FactoryMod.sendResponse("FactoryNoPermission", p); - return; + // is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement) rm + .getReinforcement(b); + if (rein != null) { + Group g = rein.getGroup(); + if (!NameAPI.getGroupManager().hasAccess(g.getName(), p.getUniqueId(), PermissionType.getPermission("USE_FACTORY"))) { + p.sendMessage(ChatColor.RED + + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; + } } } if (b.equals(bfs.getFurnace())) { From 0c0551775930d14cb26c571a3e395fbcf0e295e0 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 14 Apr 2016 02:40:42 +0200 Subject: [PATCH 371/459] MenuBuilder NPE --- pom.xml | 2 +- .../interactionManager/FurnCraftChestInteractionManager.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fafde4b0..e5448357 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.2 + 2.1.3 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 24384f01..afee48c0 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -29,12 +29,10 @@ import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; -import com.github.igotyou.FactoryMod.utility.MenuBuilder; public class FurnCraftChestInteractionManager implements IInteractionManager { private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); - private static MenuBuilder mb; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { this.fccf = fccf; @@ -245,7 +243,7 @@ public void clicked(Player p) { Clickable menuC = new Clickable(menuStack) { @Override public void clicked(Player arg0) { - mb.openFactoryBrowser(arg0, fccf.getName()); + FactoryMod.getMenuBuilder().openFactoryBrowser(arg0, fccf.getName()); } }; ci.setSlot(menuC, 35); From 90356ebbe1bc8dbfc0cddb1042abb699762f4896 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 17 Apr 2016 03:10:16 +0200 Subject: [PATCH 372/459] Allow renaming factories by adding feature to convert names over on startup --- config.yml | 19 ++++++++++++++++ .../igotyou/FactoryMod/ConfigParser.java | 22 ++++++++++++++++++- .../igotyou/FactoryMod/FactoryModManager.java | 5 +++-- .../FactoryMod/utility/FileHandler.java | 22 ++++++++++++++----- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/config.yml b/config.yml index 2598bb7f..9b869011 100644 --- a/config.yml +++ b/config.yml @@ -574,6 +574,25 @@ recipes: +#Sometimes you will want to rename existing factories. Just changing the name in the config and restarting the server will delete all existing +#factories of this type though, so instead you can here specify factories, which you on startup want to rename/convert into a different one + +#Example format: + +#renames: +# example1: +# oldName: Stone Smelter With Bad Name +# newName: Stone Smelter +# example2: +# oldName: tempName +# newName: Emerald Extractor + +#oldName is the previous name and newName is the one the factory will be converted to. The configuration for the factory with the oldName has to be +#removed from the config already, otherwise the name won't be changed and the old configuration for the factory will be loaded. The renaming feature +#will work for all types of factories, not only FCCs + +renames: + #CivMenu configuration diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 89d78bf1..0c454268 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.TreeMap; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -118,9 +119,10 @@ public void run() { defaultMenuFactory = config.getString("default_menu_factory"); int globalPylonLimit = config.getInt("global_pylon_limit"); PylonRecipe.setGlobalLimit(globalPylonLimit); + Map factoryRenames = parseRenames(config.getConfigurationSection("renames")); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, nameLayerEnabled, redstonePowerOn, redstoneRecipeChange, - logInventories, gracePeriod); + logInventories, gracePeriod, factoryRenames); handleEnabledAndDisabledRecipes(config .getConfigurationSection("crafting")); upgradeEggs = new HashMap(); @@ -574,6 +576,24 @@ private IRecipe parseRecipe(ConfigurationSection config) { } return result; } + + private Map parseRenames(ConfigurationSection config) { + Map renames = new TreeMap(); + if (config != null) { + for(String key : config.getKeys(false)) { + String oldName = config.getConfigurationSection(key).getString("oldName"); + if (oldName == null) { + plugin.warning("No old name specified for factory rename at " + config.getConfigurationSection(key).getCurrentPath()); + } + String newName = config.getConfigurationSection(key).getString("newName"); + if (newName == null) { + plugin.warning("No new name specified for factory rename at " + config.getConfigurationSection(key).getCurrentPath()); + } + renames.put(oldName, newName); + } + } + return renames; + } public void assignRecipesToFactories() { HashSet usedRecipes = new HashSet(); diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 7471ef3c..f3a78fd3 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import org.bukkit.ChatColor; @@ -60,7 +61,7 @@ public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, boolean nameLayerEnabled, int redstonePowerOn, int redstoneRecipeChange, boolean logInventories, - long noHealthGracePeriod) { + long noHealthGracePeriod, Map factoryRenames) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; @@ -69,7 +70,7 @@ public FactoryModManager(FactoryMod plugin, this.redstoneRecipeChange = redstoneRecipeChange; this.noHealthGracePeriod = noHealthGracePeriod; - fileHandler = new FileHandler(this); + fileHandler = new FileHandler(this, factoryRenames); if(nameLayerEnabled) { //register our own permissions diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index 377cc973..706f8bc9 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -38,9 +38,12 @@ public class FileHandler { private FactoryModManager manager; private File saveFile; private File backup; + + private Map factoryRenames; - public FileHandler(FactoryModManager manager) { + public FileHandler(FactoryModManager manager, Map factoryRenames) { plugin = FactoryMod.getPlugin(); + this.factoryRenames = factoryRenames; this.manager = manager; saveFile = new File(plugin.getDataFolder().getAbsolutePath() + File.separator + "factoryData.yml"); @@ -173,10 +176,19 @@ private void loadFromFile(File f, Map eggs) { case "FCC": FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs.get(name); if (egg == null) { - plugin.warning("Save file contained factory named " - + name - + " , but no factory with this name was found in the config"); - continue; + String replaceName = factoryRenames.get(name); + if (replaceName != null) { + egg = (FurnCraftChestEgg) eggs.get(replaceName); + } + if (egg == null) { + plugin.warning("Save file contained factory named " + + name + + " , but no factory with this name was found in the config"); + continue; + } + else { + name = replaceName; + } } int health = current.getInt("health"); String selectedRecipe = current.getString("selectedRecipe"); From 4da74dcb030d39433df966f508de7785308f205d Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 17 Apr 2016 03:10:28 +0200 Subject: [PATCH 373/459] Balance changes --- configCivcraft.yml | 755 +++++++++++++++++++++++++++------------------ 1 file changed, 456 insertions(+), 299 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d51d244f..caeaeb1f 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -312,6 +312,7 @@ factories: - Upgrade_to_Soup_kitchen - Upgrade_to_Bio_Lab - Upgrade_to_Animal_Husbandry_Factory_Basic + - Upgrade_to_Wool_Processing - Upgrade_to_Apprentice_Transmuter bakery: type: FCCUPGRADE @@ -346,20 +347,9 @@ factories: - Repair_Factory animalhusbandryfactorybasic: type: FCCUPGRADE - name: Animal Husbandry Factory Basic + name: Animal Husbandry Factory recipes: - Craft_Saddles_Basic - - Dye_Wool_to_Red_Wool - - Dye_Wool_to_Yellow_Wool - - Dye_Wool_to_Green_Wool - - Repair_Small_Factory - - Upgrade_to_Wool_Processing - - Upgrade_to_Animal_Husbandry_Factory_Advanced - animalhusbandryfactoryadvanced: - type: FCCUPGRADE - name: Animal Husbandry Factory Advanced - recipes: - - Craft_Saddles_Advanced - Create_Nametags - Create_Leads - Repair_Factory @@ -367,6 +357,22 @@ factories: type: FCCUPGRADE name: Wool Processing recipes: + - Dye_Wool_Orange + - Dye_Wool_Magenta + - Dye_Wool_Light_Blue + - Dye_Wool_Yellow + - Dye_Wool_Lime + - Dye_Wool_Pink + - Dye_Wool_Gray + - Dye_Wool_Light_Gray + - Dye_Wool_Cyan + - Dye_Wool_Purple + - Dye_Wool_Blue + - Dye_Wool_Brown + - Dye_Wool_Green + - Dye_Wool_Red + - Dye_Wool_Black + - Repair_Factory biolab: type: FCCUPGRADE name: Bio Lab @@ -379,7 +385,6 @@ factories: - Upgrade_to_Grass_Gardening - Upgrade_to_Flower_Gardening - Upgrade_to_Tree_Mutator - - Upgrade_to_Mad_Scientist - Upgrade_to_Organic_Block_Factory grassgardening: type: FCCUPGRADE @@ -407,13 +412,6 @@ factories: - Mutate_random_leaves - Grow_Concentrate_Of_Nature - Repair_Factory - madscientist: - type: FCCUPGRADE - name: Mad Scientist - recipes: - - Create_any_hostile_mob_egg - - Take_any_mob_egg_apart - - Repair_Factory organicblockfactory: type: FCCUPGRADE name: Organic Block Factory @@ -436,7 +434,7 @@ factories: - Upgrade_to_Iron_Equipment_Forge ironforgebasic: type: FCCUPGRADE - name: Iron Forge Basic + name: Iron Forge recipes: - Craft_Rail_Basic - Craft_Buckets_Basic @@ -446,7 +444,7 @@ factories: - Upgrade_to_Rail_Factory ironforgeadvanced: type: FCCUPGRADE - name: Iron Forge Advanced + name: Steel Forge recipes: - Craft_Shears - Craft_Anvils_Advanced @@ -555,7 +553,6 @@ factories: - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic - - Upgrade_to_Emerald_Extractor bastionfactory: type: FCCUPGRADE name: Bastion Factory @@ -2190,21 +2187,6 @@ recipes: redstone torch: material: REDSTONE_TORCH_ON amount: 64 - Craft_Saddles_Advanced: - type: PRODUCTION - name: Craft Saddles - production_time: 5s - input: - leather: - material: LEATHER - amount: 32 - iron ingot: - material: IRON_INGOT - amount: 16 - output: - saddle: - material: SADDLE - amount: 16 Craft_Saddles_Basic: type: PRODUCTION name: Craft Saddles @@ -2212,14 +2194,14 @@ recipes: input: leather: material: LEATHER - amount: 32 + amount: 128 iron ingot: material: IRON_INGOT amount: 32 output: saddle: material: SADDLE - amount: 16 + amount: 4 Craft_Sea_Lanterns: type: PRODUCTION name: Craft Sea Lanterns @@ -2355,11 +2337,11 @@ recipes: Grow_random_flower: type: RANDOM name: Grow random flower - production_time: 10s + production_time: 5s input: seeds: material: SEEDS - amount: 64 + amount: 32 waterbucket: material: WATER_BUCKET amount: 1 @@ -2556,7 +2538,7 @@ recipes: output: bastion: material: SPONGE - amount: 16 + amount: 12 Create_Coarse_Dirt: type: PRODUCTION name: Create Coarse Dirt @@ -2629,7 +2611,7 @@ recipes: output: nametag: material: NAME_TAG - amount: 8 + amount: 4 Create_Podzol_Advanced: type: PRODUCTION name: Create Podzol @@ -2771,60 +2753,6 @@ recipes: name: De-compact Stack production_time: 5s compact_lore: Compacted Item - Dye_Wool_to_Green_Wool: - type: PRODUCTION - name: Dye Wool to Green Wool - production_time: 5s - input: - wool: - material: WOOL - durability: -1 - amount: 64 - dye: - material: INK_SACK - durability: 2 - amount: 4 - output: - green wool: - material: WOOL - durability: 13 - amount: 64 - Dye_Wool_to_Red_Wool: - type: PRODUCTION - name: Dye Wool to Red Wool - production_time: 5s - input: - wool: - material: WOOL - durability: -1 - amount: 64 - dye: - material: INK_SACK - durability: 1 - amount: 4 - output: - green wool: - material: WOOL - durability: 14 - amount: 64 - Dye_Wool_to_Yellow_Wool: - type: PRODUCTION - name: Dye Wool to Yellow Wool - production_time: 5s - input: - wool: - material: WOOL - durability: -1 - amount: 64 - dye: - material: INK_SACK - durability: 11 - amount: 4 - output: - green wool: - material: WOOL - durability: 4 - amount: 64 Extract_Diamonds: type: PRODUCTION name: Extract Diamonds @@ -3276,7 +3204,7 @@ recipes: production_time: 5s input: stone: - material: STONE + material: COBBLESTONE amount: 16 output: stone axe: @@ -3288,7 +3216,7 @@ recipes: production_time: 5s input: stone: - material: STONE + material: COBBLESTONE amount: 8 output: stone hoe: @@ -3300,7 +3228,7 @@ recipes: production_time: 5s input: stone: - material: STONE + material: COBBLESTONE amount: 16 output: stone pickaxe: @@ -3312,7 +3240,7 @@ recipes: production_time: 5s input: stone: - material: STONE + material: COBBLESTONE amount: 6 output: stone shovel: @@ -3324,7 +3252,7 @@ recipes: production_time: 5s input: stone: - material: STONE + material: COBBLESTONE amount: 10 output: stone sword: @@ -4150,32 +4078,19 @@ recipes: identifiername: material: STONE amount: 1 - Upgrade_to_Animal_Husbandry_Factory_Advanced: - production_time: 1800s - type: UPGRADE - name: Upgrade to Animal Husbandry Factory Advanced - fuel_consumption_intervall: 15s - input: - golden apple: - material: GOLDEN_APPLE - amount: 64 - hay bale: - material: HAY_BLOCK - amount: 128 - factory: Animal Husbandry Factory Advanced Upgrade_to_Animal_Husbandry_Factory_Basic: production_time: 1800s type: UPGRADE - name: Upgrade to Animal Husbandry Factory Basic + name: Upgrade to Animal Husbandry Factory fuel_consumption_intervall: 15s input: hay bale: material: HAY_BLOCK - amount: 64 + amount: 256 golden apple: material: GOLDEN_APPLE - amount: 16 - factory: Animal Husbandry Factory Basic + amount: 32 + factory: Animal Husbandry Factory Upgrade_to_Aquatic_Brick_Smelter: production_time: 1h type: UPGRADE @@ -4184,13 +4099,13 @@ recipes: input: prismarine shard: material: PRISMARINE_SHARD - amount: 512 + amount: 2048 prismarine crystals: material: PRISMARINE_CRYSTALS - amount: 128 + amount: 512 ink: material: INK_SACK - amount: 64 + amount: 384 waterbucket: material: WATER_BUCKET amount: 4 @@ -4206,10 +4121,10 @@ recipes: input: Quartz Block: material: QUARTZ_BLOCK - amount: 256 + amount: 2048 quartz: material: QUARTZ - amount: 512 + amount: 1024 pick: material: DIAMOND_PICKAXE amount: 8 @@ -4222,75 +4137,75 @@ recipes: input: bread: material: BREAD - amount: 512 + amount: 1024 cake: material: CAKE - amount: 32 + amount: 4 pumpkinpie: material: PUMPKIN_PIE - amount: 128 + amount: 256 baked potato: material: BAKED_POTATO - amount: 512 + amount: 1024 cookie: material: COOKIE - amount: 512 + amount: 384 fire: material: FLINT_AND_STEEL amount: 8 factory: Bakery Upgrade_to_Bastion_Factory: - production_time: 3h + production_time: 1d type: UPGRADE name: Upgrade to Bastion Factory - fuel_consumption_intervall: 2m + fuel_consumption_intervall: 15m input: pretzel: material: CAKE - amount: 10 + amount: 20 lore: - Food Concentrate soup: material: MUSHROOM_SOUP - amount: 10 + amount: 20 lore: - Soup Concentrate sand: material: SAND - amount: 10 + amount: 20 lore: - Desert Concentrate durability: 1 brick: material: NETHER_BRICK_ITEM - amount: 10 + amount: 20 lore: - Hell Concentrate end: material: ENDER_PEARL - amount: 10 + amount: 20 lore: - End Concentrate rainbow: material: INK_SACK - amount: 10 + amount: 20 durability: 4 lore: - Rainbow Concentrate cave: material: COAL_ORE - amount: 10 + amount: 20 lore: - Cave Concentrate nature: material: SAPLING - amount: 10 + amount: 20 lore: - Nature Concentrate durability: 3 ocean: material: INK_SACK - amount: 10 + amount: 20 lore: - Ocean Concentrate factory: Bastion Factory @@ -4344,9 +4259,16 @@ recipes: name: Upgrade to Brick Smelter fuel_consumption_intervall: 8s input: - clay blocks: - material: CLAY + char: + material: COAL + durability: 1 amount: 512 + stone: + material: STONE + amount: 2048 + pickaxe: + material: DIAMOND_PICKAXE + amount: 8 factory: Brick Smelter Upgrade_to_Carpentry: production_time: 900s @@ -4500,91 +4422,93 @@ recipes: fuel_consumption_intervall: 2m input: diamond: - material: DIAMOND - amount: 128 + material: DIAMOND_BLOCK + amount: 64 quartz: material: QUARTZ - amount: 512 + amount: 2048 lapis: - material: INK_SACK - durability: 4 + material: LAPIS_BLOCK + amount: 256 + redstone: + material: REDSTONE_BLOCK amount: 256 factory: Gem Extractor Upgrade_to_Glass_Dying_Factory: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Glass Dying Factory fuel_consumption_intervall: 30s input: glass: material: GLASS - amount: 384 + amount: 576 panes: material: THIN_GLASS - amount: 384 + amount: 576 dye0: material: INK_SACK - amount: 64 + amount: 128 durability: 0 dye1: material: INK_SACK - amount: 64 + amount: 128 durability: 1 dye2: material: INK_SACK - amount: 64 + amount: 128 durability: 2 dye3: material: INK_SACK - amount: 64 + amount: 128 durability: 3 dye4: material: INK_SACK - amount: 64 + amount: 128 durability: 4 dye5: material: INK_SACK - amount: 64 + amount: 128 durability: 5 dye6: material: INK_SACK - amount: 64 + amount: 128 durability: 6 dye7: material: INK_SACK - amount: 64 + amount: 128 durability: 7 dye8: material: INK_SACK - amount: 64 + amount: 128 durability: 8 dye9: material: INK_SACK - amount: 64 + amount: 128 durability: 9 dye10: material: INK_SACK - amount: 64 + amount: 128 durability: 10 dye11: material: INK_SACK - amount: 64 + amount: 128 durability: 11 dye12: material: INK_SACK - amount: 64 + amount: 128 durability: 12 dye13: material: INK_SACK - amount: 64 + amount: 128 durability: 13 dye14: material: INK_SACK - amount: 64 + amount: 128 durability: 14 dye15: material: INK_SACK - amount: 64 + amount: 128 durability: 15 factory: Glass Dying Factory Upgrade_to_Gold_Armour_Forge: @@ -4642,19 +4566,19 @@ recipes: input: beef: material: COOKED_BEEF - amount: 256 + amount: 768 pork: material: GRILLED_PORK - amount: 256 + amount: 768 mutton: material: COOKED_MUTTON amount: 128 chicken: material: COOKED_CHICKEN - amount: 128 + amount: 512 fish: material: COOKED_FISH - amount: 128 + amount: 256 salmon: material: COOKED_FISH amount: 64 @@ -4679,23 +4603,23 @@ recipes: Upgrade_to_Iron_Forge_Advanced: production_time: 3600s type: UPGRADE - name: Upgrade to Iron Forge Advanced + name: Upgrade to Steel Forge fuel_consumption_intervall: 30s input: iron block: material: IRON_BLOCK amount: 64 - factory: Iron Forge Advanced + factory: Steel Forge Upgrade_to_Iron_Forge_Basic: production_time: 1800s type: UPGRADE - name: Upgrade to Iron Forge Basic + name: Upgrade to Iron Forge fuel_consumption_intervall: 15s input: iron block: material: IRON_BLOCK amount: 32 - factory: Iron Forge Basic + factory: Iron Forge Upgrade_to_Kiln: production_time: 1800s type: UPGRADE @@ -4704,14 +4628,14 @@ recipes: input: clay: material: CLAY - amount: 1024 + amount: 1536 char: material: COAL durability: 1 - amount: 128 + amount: 512 lava: material: LAVA_BUCKET - amount: 8 + amount: 16 factory: Kiln Upgrade_to_Laboratory: production_time: 10m @@ -4726,19 +4650,6 @@ recipes: material: CAULDRON_ITEM amount: 32 factory: Laboratory - Upgrade_to_Mad_Scientist: - production_time: 1800s - type: UPGRADE - name: Upgrade to Mad Scientist - fuel_consumption_intervall: 15s - input: - blaze rod: - material: BLAZE_ROD - amount: 128 - squid egg: - material: MONSTER_EGG - durability: 94 - factory: Mad Scientist Upgrade_to_Netherbrick_Smelter: production_time: 1h type: UPGRADE @@ -4750,7 +4661,7 @@ recipes: amount: 384 netherrack: material: NETHERRACK - amount: 1024 + amount: 2048 lavabucket: material: LAVA_BUCKET amount: 16 @@ -4763,14 +4674,14 @@ recipes: fuel_consumption_intervall: 8s input: iron ingot: - material: IRON_INGOT - amount: 512 + material: IRON_BLOCK + amount: 96 coal: - material: COAL - amount: 1024 + material: COAL_BLOCK + amount: 192 redstone: - material: REDSTONE - amount: 256 + material: REDSTONE_BLOCK + amount: 48 factory: Ore Smelter Upgrade_to_Ore_Forge: production_time: 4h @@ -4780,13 +4691,13 @@ recipes: input: iron ingot: material: IRON_BLOCK - amount: 256 + amount: 384 gold ingot: material: GOLD_BLOCK - amount: 128 + amount: 192 coal: material: COAL_BLOCK - amount: 384 + amount: 512 factory: Ore Forge Upgrade_to_Organic_Block_Factory: production_time: 1800s @@ -4796,7 +4707,13 @@ recipes: input: grass: material: GRASS - amount: 128 + amount: 1024 + dirt: + material: DIRT + amount: 1024 + water: + material: WATER_BUCKET + amount: 16 factory: Organic Block Factory Upgrade_to_Printing_Press: production_time: 900s @@ -4868,7 +4785,7 @@ recipes: input: sand: material: SAND - amount: 512 + amount: 1536 factory: Sand Smelter Upgrade_to_Glass_Blowing_Workshop: production_time: 2h @@ -4878,7 +4795,7 @@ recipes: input: sand: material: SAND - amount: 512 + amount: 1536 glass: material: GLASS amount: 1024 @@ -4894,10 +4811,10 @@ recipes: input: sandstone: material: SANDSTONE - amount: 640 + amount: 1280 red sandstone: material: RED_SANDSTONE - amount: 640 + amount: 1280 factory: Sandstone Smelter Upgrade_to_Soup_kitchen: production_time: 2h @@ -4907,13 +4824,13 @@ recipes: input: red mushroom: material: RED_MUSHROOM - amount: 384 + amount: 1024 brown mushroom: material: BROWN_MUSHROOM - amount: 384 + amount: 1024 rabbit: material: RABBIT - amount: 128 + amount: 256 bowl: material: BOWL amount: 128 @@ -4941,8 +4858,13 @@ recipes: fuel_consumption_intervall: 15s input: stone: - material: STONE - amount: 256 + material: BRICK + amount: 108 + lore: + - Compacted Item + picks: + material: DIAMOND_PICKAXE + amount: 12 factory: Stonebrick Smelter Upgrade_to_Tree_Mutator: production_time: 1800s @@ -4985,19 +4907,21 @@ recipes: input: stone: material: STONE - amount: 1152 + amount: 108 + lore: + - Compacted Item otherstone: material: STONE durability: 1 - amount: 256 + amount: 1024 idontevenknowwhatthisoneiscalled: material: STONE durability: 3 - amount: 256 + amount: 1024 morestoneIguess: material: STONE durability: 5 - amount: 256 + amount: 1024 Upgrade_to_Crystallization_Factory: production_time: 10m type: UPGRADE @@ -5278,11 +5202,11 @@ recipes: amount: 256 bucket: material: WATER_BUCKET - amount: 4 + amount: 8 output: bucket: material: BUCKET - amount: 4 + amount: 8 soup: material: MUSHROOM_SOUP lore: @@ -5294,20 +5218,20 @@ recipes: input: sugar: material: SUGAR - amount: 64 + amount: 384 egg: material: EGG - amount: 64 + amount: 192 milk: material: MILK_BUCKET - amount: 4 + amount: 16 wheat: material: WHEAT - amount: 256 + amount: 384 output: buckets: material: BUCKET - amount: 4 + amount: 16 pretzel: material: CAKE lore: @@ -5319,14 +5243,14 @@ recipes: input: sand: material: SAND - amount: 256 + amount: 512 redsand: material: SAND - amount: 128 + amount: 256 durability: 1 cactus: material: CACTUS - amount: 32 + amount: 192 output: sand: material: SAND @@ -5340,13 +5264,13 @@ recipes: input: netherrack: material: NETHERRACK - amount: 384 + amount: 768 slow: material: SOUL_SAND - amount: 64 - quartz: + amount: 192 + glow: material: GLOWSTONE - amount: 16 + amount: 64 output: brick: material: NETHER_BRICK_ITEM @@ -5359,10 +5283,10 @@ recipes: input: endstone: material: ENDER_STONE - amount: 64 + amount: 384 pearls: material: ENDER_PEARL - amount: 16 + amount: 64 output: concentrate: material: ENDER_PEARL @@ -5381,67 +5305,67 @@ recipes: input: dye0: material: INK_SACK - amount: 16 + amount: 32 durability: 0 dye1: material: INK_SACK - amount: 16 + amount: 32 durability: 1 dye2: material: INK_SACK - amount: 16 + amount: 32 durability: 2 dye3: material: INK_SACK - amount: 16 + amount: 32 durability: 3 dye4: material: INK_SACK - amount: 16 + amount: 32 durability: 4 dye5: material: INK_SACK - amount: 16 + amount: 32 durability: 5 dye6: material: INK_SACK - amount: 16 + amount: 32 durability: 6 dye7: material: INK_SACK - amount: 16 + amount: 32 durability: 7 dye8: material: INK_SACK - amount: 16 + amount: 32 durability: 8 dye9: material: INK_SACK - amount: 16 + amount: 32 durability: 9 dye10: material: INK_SACK - amount: 16 + amount: 32 durability: 10 dye11: material: INK_SACK - amount: 16 + amount: 32 durability: 11 dye12: material: INK_SACK - amount: 16 + amount: 32 durability: 12 dye13: material: INK_SACK - amount: 16 + amount: 32 durability: 13 dye14: material: INK_SACK - amount: 16 + amount: 32 durability: 14 dye15: material: INK_SACK - amount: 16 + amount: 32 durability: 15 Craft_Cave_Concentrate: name: Craft Cave Concentrate @@ -5450,13 +5374,16 @@ recipes: input: goldore: material: GOLD_ORE - amount: 16 + amount: 32 lapisore: material: LAPIS_ORE - amount: 16 + amount: 32 redore: material: REDSTONE_ORE - amount: 16 + amount: 32 + diaore: + material: DIAMOND_ORE + amount: 12 output: concentrate: material: COAL_ORE @@ -5469,27 +5396,27 @@ recipes: input: sapling1: material: SAPLING - amount: 8 + amount: 32 durability: 0 sapling2: material: SAPLING - amount: 8 + amount: 32 durability: 1 sapling3: material: SAPLING - amount: 8 + amount: 32 durability: 2 sapling4: material: SAPLING - amount: 8 + amount: 32 durability: 3 sapling5: material: SAPLING - amount: 8 + amount: 32 durability: 4 sapling6: material: SAPLING - amount: 8 + amount: 32 durability: 5 output: concentrate: @@ -5504,13 +5431,13 @@ recipes: input: prismarine: material: PRISMARINE_CRYSTALS - amount: 32 + amount: 128 moreprismarine: material: PRISMARINE_SHARD - amount: 96 + amount: 512 ink: material: INK_SACK - amount: 64 + amount: 256 output: ocean: material: INK_SACK @@ -5790,6 +5717,261 @@ recipes: material: STAINED_GLASS amount: 64 durability: 15 + Dye_Wool_Orange: + name: Dye Wool Orange + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 14 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 1 + Dye_Wool_Magenta: + name: Dye Wool Magenta + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 13 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 2 + Dye_Wool_Light_Blue: + name: Dye Wool Light Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 12 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 3 + Dye_Wool_Yellow: + name: Dye Wool Yellow + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 11 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 4 + Dye_Wool_Lime: + name: Dye Wool Lime + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 10 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 5 + Dye_Wool_Pink: + name: Dye Wool Pink + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 9 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 6 + Dye_Wool_Gray: + name: Dye Wool Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 8 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 7 + Dye_Wool_Light_Gray: + name: Dye Wool Light Gray + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 7 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 8 + Dye_Wool_Cyan: + name: Dye Wool Cyan + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 6 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 9 + Dye_Wool_Purple: + name: Dye Wool Purple + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 5 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 10 + Dye_Wool_Blue: + name: Dye Wool Blue + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 4 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 11 + Dye_Wool_Brown: + name: Dye Wool Brown + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 3 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 12 + Dye_Wool_Green: + name: Dye Wool Green + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 2 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 13 + Dye_Wool_Red: + name: Dye Wool Red + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 1 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 14 + Dye_Wool_Black: + name: Dye Wool Black + type: PRODUCTION + production_time: 10s + input: + glass: + material: WOOL + amount: 64 + dye: + material: INK_SACK + amount: 4 + durability: 0 + output: + dyedwool: + material: WOOL + amount: 64 + durability: 15 Dye_GlassPanes_White: name: Dye Glass Panes White type: PRODUCTION @@ -6131,46 +6313,9 @@ recipes: enchants: dura: enchant: DURABILITY - Upgrade_to_Emerald_Extractor: - name: Upgrade to Emerald Extractor - production_time: 4h - fuel_consumption_intervall: 2m - type: UPGRADE - factory: Emerald Extractor - input: - potato: - material: BAKED_POTATO - amount: 512 - carrots: - material: CARROT_ITEM - amount: 512 - mushroom: - material: BROWN_MUSHROOM - amount: 256 - yesdiet_more_mushroom: - material: RED_MUSHROOM - amount: 256 - aether: - material: GOLD_NUGGET - amount: 256 - lore: - - Aether - enchants: - dura: - enchant: DURABILITY - vines: - material: VINE - amount: 128 - grass: - material: LONG_GRASS - amount: 256 - durability: 1 - pumpkin: - material: PUMPKIN - amount: 256 - melon: - material: MELON_BLOCK - amount: 128 + + + ## XP Generation Recipes # Upgrades @@ -9526,3 +9671,15 @@ recipes: input: dirt: material: DIRT + +renames: + husbandry: + oldName: Animal Husbandry Factory Basic + newName: Animal Husbandry Factory + advancedforge: + oldName: Iron Forge Advanced + newName: Steel Forge + normalforge: + oldName: Iron Forge Basic + newName: Iron Forge + From 9bdc5ef20598824a208684b2a7984b8b868227b0 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Sat, 16 Apr 2016 23:33:41 -0400 Subject: [PATCH 374/459] Adding ability to pick which output of the RANDOM recipe should be shown as display, optionally. --- config.yml | 4 +++ pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 27 ++++++++++++------- .../recipes/RandomOutputRecipe.java | 24 ++++++++++------- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/config.yml b/config.yml index 9b869011..40ee6b0c 100644 --- a/config.yml +++ b/config.yml @@ -544,6 +544,9 @@ factories: #Random recipes allow you to specify multiple different outputs for a recipe and to assign a certain chance to each. The sum of all the #chances should always be 1.0 +#Optionally use "display:" to pick which output to show in the GUI; otherwise the least-likely option +# will be shown. + #Example: #random: @@ -554,6 +557,7 @@ factories: # diamond: # material: DIAMOND # outputs: +# display: second # first: # chance: 0.5 # dirt: diff --git a/pom.xml b/pom.xml index e5448357..f9f1657b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.3 + 2.1.4 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 0c454268..e9311855 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -540,24 +540,33 @@ private IRecipe parseRecipe(ConfigurationSection config) { result = new DeterministicEnchantingRecipe(name, productionTime, inp, tool, enchant, level); break; case "RANDOM": - ItemMap inpu = parseItemMap(config - .getConfigurationSection("input")); - if (config.getConfigurationSection("outputs") == null) { + ItemMap inpu = parseItemMap(config.getConfigurationSection("input")); + ConfigurationSection outputSec = config.getConfigurationSection("outputs"); + if (outputSec == null) { plugin.severe("No outputs specified for recipe " + name); return null; } Map outputs = new HashMap(); double totalChance = 0.0; - for(String key : config.getConfigurationSection("outputs").getKeys(false)) { - double chance = config.getConfigurationSection("outputs").getConfigurationSection(key).getDouble("chance"); - totalChance += chance; - ItemMap im = parseItemMap(config.getConfigurationSection("outputs").getConfigurationSection(key)); - outputs.put(im,chance); + String displayMap = outputSec.getString("display"); + ItemMap displayThis = null; + for(String key : outputSec.getKeys(false)) { + ConfigurationSection keySec = outputSec.getConfigurationSection(key); + if (keySec != null) { + double chance = keySec.getDouble("chance"); + totalChance += chance; + ItemMap im = parseItemMap(keySec); + outputs.put(im,chance); + if (key.equals(displayMap)) { + displayThis = im; + plugin.debug("Displaying " + displayMap + " as recipe label"); + } + } } if (Math.abs(totalChance - 1.0) > 0.001) { plugin.warning("Sum of output chances for recipe " + name + " is not 1.0. Total sum is: " + totalChance); } - result = new RandomOutputRecipe(name, productionTime, inpu, outputs); + result = new RandomOutputRecipe(name, productionTime, inpu, outputs, displayThis); break; case "COSTRETURN": ItemMap costIn = parseItemMap(config diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java index a82253a0..89ce9878 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -21,23 +21,27 @@ public class RandomOutputRecipe extends InputRecipe { private ItemMap lowestChanceMap; public RandomOutputRecipe(String name, int productionTime, ItemMap input, - Map outputs) { + Map outputs, ItemMap displayOutput) { super(name, productionTime, input); this.outputs = outputs; if (rng == null) { rng = new Random(); } - for(Entry entry : outputs.entrySet()) { - if (lowestChanceMap == null) { - lowestChanceMap = entry.getKey(); - continue; + if (displayOutput == null) { + for(Entry entry : outputs.entrySet()) { + if (lowestChanceMap == null) { + lowestChanceMap = entry.getKey(); + continue; + } + if (entry.getValue() < outputs.get(lowestChanceMap)) { + lowestChanceMap = entry.getKey(); + } } - if (entry.getValue() < outputs.get(lowestChanceMap)) { - lowestChanceMap = entry.getKey(); + if (lowestChanceMap == null) { + lowestChanceMap = new ItemMap(new ItemStack(Material.STONE)); } - } - if (lowestChanceMap == null) { - lowestChanceMap = new ItemMap(new ItemStack(Material.STONE)); + } else { + lowestChanceMap = displayOutput; } } From 3a098dcade5594c88d55e01762a010060773fb9a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 17 Apr 2016 18:12:11 +0200 Subject: [PATCH 375/459] Fix compacting dupe with items stack to 16 --- pom.xml | 2 +- .../FactoryMod/recipes/CompactingRecipe.java | 2 +- .../recipes/DecompactingRecipe.java | 2 +- .../FactoryMod/utility/FileHandler.java | 30 +++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f9f1657b..cecd5439 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.4 + 2.1.5 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 42f0669e..ae4dc649 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -17,7 +17,7 @@ * Used to "compact" itemstack, which means complete stacks are reduced to a * single lored item, which can be stacked. This makes the transportation of * those items much easier. Additionally there can be a cost for each - * compaction. + * compaction. Items that stack to * */ public class CompactingRecipe extends InputRecipe { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index e8bd2155..a9437a08 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -53,7 +53,7 @@ public void applyEffect(Inventory i, Factory f) { && im.getLore().get(0).equals(compactedLore)) { List loreList = new LinkedList(); ItemStack decompatedStack = is.clone(); - decompatedStack.setAmount(64); + decompatedStack.setAmount(decompatedStack.getType().getMaxStackSize()); im.setLore(loreList); // not changing the original because getItemMeta() just // gives a copy diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index 706f8bc9..7943fdce 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -220,6 +220,21 @@ private void loadFromFile(File f, Map eggs) { break; case "PIPE": PipeEgg pipeEgg = (PipeEgg) eggs.get(name); + if (pipeEgg == null) { + String replaceName = factoryRenames.get(name); + if (replaceName != null) { + pipeEgg = (PipeEgg) eggs.get(replaceName); + } + if (pipeEgg == null) { + plugin.warning("Save file contained factory named " + + name + + " , but no factory with this name was found in the config"); + continue; + } + else { + name = replaceName; + } + } List mats = new LinkedList(); if (current.isSet("materials")) { for (String mat : current.getStringList("materials")) { @@ -238,6 +253,21 @@ private void loadFromFile(File f, Map eggs) { case "SORTER": Map assignments = new HashMap(); SorterEgg sorterEgg = (SorterEgg) eggs.get(name); + if (sorterEgg == null) { + String replaceName = factoryRenames.get(name); + if (replaceName != null) { + sorterEgg = (SorterEgg) eggs.get(replaceName); + } + if (sorterEgg == null) { + plugin.warning("Save file contained factory named " + + name + + " , but no factory with this name was found in the config"); + continue; + } + else { + name = replaceName; + } + } for (String face : current.getConfigurationSection("faces") .getKeys(false)) { List stacks = (List) current From 98176ce19e3a10d7c6df37e00b030f971a11dffb Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 17 Apr 2016 20:04:52 +0200 Subject: [PATCH 376/459] Wrap up rebalancing of standard stuff --- configCivcraft.yml | 661 +++++++++++++++++++++++++++++++-------------- 1 file changed, 457 insertions(+), 204 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index caeaeb1f..dbffd860 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -483,10 +483,10 @@ factories: type: FCCUPGRADE name: Gold Equipment Forge recipes: - - Forge_Gold_Pickaxe - - Forge_Gold_Shovel - - Forge_Gold_Breastplate - - Forge_Gold_Leggings + - Forge_Gold_Pickaxe_Basic + - Forge_Gold_Shovel_Basic + - Forge_Gold_Breastplate_Basic + - Forge_Gold_Leggings_Basic - Repair_Factory - Upgrade_to_Gold_Armour_Forge - Upgrade_to_Gold_Tools_Forge @@ -494,10 +494,10 @@ factories: type: FCCUPGRADE name: Diamond Equipment Forge recipes: - - Forge_Diamond_Pickaxe - - Forge_Diamond_Shovel - - Forge_Diamond_Breastplate - - Forge_Diamond_Leggings + - Forge_Diamond_Pickaxe_Basic + - Forge_Diamond_Shovel_Basic + - Forge_Diamond_Breastplate_Basic + - Forge_Diamond_Leggings_Basic - Repair_Advanced_Factory - Upgrade_to_Diamond_Armour_Forge - Upgrade_to_Diamond_Tools_Forge @@ -576,6 +576,7 @@ factories: dedicatedcompactor: type: FCCUPGRADE name: Dedicated Compactor + updatetime: 5t recipes: - Compact_Stack_Advanced - Repair_Advanced_Factory @@ -587,7 +588,7 @@ factories: - Repair_Advanced_Factory redstonefactorybasic: type: FCCUPGRADE - name: Redstone Factory Basic + name: Redstone Techniques recipes: - Craft_Redstone_Repeater_Advanced - Craft_Redstone_Torch_Basic @@ -599,7 +600,7 @@ factories: - Upgrade_to_Dowsing_Factory redstonecircularityfactory: type: FCCUPGRADE - name: Redstone Circularity Factory + name: Redstone Electronics recipes: - Craft_Redstone_Repeater_Advanced - Craft_Redstone_Torch_Advanced @@ -609,7 +610,7 @@ factories: - Repair_Advanced_Factory redstonemechanicsfactory: type: FCCUPGRADE - name: Redstone Mechanics Factory + name: Redstone Mechanics recipes: - Craft_Piston - Craft_Sticky_Piston @@ -1433,15 +1434,16 @@ recipes: Compact_Stack_Advanced: type: COMPACT name: Compact Stack - production_time: 1s + fuel_consumption_intervall: 5t + production_time: 5t input: crate: material: CHEST lore: - Crate - amount: 1 compact_lore: Compacted Item - excluded_materials: -BOOK + excluded_materials: + - BOOK Compact_Stack_Basic: type: COMPACT name: Compact Stack @@ -1451,9 +1453,9 @@ recipes: material: CHEST lore: - Crate - amount: 1 compact_lore: Compacted Item - excluded_materials: -BOOK + excluded_materials: + - BOOK Convert_Normal_Sand_to_Red_Sand: type: PRODUCTION name: Extract Red Sand @@ -2479,18 +2481,6 @@ recipes: emptybucket: material: BUCKET amount: 1 - Create_any_hostile_mob_egg: - type: PRODUCTION - name: Create any hostile mob egg - production_time: 5s - input: - identifiername: - material: STONE - amount: 1 - output: - identifiername: - material: STONE - amount: 1 Create_Bastion: type: PRODUCTION name: Create Bastion @@ -2745,12 +2735,13 @@ recipes: durability: -2 De-compact_Stack_Advanced: type: DECOMPACT - name: De-compact Stack - production_time: 1s + name: Decompact Stack + production_time: 5t + fuel_consumption_intervall: 5t compact_lore: Compacted Item De-compact_Stack_Basic: type: DECOMPACT - name: De-compact Stack + name: Decompact Stack production_time: 5s compact_lore: Compacted Item Extract_Diamonds: @@ -2841,71 +2832,83 @@ recipes: Forge_Diamond_Axe: type: PRODUCTION name: Forge Diamond Axe - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 16 + amount: 8 output: diamond axe: material: DIAMOND_AXE - amount: 8 + amount: 4 Forge_Diamond_Boots: type: PRODUCTION name: Forge Diamond Boots - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 24 + amount: 12 output: diamond boots: material: DIAMOND_BOOTS - amount: 8 + amount: 4 Forge_Diamond_Breastplate: type: PRODUCTION name: Forge Diamond Breastplate - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 48 + amount: 24 output: diamond chestplate: material: DIAMOND_CHESTPLATE - amount: 8 + amount: 4 + Forge_Diamond_Breastplate_Basic: + type: PRODUCTION + name: Forge Diamond Breastplate + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 28 + output: + diamond chestplate: + material: DIAMOND_CHESTPLATE + amount: 4 Forge_Diamond_Helmet: type: PRODUCTION name: Forge Diamond Helmet - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 32 + amount: 15 output: diamond helmet: material: DIAMOND_HELMET - amount: 8 + amount: 4 Forge_Diamond_Hoe: type: PRODUCTION name: Forge Diamond Hoe - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 8 + amount: 6 output: diamond hoe: material: DIAMOND_HOE - amount: 8 + amount: 4 Forge_Diamond_Horse_Armour: type: PRODUCTION name: Forge Diamond Horse Armour - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 12 + amount: 20 output: diamond horse armor: material: DIAMOND_BARDING @@ -2913,35 +2916,71 @@ recipes: Forge_Diamond_Leggings: type: PRODUCTION name: Forge Diamond Leggings - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 40 + amount: 21 output: diamond leggings: material: DIAMOND_LEGGINGS - amount: 8 + amount: 4 + Forge_Diamond_Leggings_Basic: + type: PRODUCTION + name: Forge Diamond Leggings + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 25 + output: + diamond leggings: + material: DIAMOND_LEGGINGS + amount: 4 Forge_Diamond_Pickaxe: type: PRODUCTION name: Forge Diamond Pickaxe - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 16 + amount: 9 output: diamond pickaxe: material: DIAMOND_PICKAXE - amount: 8 + amount: 4 Forge_Diamond_Shovel: type: PRODUCTION name: Forge Diamond Shovel - production_time: 5s + production_time: 16s input: diamond: material: DIAMOND - amount: 6 + amount: 3 + output: + diamond shovel: + material: DIAMOND_SPADE + amount: 4 + Forge_Diamond_Pickaxe_Basic: + type: PRODUCTION + name: Forge Diamond Pickaxe + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 21 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 8 + Forge_Diamond_Shovel_Basic: + type: PRODUCTION + name: Forge Diamond Shovel + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 7 output: diamond shovel: material: DIAMOND_SPADE @@ -2961,71 +3000,83 @@ recipes: Forge_Gold_Axe: type: PRODUCTION name: Forge Gold Axe - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 16 + amount: 8 output: gold axe: material: GOLD_AXE - amount: 8 + amount: 4 Forge_Gold_Boots: type: PRODUCTION name: Forge Gold Boots - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 24 + amount: 12 output: gold boots: material: GOLD_BOOTS - amount: 8 + amount: 4 Forge_Gold_Breastplate: type: PRODUCTION name: Forge Gold Breastplate - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 48 + amount: 24 output: gold chestplate: material: GOLD_CHESTPLATE - amount: 8 + amount: 4 + Forge_Gold_Breastplate_Basic: + type: PRODUCTION + name: Forge Gold Breastplate + production_time: 32s + input: + gold: + material: GOLD_INGOT + amount: 28 + output: + gold chestplate: + material: GOLD_CHESTPLATE + amount: 4 Forge_Gold_Helmet: type: PRODUCTION name: Forge Gold Helmet - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 32 + amount: 15 output: gold helmet: material: GOLD_HELMET - amount: 8 + amount: 4 Forge_Gold_Hoe: type: PRODUCTION name: Forge Gold Hoe - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 8 + amount: 6 output: gold hoe: material: GOLD_HOE - amount: 8 + amount: 4 Forge_Gold_Horse_Armour: type: PRODUCTION name: Forge Gold Horse Armour - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 12 + amount: 20 output: gold horse armor: material: GOLD_BARDING @@ -3033,35 +3084,71 @@ recipes: Forge_Gold_Leggings: type: PRODUCTION name: Forge Gold Leggings - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 40 + amount: 21 output: gold leggings: material: GOLD_LEGGINGS - amount: 8 + amount: 4 + Forge_Gold_Leggings_Basic: + type: PRODUCTION + name: Forge Gold Leggings + production_time: 32s + input: + gold: + material: GOLD_INGOT + amount: 25 + output: + gold leggings: + material: GOLD_LEGGINGS + amount: 4 Forge_Gold_Pickaxe: type: PRODUCTION name: Forge Gold Pickaxe - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 16 + amount: 9 output: gold pickaxe: material: GOLD_PICKAXE - amount: 8 + amount: 4 Forge_Gold_Shovel: type: PRODUCTION name: Forge Gold Shovel - production_time: 5s + production_time: 16s input: - gold ingot: + gold: material: GOLD_INGOT - amount: 6 + amount: 3 + output: + gold shovel: + material: GOLD_SPADE + amount: 4 + Forge_Gold_Pickaxe_Basic: + type: PRODUCTION + name: Forge Gold Pickaxe + production_time: 32s + input: + gold: + material: GOLD_INGOT + amount: 21 + output: + gold pickaxe: + material: GOLD_PICKAXE + amount: 8 + Forge_Gold_Shovel_Basic: + type: PRODUCTION + name: Forge Gold Shovel + production_time: 32s + input: + gold: + material: GOLD_INGOT + amount: 7 output: gold shovel: material: GOLD_SPADE @@ -3071,7 +3158,7 @@ recipes: name: Forge Gold Sword production_time: 5s input: - gold ingot: + gold: material: GOLD_INGOT amount: 10 output: @@ -3081,71 +3168,71 @@ recipes: Forge_Iron_Axe: type: PRODUCTION name: Forge Iron Axe - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 16 + amount: 8 output: iron axe: material: IRON_AXE - amount: 8 + amount: 4 Forge_Iron_Boots: type: PRODUCTION name: Forge Iron Boots - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 24 + amount: 12 output: iron boots: material: IRON_BOOTS - amount: 8 + amount: 4 Forge_Iron_Breastplate: type: PRODUCTION name: Forge Iron Breastplate - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 48 + amount: 24 output: iron chestplate: material: IRON_CHESTPLATE - amount: 8 + amount: 4 Forge_Iron_Helmet: type: PRODUCTION name: Forge Iron Helmet - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 32 + amount: 15 output: iron helmet: material: IRON_HELMET - amount: 8 + amount: 4 Forge_Iron_Hoe: type: PRODUCTION name: Forge Iron Hoe - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 8 + amount: 6 output: iron hoe: material: IRON_HOE - amount: 8 + amount: 4 Forge_Iron_Horse_Armour: type: PRODUCTION name: Forge Iron Horse Armour - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 12 + amount: 20 output: iron horse armor: material: IRON_BARDING @@ -3153,45 +3240,45 @@ recipes: Forge_Iron_Leggings: type: PRODUCTION name: Forge Iron Leggings - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 40 + amount: 21 output: iron leggings: material: IRON_LEGGINGS - amount: 8 + amount: 4 Forge_Iron_Pickaxe: type: PRODUCTION name: Forge Iron Pickaxe - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 16 + amount: 9 output: iron pickaxe: material: IRON_PICKAXE - amount: 8 + amount: 4 Forge_Iron_Shovel: type: PRODUCTION name: Forge Iron Shovel - production_time: 5s + production_time: 16s input: - iron ingot: + iron: material: IRON_INGOT - amount: 6 + amount: 3 output: iron shovel: material: IRON_SPADE - amount: 8 + amount: 4 Forge_Iron_Sword: type: PRODUCTION name: Forge Iron Sword production_time: 5s input: - iron ingot: + iron: material: IRON_INGOT amount: 10 output: @@ -3201,51 +3288,51 @@ recipes: Forge_Stone_Axe: type: PRODUCTION name: Forge Stone Axe - production_time: 5s + production_time: 16s input: stone: material: COBBLESTONE - amount: 16 + amount: 8 output: stone axe: material: STONE_AXE - amount: 8 + amount: 4 Forge_Stone_Hoe: type: PRODUCTION name: Forge Stone Hoe - production_time: 5s + production_time: 16s input: stone: material: COBBLESTONE - amount: 8 + amount: 6 output: stone hoe: material: STONE_HOE - amount: 8 + amount: 4 Forge_Stone_Pickaxe: type: PRODUCTION name: Forge Stone Pickaxe - production_time: 5s + production_time: 16s input: stone: material: COBBLESTONE - amount: 16 + amount: 9 output: stone pickaxe: material: STONE_PICKAXE - amount: 8 + amount: 4 Forge_Stone_Shovel: type: PRODUCTION name: Forge Stone Shovel - production_time: 5s + production_time: 16s input: stone: material: COBBLESTONE - amount: 6 + amount: 3 output: stone shovel: material: STONE_SPADE - amount: 8 + amount: 4 Forge_Stone_Sword: type: PRODUCTION name: Forge Stone Sword @@ -4299,75 +4386,132 @@ recipes: input: piston: material: PISTON_BASE - amount: 6 + amount: 128 + pistonSticky: + material: PISTON_STICKY_BASE + amount: 128 chest: material: CHEST + amount: 256 + iron: + material: IRON_BLOCK amount: 64 - iron ingot: - material: IRON_INGOT + redstone: + material: REDSTONE_BLOCK amount: 32 + crate: + material: CHEST + amount: 256 + lore: + - Crate factory: Compactor Basic Upgrade_to_Dedicated_Compactor: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Dedicated Compactor fuel_consumption_intervall: 30s input: piston: - material: PISTON_BASE - amount: 6 + material: PISTON_STICKY_BASE + amount: 512 chest: material: CHEST + amount: 1024 + iron: + material: IRON_BLOCK + amount: 192 + redstone: + material: REDSTONE_BLOCK amount: 64 - iron ingot: - material: IRON_INGOT - amount: 48 + crate: + material: CHEST + amount: 512 + lore: + - Crate factory: Dedicated Compactor Upgrade_to_Dedicated_De-Compactor: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Dedicated De-Compactor fuel_consumption_intervall: 30s input: - sticky piston: - material: PISTON_STICKY_BASE - amount: 6 + piston: + material: PISTON_STICKY_BASE + amount: 512 chest: material: CHEST + amount: 1024 + iron: + material: IRON_BLOCK + amount: 192 + redstone: + material: REDSTONE_BLOCK amount: 64 - iron ingot: - material: IRON_INGOT - amount: 48 + crate: + material: CHEST + amount: 512 + lore: + - Crate factory: Dedicated De-Compactor Upgrade_to_Diamond_Armour_Forge: - production_time: 7200s + production_time: 2h type: UPGRADE name: Upgrade to Diamond Armour Forge fuel_consumption_intervall: 60s input: diamond block: material: DIAMOND_BLOCK - amount: 48 + amount: 128 + char: + material: COAL + durability: 1 + amount: 1024 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 256 factory: Diamond Armour Forge Upgrade_to_Diamond_Equipment_Forge: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Diamond Equipment Forge fuel_consumption_intervall: 30s input: diamond block: material: DIAMOND_BLOCK - amount: 32 + amount: 48 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 8 + anvil: + material: ANVIL + amount: 64 factory: Diamond Equipment Forge Upgrade_to_Diamond_Tools_Forge: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Diamond Tools Forge fuel_consumption_intervall: 30s input: diamond block: material: DIAMOND_BLOCK - amount: 32 + amount: 96 + char: + material: COAL + durability: 1 + amount: 1024 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 256 factory: Diamond Tools Forge Upgrade_to_Farmstead_Factory: production_time: 10m @@ -4511,35 +4655,77 @@ recipes: amount: 128 durability: 15 factory: Glass Dying Factory - Upgrade_to_Gold_Armour_Forge: - production_time: 3600s - type: UPGRADE - name: Upgrade to Gold Armour Forge - fuel_consumption_intervall: 30s - input: - gold block: - material: GOLD_BLOCK - amount: 48 - factory: Gold Armour Forge Upgrade_to_Gold_Equipment_Forge: - production_time: 1800s + production_time: 30m type: UPGRADE name: Upgrade to Gold Equipment Forge fuel_consumption_intervall: 15s input: gold block: material: GOLD_BLOCK - amount: 32 + amount: 192 + char: + material: COAL + durability: 1 + amount: 512 + wood: + material: WOOD + durability: -1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 64 factory: Gold Equipment Forge + Upgrade_to_Gold_Armour_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Gold Armour Forge + fuel_consumption_intervall: 30s + input: + gold block: + material: GOLD_BLOCK + amount: 384 + char: + material: COAL + durability: 1 + amount: 1024 + wood: + material: WOOD + durability: -1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 192 + factory: Gold Armour Forge Upgrade_to_Gold_Tools_Forge: - production_time: 3600s + production_time: 1h type: UPGRADE name: Upgrade to Gold Tools Forge fuel_consumption_intervall: 30s input: gold block: material: GOLD_BLOCK - amount: 32 + amount: 384 + char: + material: COAL + durability: 1 + amount: 1024 + wood: + material: WOOD + durability: -1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 192 factory: Gold Tools Forge Upgrade_to_Grass_Gardening: production_time: 1h @@ -4598,7 +4784,21 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 48 + amount: 128 + wood: + material: WOOD + durability: -1 + amount: 512 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 12 + anvil: + material: ANVIL + amount: 64 factory: Iron Equipment Forge Upgrade_to_Iron_Forge_Advanced: production_time: 3600s @@ -4608,7 +4808,17 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 64 + amount: 512 + char: + material: COAL + durability: 1 + amount: 1024 + anvil: + material: ANVIL + amount: 384 + lava: + material: LAVA_BUCKET + amount: 24 factory: Steel Forge Upgrade_to_Iron_Forge_Basic: production_time: 1800s @@ -4618,7 +4828,14 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 32 + amount: 192 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 8 factory: Iron Forge Upgrade_to_Kiln: production_time: 1800s @@ -4734,49 +4951,86 @@ recipes: name: Upgrade to Rail Factory fuel_consumption_intervall: 15s input: - iron ingot: - material: IRON_INGOT + iron: + material: IRON_BLOCK amount: 128 - redstone dust: - material: REDSTONE + redstone: + material: REDSTONE_BLOCK + amount: 32 + gold: + material: GOLD_BLOCK amount: 32 + char: + material: COAL + durability: 1 + amount: 512 + anvil: + material: ANVIL + amount: 128 + lava: + material: LAVA_BUCKET + amount: 16 + wood: + material: WOOD + durability: -1 + amount: 1024 + factory: Rail Factory Upgrade_to_Redstone_Circularity_Factory: production_time: 1800s type: UPGRADE - name: Upgrade to Redstone Circularity Factory + name: Upgrade to Redstone Electronics fuel_consumption_intervall: 15s input: redstone dust: - material: REDSTONE - amount: 128 + material: REDSTONE_BLOCK + amount: 384 quartz: material: QUARTZ + amount: 1024 + glass: + material: GLASS + amount: 512 + gold: + material: GOLD_BLOCK amount: 64 - factory: Redstone Circularity Factory + factory: Redstone Electronics Upgrade_to_Redstone_Factory_Basic: production_time: 900s type: UPGRADE - name: Upgrade to Redstone Factory Basic + name: Upgrade to Redstone Techniques fuel_consumption_intervall: 8s input: redstone dust: material: REDSTONE amount: 128 - factory: Redstone Factory Basic + factory: Redstone Techniques Upgrade_to_Redstone_Mechanics_Factory: production_time: 1800s type: UPGRADE - name: Upgrade to Redstone Mechanics Factory + name: Upgrade to Redstone Mechanics fuel_consumption_intervall: 15s input: redstone dust: - material: REDSTONE + material: REDSTONE_BLOCK + amount: 384 + quartz: + material: QUARTZ amount: 128 - iron ingot: - material: IRON_INGOT - amount: 64 - factory: Redstone Mechanics Factory + stone: + material: STONE + amount: 1024 + string: + material: STRING + amount: 512 + glowstone: + material: GLOWSTONE + amount: 512 + wood: + material: WOOD + amount: 512 + durability: -1 + factory: Redstone Mechanics Upgrade_to_Sand_Smelter: production_time: 20m type: UPGRADE @@ -9673,13 +9927,12 @@ recipes: material: DIRT renames: - husbandry: - oldName: Animal Husbandry Factory Basic - newName: Animal Husbandry Factory - advancedforge: - oldName: Iron Forge Advanced - newName: Steel Forge - normalforge: - oldName: Iron Forge Basic - newName: Iron Forge - + redstone1: + oldName: Redstone Mechanics Factory + newName: Redstone Mechanics + redstone2: + oldName: Redstone Circularity Factory + newName: Redstone Electronics + redstone0: + oldName: Redstone Factory Basic + newName: Redstone Techniques From a782ec08dddd1b72a682117590f71554e4bb1ecc Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 19 Apr 2016 22:30:10 +0200 Subject: [PATCH 377/459] Allow compaction of lored items and items that stack to 1 --- pom.xml | 2 +- .../FactoryMod/recipes/CompactingRecipe.java | 81 +++++++++++++------ .../recipes/DecompactingRecipe.java | 74 ++++++++++------- 3 files changed, 103 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index cecd5439..bfa84c7f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.5 + 2.1.6 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index ae4dc649..413ab210 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -11,13 +11,14 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; /** - * Used to "compact" itemstack, which means complete stacks are reduced to a - * single lored item, which can be stacked. This makes the transportation of - * those items much easier. Additionally there can be a cost for each - * compaction. Items that stack to + * Used to compact items, which means whole or multiple stacks of an item are reduced to a single lored item, which is stackable to the same stacksize + * As the original material. This makes the transportation of + * those items much easier, additionally there can be a cost for each + * compaction. Items that stack to 64 and 16 will be compacted per stack and items that stack to 1 will be compacted with a 8:1 ratio * */ public class CompactingRecipe extends InputRecipe { @@ -35,9 +36,10 @@ public boolean enoughMaterialAvailable(Inventory i) { if (!input.isContainedIn(i)) { return false; } + ItemMap im = new ItemMap(i); for (ItemStack is : i.getContents()) { if (is != null) { - if (compactable(is)) { + if (compactable(is, im)) { return true; } } @@ -56,11 +58,15 @@ public String getRecipeName() { public void applyEffect(Inventory i, Factory f) { logBeforeRecipeRun(i, f); if (input.isContainedIn(i)) { + ItemMap im = new ItemMap(i); + //technically we could just directly work with the ItemMap here to iterate over the items so we dont check identical items multiple times, + //but using the iterator of the inventory preserves the order of the inventory, which is more important here to guarantee one behavior + //to the player for (ItemStack is : i.getContents()) { if (is != null) { - if (compactable(is)) { + if (compactable(is, im)) { if (input.removeSafelyFrom(i)) { - compact(is); + compact(is,i); } break; } @@ -79,9 +85,10 @@ public List getInputRepresentation(Inventory i) { return result; } result = createLoredStacksForInfo(i); + ItemMap im = new ItemMap(i); for (ItemStack is : i.getContents()) { if (is != null) { - if (compactable(is)) { + if (compactable(is, im)) { ItemStack compactedStack = is.clone(); result.add(compactedStack); break; @@ -95,15 +102,16 @@ public List getOutputRepresentation(Inventory i) { List result = new LinkedList(); if (i == null) { ItemStack is = new ItemStack(Material.STONE, 64); - compact(is); + compactStack(is); result.add(is); return result; } + ItemMap im = new ItemMap(i); for (ItemStack is : i.getContents()) { if (is != null) { - if (compactable(is)) { + if (compactable(is, im)) { ItemStack decompactedStack = is.clone(); - compact(decompactedStack); + compactStack(decompactedStack); result.add(decompactedStack); break; } @@ -122,28 +130,55 @@ public ItemStack getRecipeRepresentation() { } /** - * Changes the lore of the given ItemStack to the compacted lore and sets - * it's amount to 1 + * Removes the amount required to compact the given ItemStack from the given inventory and adds a comapcted item to the inventory * * @param is */ - private void compact(ItemStack is) { - ISUtils.addLore(is, compactedLore); + private void compact(ItemStack is, Inventory i) { + ItemStack copy = is.clone(); + copy.setAmount(getCompactStackSize(copy.getType())); + ItemMap toRemove = new ItemMap(copy); + if (toRemove.removeSafelyFrom(i)) { + compactStack(copy); + i.addItem(copy); + } + } + + /** + * Applies the lore and set the amount to 1. Dont call this directly if you want to compact items for players + */ + private void compactStack(ItemStack is) { + ISUtils.addLore(is,compactedLore); is.setAmount(1); } + public static int getCompactStackSize(Material m) { + switch (m.getMaxStackSize()) { + case 64: return 64; + case 16: return 16; + case 1: return 8; + default: + FactoryMod.getPlugin().warning("Unknown max stacksize for type " + m.toString()); + } + return 999999; //prevents compacting in error case, because never enough will fit in a chest + } /** - * Checks whether compacting a stack is allowed, which means it doesnt have - * meta data, it's a full stack and it's not on the list of excluded - * materials + * Checks whether enough of a certain item stack is available to compact it * * @param is * ItemStack to check + * @param im + * ItemMap representing the inventory from which is compacted * @return True if compacting the stack is allowed, false if not */ - private boolean compactable(ItemStack is) { - return is.getMaxStackSize() != 1 - && !excludedMaterials.contains(is.getType()) - && is.getAmount() == is.getMaxStackSize() && !is.hasItemMeta(); + private boolean compactable(ItemStack is, ItemMap im) { + if (is == null || excludedMaterials.contains(is.getType()) || (input.getAmount(is) != 0) || (is.getItemMeta().getLore() != null && + is.getItemMeta().getLore().contains(compactedLore))) { + return false; + } + if (im.getAmount(is) >= getCompactStackSize(is.getType())) { + return true; + } + return false; } -} +} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index a9437a08..625c792a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -34,8 +34,7 @@ public boolean enoughMaterialAvailable(Inventory i) { } for (ItemStack is : i.getContents()) { if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { + if (isDecompactable(is)) { return true; } } @@ -48,22 +47,20 @@ public void applyEffect(Inventory i, Factory f) { if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() - && im.getLore().get(0).equals(compactedLore)) { - List loreList = new LinkedList(); - ItemStack decompatedStack = is.clone(); - decompatedStack.setAmount(decompatedStack.getType().getMaxStackSize()); - im.setLore(loreList); - // not changing the original because getItemMeta() just - // gives a copy - decompatedStack.setItemMeta(im); - if (new ItemMap(decompatedStack).fitsIn(i)) { - if (input.removeSafelyFrom(i)) { - ItemStack removeLoredStack = is.clone(); - removeLoredStack.setAmount(1); - i.removeItem(removeLoredStack); - i.addItem(decompatedStack); + if (isDecompactable(is)) { + ItemStack removeClone = is.clone(); + removeClone.setAmount(1); + ItemMap toRemove = new ItemMap(removeClone); + ItemMap toAdd = new ItemMap(); + removeCompactLore(removeClone); + toAdd.addItemAmount(removeClone, CompactingRecipe.getCompactStackSize(removeClone.getType())); + if (toAdd.fitsIn(i)) { //fits in chest + if (input.removeSafelyFrom(i)) { //remove extra input + if (toRemove.removeSafelyFrom(i)) { //remove one compacted item + for(ItemStack add : toAdd.getItemStackRepresentation()) { + i.addItem(add); + } + } } } break; @@ -86,8 +83,7 @@ public List getInputRepresentation(Inventory i) { result = createLoredStacksForInfo(i); for (ItemStack is : i.getContents()) { if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { + if (isDecompactable(is)) { ItemStack compactedStack = is.clone(); result.add(compactedStack); break; @@ -113,19 +109,37 @@ public List getOutputRepresentation(Inventory i) { } for (ItemStack is : i.getContents()) { if (is != null) { - ItemMeta im = is.getItemMeta(); - if (im.hasLore() && im.getLore().get(0).equals(compactedLore)) { - ItemStack decompactedStack = is.clone(); - decompactedStack.setAmount(decompactedStack - .getMaxStackSize()); - List loreList = new LinkedList(); - im.setLore(loreList); - decompactedStack.setItemMeta(im); - result.add(decompactedStack); - break; + if (isDecompactable(is)) { + ItemStack copy = is.clone(); + removeCompactLore(copy); + ItemMap output = new ItemMap(); + output.addItemAmount(copy, CompactingRecipe.getCompactStackSize(copy.getType())); + result.addAll(output.getItemStackRepresentation()); } } } return result; } + + private boolean isDecompactable(ItemStack is) { + List lore = is.getItemMeta().getLore(); + if (lore != null) { + for(String content : lore) { + if (content.equals(compactedLore)) { + return true; + } + } + } + return false; + } + + private void removeCompactLore(ItemStack is) { + List lore = is.getItemMeta().getLore(); + if (lore != null) { + lore.remove(compactedLore); + } + ItemMeta im = is.getItemMeta(); + im.setLore(lore); + is.setItemMeta(im); + } } From d1db8c69f6e32e162a87f9dcd939d237603321bf Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Tue, 19 Apr 2016 21:31:17 +0100 Subject: [PATCH 378/459] Correction to GM Transmuter upgrade recipe (#236) Updated in accordance with: https://docs.google.com/spreadsheets/d/1K2CghpEf00R3bvtI6Ur8WWZ5gt2C4ByHgv3euEQvbFk/edit#gid=1583219349 --- configCivcraft.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index dbffd860..31582428 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6625,9 +6625,10 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 3000 + amount: 78 lore: - Aether + - Compacted Item enchants: dura: enchant: DURABILITY From 013dc4ba566d6b3c489966b41fa56a662d656b85 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Tue, 19 Apr 2016 21:31:35 +0100 Subject: [PATCH 379/459] Made Dowsing Factory upgradable (#249) * Made Dowsing Factory upgradable Previously, a MAP had the durability of 0 which is impossible to get. * Removing maps --- configCivcraft.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 31582428..e9e076ad 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -5352,9 +5352,6 @@ recipes: compass: material: COMPASS amount: 1 - map: - material: MAP - amount: 1 xp: material: EMERALD_BLOCK amount: 128 From 6c7e06716f84c99d012dfc2f975ddc3977480b43 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 22 Apr 2016 22:30:14 +0100 Subject: [PATCH 380/459] Added temp repair recipes to New Factories --- configCivcraft.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index e9e076ad..315baa5a 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -680,6 +680,7 @@ factories: - Upgrade_to_Dagger_Forge - Upgrade_to_Quick_Forge - Upgrade_to_Rock_Forge + - Repair_Factory #Fire emberforge: type: FCCUPGRADE @@ -699,6 +700,7 @@ factories: - Enchant_Boots_FireP_III - Enchant_FireAspect_I - Upgrade_to_Magma_Forge + - Repair_Factory magmaforge: type: FCCUPGRADE name: Magma Forge @@ -730,6 +732,7 @@ factories: - Enchant_Flame_I - Enchant_FireAspect_I - Enchant_FireAspect_II + - Repair_Factory #Water riverforge: type: FCCUPGRADE @@ -739,6 +742,7 @@ factories: - Enchant_Respiration_I - Enchant_Respiration_II - Upgrade_to_Ocean_Forge + - Repair_Factory # - Enchant_FrostWalker_I oceanforge: type: FCCUPGRADE @@ -751,6 +755,7 @@ factories: - Enchant_Respiration_I - Enchant_Respiration_II - Enchant_Respiration_III + - Repair_Factory # - Enchant_FrostWalker_II #Magic magicforge: @@ -763,6 +768,7 @@ factories: - Enchant_BOA_II - Enchant_BOA_III - Upgrade_to_Arcane_Forge + - Repair_Factory arcaneforge: type: FCCUPGRADE name: Arcane Forge @@ -780,6 +786,7 @@ factories: - Enchant_BOA_III - Enchant_BOA_IV - Enchant_BOA_V + - Repair_Factory #Armor mithrilforge: type: FCCUPGRADE @@ -795,6 +802,7 @@ factories: - Enchant_Boots_BlastProtection_I - Enchant_Thorns_I - Upgrade_to_Titanium_Forge + - Repair_Factory titaniumforge: type: FCCUPGRADE name: Titanium Forge @@ -826,6 +834,7 @@ factories: - Enchant_Thorns_I - Enchant_Thorns_II - Upgrade_to_Meteor_Forge + - Repair_Factory Meteorforge: type: FCCUPGRADE name: Meteor Forge @@ -865,6 +874,7 @@ factories: - Enchant_Thorns_I - Enchant_Thorns_II - Enchant_Thorns_III + - Repair_Factory #Archery archerforge: type: FCCUPGRADE @@ -877,6 +887,7 @@ factories: - Enchant_Leggings_ProjectileProtection_I - Enchant_Boots_ProjectileProtection_I - Upgrade_to_Marksman_Forge + - Repair_Factory marksmanforge: type: FCCUPGRADE name: Marksman Forge @@ -899,6 +910,7 @@ factories: - Enchant_Boots_ProjectileProtection_III - Enchant_Punch_I - Upgrade_to_Sniper_Forge + - Repair_Factory sniperforge: type: FCCUPGRADE name: Sniper Forge @@ -926,6 +938,7 @@ factories: - Enchant_Boots_ProjectileProtection_IV - Enchant_Punch_I - Enchant_Punch_II + - Repair_Factory #Swords daggerforge: type: FCCUPGRADE @@ -936,6 +949,7 @@ factories: - Enchant_Smite_I - Enchant_Smite_II - Upgrade_to_Sword_Forge + - Repair_Factory swordforge: type: FCCUPGRADE name: Sword Forge @@ -950,6 +964,7 @@ factories: - Enchant_Smite_IV - Enchant_Knockback_I - Upgrade_to_Blade_Forge + - Repair_Factory bladeforge: type: FCCUPGRADE name: Blade Forge @@ -966,6 +981,7 @@ factories: - Enchant_Smite_V - Enchant_Knockback_I - Enchant_Knockback_II + - Repair_Factory #Efficiency quickforge: type: FCCUPGRADE @@ -978,6 +994,7 @@ factories: - Enchant_Shovel_Efficiency_I - Enchant_Shovel_Efficiency_II - Upgrade_to_Rapid_Forge + - Repair_Factory rapidforge: type: FCCUPGRADE name: Rapid Forge @@ -995,6 +1012,7 @@ factories: - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Upgrade_to_Sonic_Forge + - Repair_Factory sonicforge: type: FCCUPGRADE name: Sonic Forge @@ -1014,6 +1032,7 @@ factories: - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Enchant_Shovel_Efficiency_V + - Repair_Factory #Unbreaking rockforge: type: FCCUPGRADE @@ -1029,6 +1048,7 @@ factories: - Enchant_Sword_Unbreaking_I - Enchant_Bow_Unbreaking_I - Upgrade_to_Metal_Forge + - Repair_Factory metalforge: type: FCCUPGRADE name: Metal Forge @@ -1052,6 +1072,7 @@ factories: - Enchant_Bow_Unbreaking_I - Enchant_Bow_Unbreaking_II - Upgrade_to_Carbon_Forge + - Repair_Factory carbonforge: type: FCCUPGRADE name: Carbon Forge @@ -1083,6 +1104,7 @@ factories: - Enchant_Bow_Unbreaking_I - Enchant_Bow_Unbreaking_II - Enchant_Bow_Unbreaking_III + - Repair_Factory ## XP Production apprenticetransmuter: @@ -1093,6 +1115,7 @@ factories: - Cypress_Enrichment - Pine_Enrichment - Upgrade_to_Adept_Transmuter + - Repair_Factory adepttransmuter: type: FCCUPGRADE name: Adept Transmuter @@ -1104,6 +1127,7 @@ factories: - Copper_Enrichment - Tin_Enrichment - Upgrade_to_Grandmaster_Transmuter + - Repair_Factory grandmastertransmuter: type: FCCUPGRADE name: Grandmaster Transmuter @@ -1117,6 +1141,7 @@ factories: - Amethyst_Enrichment - Topaz_Enrichment - Ruby_Enrichment + - Repair_Factory #Pipes From 5381a7ab7d1b39a805868d80965e38f04f403199 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 27 Apr 2016 17:48:12 +0200 Subject: [PATCH 381/459] Half enchanting costs --- configCivcraft.yml | 345 ++++++++++++++++++++++----------------------- 1 file changed, 168 insertions(+), 177 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 315baa5a..4a007d16 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -7266,7 +7266,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_FIRE level: 1 enchant_item: @@ -7279,7 +7279,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_FIRE level: 1 enchant_item: @@ -7292,7 +7292,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_FIRE level: 1 enchant_item: @@ -7305,7 +7305,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_FIRE level: 1 enchant_item: @@ -7318,7 +7318,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: PROTECTION_FIRE level: 2 enchant_item: @@ -7335,7 +7335,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: PROTECTION_FIRE level: 2 enchant_item: @@ -7352,7 +7352,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: PROTECTION_FIRE level: 2 enchant_item: @@ -7369,7 +7369,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: PROTECTION_FIRE level: 2 enchant_item: @@ -7386,7 +7386,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: PROTECTION_FIRE level: 3 enchant_item: @@ -7403,7 +7403,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: PROTECTION_FIRE level: 3 enchant_item: @@ -7420,7 +7420,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: PROTECTION_FIRE level: 3 enchant_item: @@ -7437,7 +7437,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: PROTECTION_FIRE level: 3 enchant_item: @@ -7454,7 +7454,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_FIRE level: 4 enchant_item: @@ -7471,7 +7471,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_FIRE level: 4 enchant_item: @@ -7488,7 +7488,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_FIRE level: 4 enchant_item: @@ -7505,7 +7505,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_FIRE level: 4 enchant_item: @@ -7522,7 +7522,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: PROTECTION_FIRE level: 5 enchant_item: @@ -7539,7 +7539,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: PROTECTION_FIRE level: 5 enchant_item: @@ -7556,7 +7556,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: PROTECTION_FIRE level: 5 enchant_item: @@ -7573,7 +7573,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: PROTECTION_FIRE level: 5 enchant_item: @@ -7590,7 +7590,7 @@ recipes: input: emeralds: material: EMERALD - amount: 900 + amount: 450 enchant: PROTECTION_FIRE level: 6 enchant_item: @@ -7607,7 +7607,7 @@ recipes: input: emeralds: material: EMERALD - amount: 900 + amount: 450 enchant: PROTECTION_FIRE level: 6 enchant_item: @@ -7624,7 +7624,7 @@ recipes: input: emeralds: material: EMERALD - amount: 900 + amount: 450 enchant: PROTECTION_FIRE level: 6 enchant_item: @@ -7641,7 +7641,7 @@ recipes: input: emeralds: material: EMERALD - amount: 900 + amount: 450 enchant: PROTECTION_FIRE level: 6 enchant_item: @@ -7660,7 +7660,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1500 + amount: 750 enchant: ARROW_FIRE level: 1 enchant_item: @@ -7675,7 +7675,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: FIRE_ASPECT level: 1 enchant_item: @@ -7688,7 +7688,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1250 + amount: 625 enchant: FIRE_ASPECT level: 2 enchant_item: @@ -7707,7 +7707,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DEPTH_STRIDER level: 1 enchant_item: @@ -7720,7 +7720,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: DEPTH_STRIDER level: 2 enchant_item: @@ -7737,7 +7737,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: DEPTH_STRIDER level: 3 enchant_item: @@ -7756,7 +7756,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: OXYGEN level: 1 enchant_item: @@ -7769,7 +7769,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: OXYGEN level: 2 enchant_item: @@ -7786,7 +7786,7 @@ recipes: input: emeralds: material: EMERALD - amount: 600 + amount: 300 enchant: OXYGEN level: 3 enchant_item: @@ -7808,7 +7808,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: WATER_WORKER level: 1 enchant_item: @@ -7823,7 +7823,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_FALL level: 1 enchant_item: @@ -7836,7 +7836,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_FALL level: 2 enchant_item: @@ -7853,7 +7853,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: PROTECTION_FALL level: 3 enchant_item: @@ -7870,7 +7870,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: PROTECTION_FALL level: 4 enchant_item: @@ -7889,7 +7889,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DAMAGE_ARTHROPODS level: 1 enchant_item: @@ -7902,7 +7902,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: DAMAGE_ARTHROPODS level: 2 enchant_item: @@ -7919,7 +7919,7 @@ recipes: input: emeralds: material: EMERALD - amount: 120 + amount: 60 enchant: DAMAGE_ARTHROPODS level: 3 enchant_item: @@ -7936,7 +7936,7 @@ recipes: input: emeralds: material: EMERALD - amount: 240 + amount: 120 enchant: DAMAGE_ARTHROPODS level: 4 enchant_item: @@ -7953,7 +7953,7 @@ recipes: input: emeralds: material: EMERALD - amount: 600 + amount: 300 enchant: DAMAGE_ARTHROPODS level: 5 enchant_item: @@ -7972,7 +7972,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1500 + amount: 750 enchant: ARROW_INFINITE level: 1 enchant_item: @@ -7987,7 +7987,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: SILK_TOUCH level: 1 enchant_item: @@ -8000,7 +8000,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: SILK_TOUCH level: 1 enchant_item: @@ -8013,7 +8013,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: SILK_TOUCH level: 1 enchant_item: @@ -8028,7 +8028,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: PROTECTION_ENVIRONMENTAL level: 1 enchant_item: @@ -8041,7 +8041,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: PROTECTION_ENVIRONMENTAL level: 1 enchant_item: @@ -8054,7 +8054,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: PROTECTION_ENVIRONMENTAL level: 1 enchant_item: @@ -8067,7 +8067,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: PROTECTION_ENVIRONMENTAL level: 1 enchant_item: @@ -8080,7 +8080,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_ENVIRONMENTAL level: 2 enchant_item: @@ -8097,7 +8097,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_ENVIRONMENTAL level: 2 enchant_item: @@ -8114,7 +8114,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_ENVIRONMENTAL level: 2 enchant_item: @@ -8131,7 +8131,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_ENVIRONMENTAL level: 2 enchant_item: @@ -8148,7 +8148,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_ENVIRONMENTAL level: 3 enchant_item: @@ -8165,7 +8165,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_ENVIRONMENTAL level: 3 enchant_item: @@ -8182,7 +8182,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_ENVIRONMENTAL level: 3 enchant_item: @@ -8199,7 +8199,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_ENVIRONMENTAL level: 3 enchant_item: @@ -8216,7 +8216,7 @@ recipes: input: emeralds: material: EMERALD - amount: 750 + amount: 375 enchant: PROTECTION_ENVIRONMENTAL level: 4 enchant_item: @@ -8233,7 +8233,7 @@ recipes: input: emeralds: material: EMERALD - amount: 750 + amount: 375 enchant: PROTECTION_ENVIRONMENTAL level: 4 enchant_item: @@ -8250,7 +8250,7 @@ recipes: input: emeralds: material: EMERALD - amount: 750 + amount: 375 enchant: PROTECTION_ENVIRONMENTAL level: 4 enchant_item: @@ -8267,7 +8267,7 @@ recipes: input: emeralds: material: EMERALD - amount: 750 + amount: 375 enchant: PROTECTION_ENVIRONMENTAL level: 4 enchant_item: @@ -8286,7 +8286,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_EXPLOSIONS level: 1 enchant_item: @@ -8299,7 +8299,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_EXPLOSIONS level: 1 enchant_item: @@ -8312,7 +8312,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_EXPLOSIONS level: 1 enchant_item: @@ -8325,7 +8325,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_EXPLOSIONS level: 1 enchant_item: @@ -8338,7 +8338,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_EXPLOSIONS level: 2 enchant_item: @@ -8355,7 +8355,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_EXPLOSIONS level: 2 enchant_item: @@ -8372,7 +8372,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_EXPLOSIONS level: 2 enchant_item: @@ -8389,7 +8389,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_EXPLOSIONS level: 2 enchant_item: @@ -8406,7 +8406,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: PROTECTION_EXPLOSIONS level: 3 enchant_item: @@ -8423,7 +8423,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: PROTECTION_EXPLOSIONS level: 3 enchant_item: @@ -8440,7 +8440,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: PROTECTION_EXPLOSIONS level: 3 enchant_item: @@ -8457,7 +8457,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: PROTECTION_EXPLOSIONS level: 3 enchant_item: @@ -8474,7 +8474,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: PROTECTION_EXPLOSIONS level: 4 enchant_item: @@ -8491,7 +8491,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: PROTECTION_EXPLOSIONS level: 4 enchant_item: @@ -8508,7 +8508,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: PROTECTION_EXPLOSIONS level: 4 enchant_item: @@ -8525,7 +8525,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: PROTECTION_EXPLOSIONS level: 4 enchant_item: @@ -8544,7 +8544,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: THORNS level: 1 enchant_item: @@ -8557,7 +8557,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: THORNS level: 2 enchant_item: @@ -8574,7 +8574,7 @@ recipes: input: emeralds: material: EMERALD - amount: 450 + amount: 225 enchant: THORNS level: 3 enchant_item: @@ -8593,7 +8593,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: ARROW_DAMAGE level: 1 enchant_item: @@ -8606,7 +8606,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: ARROW_DAMAGE level: 2 enchant_item: @@ -8623,7 +8623,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: ARROW_DAMAGE level: 3 enchant_item: @@ -8640,7 +8640,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: ARROW_DAMAGE level: 4 enchant_item: @@ -8657,7 +8657,7 @@ recipes: input: emeralds: material: EMERALD - amount: 2000 + amount: 1000 enchant: ARROW_DAMAGE level: 5 enchant_item: @@ -8676,7 +8676,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_PROJECTILE level: 1 enchant_item: @@ -8689,7 +8689,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_PROJECTILE level: 1 enchant_item: @@ -8702,7 +8702,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_PROJECTILE level: 1 enchant_item: @@ -8715,7 +8715,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: PROTECTION_PROJECTILE level: 1 enchant_item: @@ -8728,7 +8728,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_PROJECTILE level: 2 enchant_item: @@ -8745,7 +8745,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_PROJECTILE level: 2 enchant_item: @@ -8762,7 +8762,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_PROJECTILE level: 2 enchant_item: @@ -8779,7 +8779,7 @@ recipes: input: emeralds: material: EMERALD - amount: 30 + amount: 15 enchant: PROTECTION_PROJECTILE level: 2 enchant_item: @@ -8796,7 +8796,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_PROJECTILE level: 3 enchant_item: @@ -8813,7 +8813,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_PROJECTILE level: 3 enchant_item: @@ -8830,7 +8830,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_PROJECTILE level: 3 enchant_item: @@ -8847,7 +8847,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: PROTECTION_PROJECTILE level: 3 enchant_item: @@ -8864,7 +8864,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_PROJECTILE level: 4 enchant_item: @@ -8881,7 +8881,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_PROJECTILE level: 4 enchant_item: @@ -8898,7 +8898,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_PROJECTILE level: 4 enchant_item: @@ -8915,7 +8915,7 @@ recipes: input: emeralds: material: EMERALD - amount: 250 + amount: 125 enchant: PROTECTION_PROJECTILE level: 4 enchant_item: @@ -8934,7 +8934,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: ARROW_KNOCKBACK level: 1 enchant_item: @@ -8947,7 +8947,7 @@ recipes: input: emeralds: material: EMERALD - amount: 800 + amount: 400 enchant: ARROW_KNOCKBACK level: 2 enchant_item: @@ -8966,7 +8966,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: DAMAGE_ALL level: 1 enchant_item: @@ -8979,7 +8979,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DAMAGE_ALL level: 2 enchant_item: @@ -8996,7 +8996,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: DAMAGE_ALL level: 3 enchant_item: @@ -9013,7 +9013,7 @@ recipes: input: emeralds: material: EMERALD - amount: 1000 + amount: 500 enchant: DAMAGE_ALL level: 4 enchant_item: @@ -9030,7 +9030,7 @@ recipes: input: emeralds: material: EMERALD - amount: 2000 + amount: 1000 enchant: DAMAGE_ALL level: 5 enchant_item: @@ -9049,7 +9049,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DAMAGE_UNDEAD level: 1 enchant_item: @@ -9062,7 +9062,7 @@ recipes: input: emeralds: material: EMERALD - amount: 40 + amount: 20 enchant: DAMAGE_UNDEAD level: 2 enchant_item: @@ -9079,7 +9079,7 @@ recipes: input: emeralds: material: EMERALD - amount: 120 + amount: 60 enchant: DAMAGE_UNDEAD level: 3 enchant_item: @@ -9096,7 +9096,7 @@ recipes: input: emeralds: material: EMERALD - amount: 240 + amount: 120 enchant: DAMAGE_UNDEAD level: 4 enchant_item: @@ -9113,7 +9113,7 @@ recipes: input: emeralds: material: EMERALD - amount: 600 + amount: 300 enchant: DAMAGE_UNDEAD level: 5 enchant_item: @@ -9132,7 +9132,7 @@ recipes: input: emeralds: material: EMERALD - amount: 300 + amount: 150 enchant: KNOCKBACK level: 1 enchant_item: @@ -9145,7 +9145,7 @@ recipes: input: emeralds: material: EMERALD - amount: 800 + amount: 400 enchant: KNOCKBACK level: 2 enchant_item: @@ -9165,7 +9165,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: DIG_SPEED level: 1 enchant_item: @@ -9178,7 +9178,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 2 enchant_item: @@ -9195,7 +9195,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: DIG_SPEED level: 3 enchant_item: @@ -9212,7 +9212,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DIG_SPEED level: 4 enchant_item: @@ -9229,7 +9229,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DIG_SPEED level: 5 enchant_item: @@ -9246,7 +9246,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: DIG_SPEED level: 1 enchant_item: @@ -9259,7 +9259,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 2 enchant_item: @@ -9276,7 +9276,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: DIG_SPEED level: 3 enchant_item: @@ -9293,7 +9293,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DIG_SPEED level: 4 enchant_item: @@ -9310,7 +9310,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DIG_SPEED level: 5 enchant_item: @@ -9327,7 +9327,7 @@ recipes: input: emeralds: material: EMERALD - amount: 10 + amount: 5 enchant: DIG_SPEED level: 1 enchant_item: @@ -9340,7 +9340,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 2 enchant_item: @@ -9357,7 +9357,7 @@ recipes: input: emeralds: material: EMERALD - amount: 60 + amount: 30 enchant: DIG_SPEED level: 3 enchant_item: @@ -9374,7 +9374,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DIG_SPEED level: 4 enchant_item: @@ -9391,7 +9391,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DIG_SPEED level: 5 enchant_item: @@ -9410,7 +9410,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: DURABILITY level: 1 enchant_item: @@ -9423,7 +9423,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DURABILITY level: 2 enchant_item: @@ -9440,7 +9440,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DURABILITY level: 3 enchant_item: @@ -9457,7 +9457,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: DURABILITY level: 1 enchant_item: @@ -9470,7 +9470,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DURABILITY level: 2 enchant_item: @@ -9487,7 +9487,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DURABILITY level: 3 enchant_item: @@ -9504,7 +9504,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: DURABILITY level: 1 enchant_item: @@ -9517,7 +9517,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DURABILITY level: 2 enchant_item: @@ -9534,7 +9534,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DURABILITY level: 3 enchant_item: @@ -9553,7 +9553,7 @@ recipes: input: emeralds: material: EMERALD - amount: 75 + amount: 38 enchant: DURABILITY level: 1 enchant_item: @@ -9566,7 +9566,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: DURABILITY level: 2 enchant_item: @@ -9583,7 +9583,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: DURABILITY level: 3 enchant_item: @@ -9602,7 +9602,7 @@ recipes: input: emeralds: material: EMERALD - amount: 50 + amount: 25 enchant: DURABILITY level: 1 enchant_item: @@ -9615,7 +9615,7 @@ recipes: input: emeralds: material: EMERALD - amount: 150 + amount: 75 enchant: DURABILITY level: 2 enchant_item: @@ -9632,7 +9632,7 @@ recipes: input: emeralds: material: EMERALD - amount: 400 + amount: 200 enchant: DURABILITY level: 3 enchant_item: @@ -9651,7 +9651,7 @@ recipes: input: emeralds: material: EMERALD - amount: 75 + amount: 38 enchant: DURABILITY level: 1 enchant_item: @@ -9664,7 +9664,7 @@ recipes: input: emeralds: material: EMERALD - amount: 75 + amount: 38 enchant: DURABILITY level: 1 enchant_item: @@ -9677,7 +9677,7 @@ recipes: input: emeralds: material: EMERALD - amount: 75 + amount: 38 enchant: DURABILITY level: 1 enchant_item: @@ -9690,7 +9690,7 @@ recipes: input: emeralds: material: EMERALD - amount: 75 + amount: 38 enchant: DURABILITY level: 1 enchant_item: @@ -9703,7 +9703,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: DURABILITY level: 2 enchant_item: @@ -9720,7 +9720,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: DURABILITY level: 2 enchant_item: @@ -9737,7 +9737,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: DURABILITY level: 2 enchant_item: @@ -9754,7 +9754,7 @@ recipes: input: emeralds: material: EMERALD - amount: 200 + amount: 100 enchant: DURABILITY level: 2 enchant_item: @@ -9771,7 +9771,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: DURABILITY level: 3 enchant_item: @@ -9788,7 +9788,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: DURABILITY level: 3 enchant_item: @@ -9805,7 +9805,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: DURABILITY level: 3 enchant_item: @@ -9822,7 +9822,7 @@ recipes: input: emeralds: material: EMERALD - amount: 500 + amount: 250 enchant: DURABILITY level: 3 enchant_item: @@ -9841,7 +9841,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 1 enchant_item: @@ -9854,7 +9854,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 1 enchant_item: @@ -9867,7 +9867,7 @@ recipes: input: emeralds: material: EMERALD - amount: 20 + amount: 10 enchant: DIG_SPEED level: 1 enchant_item: @@ -9880,7 +9880,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DURABILITY level: 1 enchant_item: @@ -9893,7 +9893,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DURABILITY level: 1 enchant_item: @@ -9906,7 +9906,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DURABILITY level: 1 enchant_item: @@ -9919,7 +9919,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DURABILITY level: 1 enchant_item: @@ -9932,7 +9932,7 @@ recipes: input: emeralds: material: EMERALD - amount: 100 + amount: 50 enchant: DAMAGE_ALL level: 1 enchant_item: @@ -9949,13 +9949,4 @@ recipes: dirt: material: DIRT -renames: - redstone1: - oldName: Redstone Mechanics Factory - newName: Redstone Mechanics - redstone2: - oldName: Redstone Circularity Factory - newName: Redstone Electronics - redstone0: - oldName: Redstone Factory Basic - newName: Redstone Techniques +renames: \ No newline at end of file From bbf0dd61d9e9423ca21d93b8d643dd9379c61b4a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 27 Apr 2016 17:50:44 +0200 Subject: [PATCH 382/459] Half Aether requirements for XP recipes --- configCivcraft.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 4a007d16..97ca67e9 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6678,7 +6678,7 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 30 + amount: 15 lore: - Aether enchants: @@ -6706,7 +6706,7 @@ recipes: amount: 64 aether: material: GOLD_NUGGET - amount: 30 + amount: 15 lore: - Aether enchants: @@ -6734,7 +6734,7 @@ recipes: amount: 64 aether: material: GOLD_NUGGET - amount: 30 + amount: 15 lore: - Aether enchants: @@ -6769,7 +6769,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 168 + amount: 84 lore: - Aether enchants: @@ -6804,7 +6804,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 168 + amount: 84 lore: - Aether enchants: @@ -6838,7 +6838,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 168 + amount: 84 lore: - Aether enchants: @@ -6893,7 +6893,7 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 960 + amount: 480 lore: - Aether enchants: @@ -6951,7 +6951,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 960 + amount: 480 lore: - Aether enchants: @@ -7008,7 +7008,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 960 + amount: 480 lore: - Aether enchants: From 57dade0bb4d2484db8a8a2f24871ec7d358a96e8 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 27 Apr 2016 18:48:19 +0200 Subject: [PATCH 383/459] Move pylon finder in redstone factory --- configCivcraft.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 97ca67e9..0813a6d9 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -607,6 +607,7 @@ factories: - Craft_Redstone_Comparator - Craft_Daylight_Sensor - Craft_End_Concentrate + - Create_Pylon_Locator - Repair_Advanced_Factory redstonemechanicsfactory: type: FCCUPGRADE @@ -657,7 +658,7 @@ factories: type: FCCUPGRADE name: Dowsing Factory recipes: - - Create_Pylon_Locator + - Return_Materials - Repair_Advanced_Factory ## Enchanting basicforge: @@ -6578,6 +6579,9 @@ recipes: amount: 1 xp: material: EMERALD_BLOCK + amount: 256 + redstone: + material: REDSTONE_BLOCK amount: 64 output: basiccompass: From 5d11114a50fbd30b7efbdf4a2f0364528fa8d997 Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Fri, 29 Apr 2016 22:28:03 +0100 Subject: [PATCH 384/459] Prot II production time fixed --- configCivcraft.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 0813a6d9..42743a62 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -8080,7 +8080,7 @@ recipes: Enchant_Helmet_Protection_II: type: ENCHANT name: Enchant Helmet with Protection II - production_time: 100s + production_time: 15s input: emeralds: material: EMERALD @@ -8097,7 +8097,7 @@ recipes: Enchant_Chestplate_Protection_II: type: ENCHANT name: Enchant Chestplate with Protection II - production_time: 100s + production_time: 15s input: emeralds: material: EMERALD @@ -8114,7 +8114,7 @@ recipes: Enchant_Leggings_Protection_II: type: ENCHANT name: Enchant Leggings with Protection II - production_time: 100s + production_time: 15s input: emeralds: material: EMERALD @@ -8131,7 +8131,7 @@ recipes: Enchant_Boots_Protection_II: type: ENCHANT name: Enchant Boots with Protection II - production_time: 100s + production_time: 15s input: emeralds: material: EMERALD @@ -9953,4 +9953,4 @@ recipes: dirt: material: DIRT -renames: \ No newline at end of file +renames: From b324637cbf091264fff8d37039f9db1928b5c7be Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Tue, 3 May 2016 21:10:39 +0100 Subject: [PATCH 385/459] Doubled the materials required for XP Production (#261) --- configCivcraft.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 42743a62..22f83419 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6682,7 +6682,7 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 15 + amount: 8 lore: - Aether enchants: @@ -6691,7 +6691,7 @@ recipes: output: xp: material: EMERALD - amount: 40 + amount: 20 Cypress_Enrichment: name: Cypress Enrichment type: PRODUCTION @@ -6710,7 +6710,7 @@ recipes: amount: 64 aether: material: GOLD_NUGGET - amount: 15 + amount: 8 lore: - Aether enchants: @@ -6719,7 +6719,7 @@ recipes: output: xp: material: EMERALD - amount: 40 + amount: 20 Pine_Enrichment: name: Pine Enrichment type: PRODUCTION @@ -6738,7 +6738,7 @@ recipes: amount: 64 aether: material: GOLD_NUGGET - amount: 15 + amount: 8 lore: - Aether enchants: @@ -6747,7 +6747,7 @@ recipes: output: xp: material: EMERALD - amount: 40 + amount: 20 Lead_Enrichment: name: Lead Enrichment @@ -6773,7 +6773,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 84 + amount: 42 lore: - Aether enchants: @@ -6782,7 +6782,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 38 + amount: 19 Copper_Enrichment: name: Copper Enrichment type: PRODUCTION @@ -6808,7 +6808,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 84 + amount: 42 lore: - Aether enchants: @@ -6817,7 +6817,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 38 + amount: 19 Tin_Enrichment: name: Tin Enrichment type: PRODUCTION @@ -6842,7 +6842,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 84 + amount: 42 lore: - Aether enchants: @@ -6851,7 +6851,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 38 + amount: 19 Amethyst_Enrichment: name: Amethyst Enrichment @@ -6897,7 +6897,7 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 480 + amount: 240 lore: - Aether enchants: @@ -6906,7 +6906,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 280 + amount: 140 Topaz_Enrichment: name: Topaz Enrichment type: PRODUCTION @@ -6955,7 +6955,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 480 + amount: 240 lore: - Aether enchants: @@ -6964,7 +6964,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 280 + amount: 140 Ruby_Enrichment: name: Ruby Enrichment type: PRODUCTION @@ -7012,7 +7012,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 480 + amount: 240 lore: - Aether enchants: @@ -7021,7 +7021,7 @@ recipes: output: xp: material: EMERALD_BLOCK - amount: 280 + amount: 140 ##Enchanting Recipes #Upgrades From 5acbd3ee1504f0adf401eaa8a503712d83056a34 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Wed, 4 May 2016 02:18:15 +0100 Subject: [PATCH 386/459] Final XP Changes (#263) * Final XP Changes After feedback from people farming for the grandmaster recipe with enchanted tools, the wood was taking up roughly 90% of the time to farm. Any person (even without having huge automatic farms which would even further cry out for this change) making xp has been saying that the wood is not only highly disproportionate, but a majority of the time-sink in relation to the other materials combined. These changes is essentially also making XP cheaper again, which handles with the repair costs to tools/armour being introduced soon (tm). The repair costs will be 2.5% roughly of the enchantment cost on each item, and after running maths on multiple people using enchanted tools it becomes a very big problem for any place to be able to sustain their tools. From the current CivTemp values (before the changes in the last pull request which doubled the material costs) these are the changes: - Quarter aether cost of each recipe. - Half emerald output of each recipe. - Reduced production time accordingly as more runs are required. - Adding repair recipes at half of the current proposed cost (for tools/armour). *these changes are part of a different config* - Cutting wood costs: - Apprentice - Half (64 Logs - 32 Logs) - Adept - Quarter (5stacks - 2.5stacks) - Grandmaster - Eigth (25stacks - 3stacks) * Changed Log Cost So this is changing each log part of the recipes to a *quarter* of what they were originally. Not the values said in the main description. --- configCivcraft.yml | 62 ++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 22f83419..7e58cbb9 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6675,14 +6675,14 @@ recipes: amount: 64 logs: material: LOG - amount: 64 + amount: 16 durability: -1 netherwart: material: NETHER_STALK amount: 32 aether: material: GOLD_NUGGET - amount: 8 + amount: 4 lore: - Aether enchants: @@ -6703,14 +6703,14 @@ recipes: amount: 64 logs: material: LOG - amount: 64 + amount: 16 durability: -1 cactus: material: CACTUS amount: 64 aether: material: GOLD_NUGGET - amount: 8 + amount: 4 lore: - Aether enchants: @@ -6731,14 +6731,14 @@ recipes: amount: 64 logs: material: LOG - amount: 64 + amount: 16 durability: -1 sugarcane: material: SUGAR_CANE amount: 64 aether: material: GOLD_NUGGET - amount: 8 + amount: 4 lore: - Aether enchants: @@ -6752,15 +6752,15 @@ recipes: Lead_Enrichment: name: Lead Enrichment type: PRODUCTION - production_time: 2h - fuel_consumption_intervall: 6m + production_time: 30m + fuel_consumption_intervall: 5m input: wheat: material: WHEAT amount: 320 acacialogs: material: LOG_2 - amount: 320 + amount: 80 durability: 0 netherwart: material: NETHER_STALK @@ -6773,7 +6773,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 42 + amount: 21 lore: - Aether enchants: @@ -6786,15 +6786,15 @@ recipes: Copper_Enrichment: name: Copper Enrichment type: PRODUCTION - production_time: 2h - fuel_consumption_intervall: 6m + production_time: 30m + fuel_consumption_intervall: 5m input: carrots: material: CARROT_ITEM amount: 320 sprucelogs: material: LOG - amount: 320 + amount: 80 durability: 1 cactus: material: CACTUS @@ -6808,7 +6808,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 42 + amount: 21 lore: - Aether enchants: @@ -6821,15 +6821,15 @@ recipes: Tin_Enrichment: name: Tin Enrichment type: PRODUCTION - production_time: 2h - fuel_consumption_intervall: 6m + production_time: 30m + fuel_consumption_intervall: 5m input: potatoes: material: POTATO_ITEM amount: 320 birchlogs: material: LOG - amount: 320 + amount: 80 durability: 2 sugarcane: material: SUGAR_CANE @@ -6842,7 +6842,7 @@ recipes: # amount: 32 aether: material: GOLD_NUGGET - amount: 42 + amount: 21 lore: - Aether enchants: @@ -6856,7 +6856,7 @@ recipes: Amethyst_Enrichment: name: Amethyst Enrichment type: PRODUCTION - production_time: 3h + production_time: 1h fuel_consumption_intervall: 6m input: wheat: @@ -6866,13 +6866,13 @@ recipes: - Compacted Item acacialogs: material: LOG_2 - amount: 25 + amount: 6 durability: 0 lore: - Compacted Item junglesaplings: material: SAPLING - amount: 3 + amount: 2 durability: 3 lore: - Compacted Item @@ -6897,7 +6897,7 @@ recipes: amount: 32 aether: material: GOLD_NUGGET - amount: 240 + amount: 120 lore: - Aether enchants: @@ -6910,7 +6910,7 @@ recipes: Topaz_Enrichment: name: Topaz Enrichment type: PRODUCTION - production_time: 3h + production_time: 1h fuel_consumption_intervall: 6m input: carrots: @@ -6920,16 +6920,14 @@ recipes: - Compacted Item sprucelogs: material: LOG - amount: 25 + amount: 6 durability: 1 lore: - Compacted Item darkoaksaplings: material: SAPLING - amount: 1 + amount: 32 durability: 5 - lore: - - Compacted Item cactus: material: CACTUS amount: 25 @@ -6955,7 +6953,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 240 + amount: 120 lore: - Aether enchants: @@ -6968,7 +6966,7 @@ recipes: Ruby_Enrichment: name: Ruby Enrichment type: PRODUCTION - production_time: 3h + production_time: 1h fuel_consumption_intervall: 6m input: potatoes: @@ -6978,13 +6976,13 @@ recipes: - Compacted Item birchlogs: material: LOG - amount: 25 + amount: 6 durability: 2 lore: - Compacted Item oaksaplings: material: SAPLING - amount: 4 + amount: 2 durability: 0 lore: - Compacted Item @@ -7012,7 +7010,7 @@ recipes: - Compacted Item aether: material: GOLD_NUGGET - amount: 240 + amount: 120 lore: - Aether enchants: From a0fee2868336b07bbeea00cbce0a8ac7e8e91f80 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 5 May 2016 23:02:13 +0200 Subject: [PATCH 387/459] Update plugin references in pom to latest --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index bfa84c7f..68792022 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.1.6 + 2.2.0 FactoryMod https://github.com/Civcraft/FactoryMod @@ -33,31 +33,31 @@ org.spigotmc spigot-api - 1.8.8-R0.1-SNAPSHOT + 1.9.2-R0.1-SNAPSHOT provided vg.civcraft.mc.namelayer NameLayer - 2.6 + 2.7 provided vg.civcraft.mc.citadel Citadel - 3.4.34 + 3.5.0 provided vg.civcraft.mc.civmodcore CivModCore - 1.2.02 + 1.3.2 provided vg.civcraft.mc CivMenu - 1.2.2 + 1.3 provided From ac649ae4f69296cd275a9396a530978f24138a4f Mon Sep 17 00:00:00 2001 From: Diet Cola Date: Fri, 6 May 2016 15:53:12 +0100 Subject: [PATCH 388/459] Adding frost walker enchant ready for 1.9 (#264) For merge on 1.9 upgrade. --- configCivcraft.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 7e58cbb9..b9fbf61e 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -742,9 +742,9 @@ factories: - Enchant_DepthStrider_I - Enchant_Respiration_I - Enchant_Respiration_II + - Enchant_Frost_Walker_I - Upgrade_to_Ocean_Forge - Repair_Factory -# - Enchant_FrostWalker_I oceanforge: type: FCCUPGRADE name: Ocean Forge @@ -756,8 +756,9 @@ factories: - Enchant_Respiration_I - Enchant_Respiration_II - Enchant_Respiration_III + - Enchant_Frost_Walker_I + - Enchant_Frost_Walker_II - Repair_Factory -# - Enchant_FrostWalker_II #Magic magicforge: type: FCCUPGRADE @@ -7799,8 +7800,34 @@ recipes: enchant: OXYGEN level: 2 #Frost Walker -#Until 1.9 + Enchant_Frost_Walker_I: + type: ENCHANT + name: Enchant Boots with Frost Walker I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 400 + enchant: FROST_WALKER + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + + Enchant_Frost_Walker_II: + type: ENCHANT + name: Enchant Boots with Frost Walker II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 500 + enchant: FROST_WALKER + level: 2 + enchant_item: + boots: + material: DIAMOND_BOOTS #Aqua Affinity Enchant_AquaAffinity_I: From ad2f412bcec88d9d3b513abadd49b5d81c676cf7 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 6 May 2016 18:29:38 +0100 Subject: [PATCH 389/459] Added Shield Unbreaking Enchant Recipe (#265) --- configCivcraft.yml | 55 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index b9fbf61e..abf03157 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1047,6 +1047,7 @@ factories: - Enchant_Chestplate_Unbreaking_I - Enchant_Leggings_Unbreaking_I - Enchant_Boots_Unbreaking_I + - Enchant_Shield_Unbreaking_I - Enchant_Sword_Unbreaking_I - Enchant_Bow_Unbreaking_I - Upgrade_to_Metal_Forge @@ -1069,6 +1070,8 @@ factories: - Enchant_Leggings_Unbreaking_II - Enchant_Boots_Unbreaking_I - Enchant_Boots_Unbreaking_II + - Enchant_Shield_Unbreaking_I + - Enchant_Shield_Unbreaking_II - Enchant_Sword_Unbreaking_I - Enchant_Sword_Unbreaking_II - Enchant_Bow_Unbreaking_I @@ -1100,6 +1103,9 @@ factories: - Enchant_Boots_Unbreaking_I - Enchant_Boots_Unbreaking_II - Enchant_Boots_Unbreaking_III + - Enchant_Shield_Unbreaking_I + - Enchant_Shield_Unbreaking_II + - Enchant_Shield_Unbreaking_III - Enchant_Sword_Unbreaking_I - Enchant_Sword_Unbreaking_II - Enchant_Sword_Unbreaking_III @@ -9671,7 +9677,7 @@ recipes: ub2: enchant: DURABILITY level: 2 -#Unbreaking Armour +#Unbreaking Armour/Shield Enchant_Helmet_Unbreaking_I: type: ENCHANT @@ -9725,6 +9731,19 @@ recipes: enchant_item: armor: material: DIAMOND_BOOTS + Enchant_Shield_Unbreaking_I: + type: ENCHANT + name: Enchant Shield with Unbreaking I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: SHIELD Enchant_Helmet_Unbreaking_II: type: ENCHANT name: Enchant Helmet with Unbreaking II @@ -9793,6 +9812,23 @@ recipes: ub1: enchant: DURABILITY level: 1 + Enchant_Shield_Unbreaking_II: + type: ENCHANT + name: Enchant Shield with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: SHIELD + enchants: + ub1: + enchant: DURABILITY + level: 1 Enchant_Helmet_Unbreaking_III: type: ENCHANT name: Enchant Helmet with Unbreaking III @@ -9861,6 +9897,23 @@ recipes: ub2: enchant: DURABILITY level: 2 + Enchant_Shield_Unbreaking_III: + type: ENCHANT + name: Enchant Shield with Unbreaking III + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 250 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: SHIELD + enchants: + ub2: + enchant: DURABILITY + level: 2 #Basic Enchantments Enchant_Efficiency_Pickaxe_Basic: From 0fba59e6e9019c825dd4f161ce1e50ed813a4269 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 8 May 2016 04:40:54 +0200 Subject: [PATCH 390/459] Prevent compacting of enchanted stuff --- pom.xml | 2 +- .../github/igotyou/FactoryMod/recipes/CompactingRecipe.java | 2 +- .../github/igotyou/FactoryMod/recipes/DecompactingRecipe.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 68792022..6285107b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.0 + 2.2.01 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 413ab210..0e1dd24f 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -173,7 +173,7 @@ public static int getCompactStackSize(Material m) { */ private boolean compactable(ItemStack is, ItemMap im) { if (is == null || excludedMaterials.contains(is.getType()) || (input.getAmount(is) != 0) || (is.getItemMeta().getLore() != null && - is.getItemMeta().getLore().contains(compactedLore))) { + is.getItemMeta().getLore().contains(compactedLore)) || is.getItemMeta().hasEnchants()) { return false; } if (im.getAmount(is) >= getCompactStackSize(is.getType())) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 625c792a..3bbd073a 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -122,6 +122,9 @@ public List getOutputRepresentation(Inventory i) { } private boolean isDecompactable(ItemStack is) { + if (is.getItemMeta().hasEnchants()) { + return false; + } List lore = is.getItemMeta().getLore(); if (lore != null) { for(String content : lore) { From 0600760eeaa041534e277947f46a195ca05029bc Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 10 May 2016 01:24:07 +0200 Subject: [PATCH 391/459] Update documentation --- config.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/config.yml b/config.yml index 40ee6b0c..df14ee99 100644 --- a/config.yml +++ b/config.yml @@ -70,6 +70,39 @@ #full list of those. Second you will need to specify the level you want the desired enchantment to be, this may exceed the #possibilites of vanilla without causing problems. + +#You can also create items with specific meta data, currently supported are anything storing potion data, dyed leather armour +#and custom nbt tags + +#For potion data (so for potions, splash potions, linering potions and tipped arrows) you can specify an additional section +#like this: + +#examplePot: +# material: POTION +# potion_effects: +# type: LUCK +# upgraded: true +# extended: true +# custom_effects: +# exampleEffect1: +# type: SPEED +# duration: 1m +# amplifier: 1 + +#Each potion always has one default effect and as many additional custom effects as desired + +#type specifies the look of the potion and the base type of effect that will be applied by the potion. Not all possible status +#effects can be used here, but only the ones that have PotionData, as listed here: +#https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html +#If not specified the type will default to AWKWARD + +#upgraded specifies whether the default potion effect on the item is upgraded or not, per default this is false + +#extended specifies whether the default potion effect on this item is extended or not, per default this is false + +#custom_effects allows you to list other potion effects that are tied to this item, but don't affect it's item model, which is +#determined by the primary potion effect + #---------------------------------------------------------------------------------------------------------------------- #General From 86d1b20e33063f1d5499779888404f157e9b318b Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 10 May 2016 01:24:43 +0200 Subject: [PATCH 392/459] Actually commit everything --- config.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config.yml b/config.yml index df14ee99..bc3a6910 100644 --- a/config.yml +++ b/config.yml @@ -103,6 +103,26 @@ #custom_effects allows you to list other potion effects that are tied to this item, but don't affect it's item model, which is #determined by the primary potion effect +#To make dyed leather armour, two different formats are supported. The first one looks like this: + +#exampleItem: +# material: LEATHER_HELMET +# color: +# red: 255 +# blue: 0 +# green: 255 + +#The additional color section here has an option for each part of an RGB color, which is then applied on the item. All values +#must be within 0 and 255 + +#The other way to specify color of a leather item is directly through a hexadecimal number representing the RGB color like this: + +#exampleItem2: +# material: LEATHER_BOOTS +# color: FF00FF + +#Instead of using color as config identifier, you can as well just use it as option to directly specify the color in hex + #---------------------------------------------------------------------------------------------------------------------- #General From adfb9d4d3232c44545e99799bdd4054aef5968b2 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 10 May 2016 19:44:19 +0200 Subject: [PATCH 393/459] Rework diamond equip forges --- configCivcraft.yml | 104 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index abf03157..2d68d810 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -2869,7 +2869,7 @@ recipes: input: diamond: material: DIAMOND - amount: 8 + amount: 6 output: diamond axe: material: DIAMOND_AXE @@ -2881,7 +2881,7 @@ recipes: input: diamond: material: DIAMOND - amount: 12 + amount: 8 output: diamond boots: material: DIAMOND_BOOTS @@ -2893,7 +2893,7 @@ recipes: input: diamond: material: DIAMOND - amount: 24 + amount: 16 output: diamond chestplate: material: DIAMOND_CHESTPLATE @@ -2905,7 +2905,7 @@ recipes: input: diamond: material: DIAMOND - amount: 28 + amount: 24 output: diamond chestplate: material: DIAMOND_CHESTPLATE @@ -2917,7 +2917,7 @@ recipes: input: diamond: material: DIAMOND - amount: 15 + amount: 10 output: diamond helmet: material: DIAMOND_HELMET @@ -2929,7 +2929,7 @@ recipes: input: diamond: material: DIAMOND - amount: 6 + amount: 4 output: diamond hoe: material: DIAMOND_HOE @@ -2953,7 +2953,7 @@ recipes: input: diamond: material: DIAMOND - amount: 21 + amount: 14 output: diamond leggings: material: DIAMOND_LEGGINGS @@ -2965,7 +2965,7 @@ recipes: input: diamond: material: DIAMOND - amount: 25 + amount: 21 output: diamond leggings: material: DIAMOND_LEGGINGS @@ -2977,7 +2977,7 @@ recipes: input: diamond: material: DIAMOND - amount: 9 + amount: 6 output: diamond pickaxe: material: DIAMOND_PICKAXE @@ -2989,7 +2989,7 @@ recipes: input: diamond: material: DIAMOND - amount: 3 + amount: 2 output: diamond shovel: material: DIAMOND_SPADE @@ -3001,11 +3001,11 @@ recipes: input: diamond: material: DIAMOND - amount: 21 + amount: 9 output: diamond pickaxe: material: DIAMOND_PICKAXE - amount: 8 + amount: 4 Forge_Diamond_Shovel_Basic: type: PRODUCTION name: Forge Diamond Shovel @@ -3013,11 +3013,11 @@ recipes: input: diamond: material: DIAMOND - amount: 7 + amount: 3 output: diamond shovel: material: DIAMOND_SPADE - amount: 8 + amount: 4 Forge_Diamond_Sword: type: PRODUCTION name: Forge Diamond Sword @@ -3025,19 +3025,19 @@ recipes: input: diamond: material: DIAMOND - amount: 10 + amount: 4 output: diamond sword: material: DIAMOND_SWORD - amount: 8 - Forge_Gold_Axe: + amount: 4 + Forge_Gold_Axe: type: PRODUCTION name: Forge Gold Axe - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 8 + amount: 6 output: gold axe: material: GOLD_AXE @@ -3045,11 +3045,11 @@ recipes: Forge_Gold_Boots: type: PRODUCTION name: Forge Gold Boots - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 12 + amount: 8 output: gold boots: material: GOLD_BOOTS @@ -3057,11 +3057,11 @@ recipes: Forge_Gold_Breastplate: type: PRODUCTION name: Forge Gold Breastplate - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 24 + amount: 16 output: gold chestplate: material: GOLD_CHESTPLATE @@ -3069,11 +3069,11 @@ recipes: Forge_Gold_Breastplate_Basic: type: PRODUCTION name: Forge Gold Breastplate - production_time: 32s + production_time: 8s input: gold: material: GOLD_INGOT - amount: 28 + amount: 24 output: gold chestplate: material: GOLD_CHESTPLATE @@ -3081,11 +3081,11 @@ recipes: Forge_Gold_Helmet: type: PRODUCTION name: Forge Gold Helmet - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 15 + amount: 10 output: gold helmet: material: GOLD_HELMET @@ -3093,11 +3093,11 @@ recipes: Forge_Gold_Hoe: type: PRODUCTION name: Forge Gold Hoe - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 6 + amount: 4 output: gold hoe: material: GOLD_HOE @@ -3105,7 +3105,7 @@ recipes: Forge_Gold_Horse_Armour: type: PRODUCTION name: Forge Gold Horse Armour - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT @@ -3117,11 +3117,11 @@ recipes: Forge_Gold_Leggings: type: PRODUCTION name: Forge Gold Leggings - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 21 + amount: 14 output: gold leggings: material: GOLD_LEGGINGS @@ -3129,11 +3129,11 @@ recipes: Forge_Gold_Leggings_Basic: type: PRODUCTION name: Forge Gold Leggings - production_time: 32s + production_time: 8s input: gold: material: GOLD_INGOT - amount: 25 + amount: 21 output: gold leggings: material: GOLD_LEGGINGS @@ -3141,11 +3141,11 @@ recipes: Forge_Gold_Pickaxe: type: PRODUCTION name: Forge Gold Pickaxe - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 9 + amount: 6 output: gold pickaxe: material: GOLD_PICKAXE @@ -3153,11 +3153,11 @@ recipes: Forge_Gold_Shovel: type: PRODUCTION name: Forge Gold Shovel - production_time: 16s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 3 + amount: 2 output: gold shovel: material: GOLD_SPADE @@ -3165,39 +3165,39 @@ recipes: Forge_Gold_Pickaxe_Basic: type: PRODUCTION name: Forge Gold Pickaxe - production_time: 32s + production_time: 8s input: gold: material: GOLD_INGOT - amount: 21 + amount: 9 output: gold pickaxe: material: GOLD_PICKAXE - amount: 8 + amount: 4 Forge_Gold_Shovel_Basic: type: PRODUCTION name: Forge Gold Shovel - production_time: 32s + production_time: 8s input: gold: material: GOLD_INGOT - amount: 7 + amount: 3 output: gold shovel: material: GOLD_SPADE - amount: 8 + amount: 4 Forge_Gold_Sword: type: PRODUCTION name: Forge Gold Sword - production_time: 5s + production_time: 4s input: gold: material: GOLD_INGOT - amount: 10 + amount: 4 output: gold sword: material: GOLD_SWORD - amount: 8 + amount: 4 Forge_Iron_Axe: type: PRODUCTION name: Forge Iron Axe @@ -4494,7 +4494,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 128 + amount: 64 char: material: COAL durability: 1 @@ -4504,7 +4504,7 @@ recipes: amount: 16 anvil: material: ANVIL - amount: 256 + amount: 128 factory: Diamond Armour Forge Upgrade_to_Diamond_Equipment_Forge: production_time: 1h @@ -4514,7 +4514,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 48 + amount: 24 char: material: COAL durability: 1 @@ -4534,7 +4534,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 96 + amount: 48 char: material: COAL durability: 1 @@ -4544,7 +4544,7 @@ recipes: amount: 16 anvil: material: ANVIL - amount: 256 + amount: 128 factory: Diamond Tools Forge Upgrade_to_Farmstead_Factory: production_time: 10m From c4eed0a1a57372e4242af8bc6cd61027b20edbf0 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 11 May 2016 02:15:53 +0200 Subject: [PATCH 394/459] Only prevent compaction of enchanted items if stacksize is 1 --- pom.xml | 2 +- src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java | 2 +- .../github/igotyou/FactoryMod/recipes/DecompactingRecipe.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6285107b..ed05230f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.01 + 2.2.02 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 0e1dd24f..5c815e47 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -173,7 +173,7 @@ public static int getCompactStackSize(Material m) { */ private boolean compactable(ItemStack is, ItemMap im) { if (is == null || excludedMaterials.contains(is.getType()) || (input.getAmount(is) != 0) || (is.getItemMeta().getLore() != null && - is.getItemMeta().getLore().contains(compactedLore)) || is.getItemMeta().hasEnchants()) { + is.getItemMeta().getLore().contains(compactedLore)) || (is.getItemMeta().hasEnchants() && is.getType().getMaxStackSize() == 1)) { return false; } if (im.getAmount(is) >= getCompactStackSize(is.getType())) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 3bbd073a..d3af8cef 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -122,7 +122,7 @@ public List getOutputRepresentation(Inventory i) { } private boolean isDecompactable(ItemStack is) { - if (is.getItemMeta().hasEnchants()) { + if ((is.getItemMeta().hasEnchants() && is.getType().getMaxStackSize() == 1)) { return false; } List lore = is.getItemMeta().getLore(); From efe3955b55d3151ca3985825f23bb33d90ffc0bd Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 11 May 2016 02:24:38 +0200 Subject: [PATCH 395/459] Fix intendation --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 2d68d810..c84a4f41 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3030,7 +3030,7 @@ recipes: diamond sword: material: DIAMOND_SWORD amount: 4 - Forge_Gold_Axe: + Forge_Gold_Axe: type: PRODUCTION name: Forge Gold Axe production_time: 4s From 37cdd761bbd52c49f8f98b9dd0ef4f1995bb8491 Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Wed, 11 May 2016 18:32:11 +0100 Subject: [PATCH 396/459] Quartered Egg Cost for Topaz Recipe (#266) --- configCivcraft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index c84a4f41..52c1a175 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6955,7 +6955,7 @@ recipes: durability: 3 eggs: material: EGG - amount: 32 + amount: 8 lore: - Compacted Item aether: From 2446362f852d41223ab136b463b7670acacaa97b Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Fri, 27 May 2016 18:16:12 +0100 Subject: [PATCH 397/459] Added Fossils (#270) --- configCivcraft.yml | 940 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 940 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 52c1a175..f964ab68 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -71,6 +71,7 @@ factories: - Repair_Factory - Upgrade_to_Ore_Forge - Upgrade_to_Gem_Extractor + - Break_Fossil_Basic oresmelter2: #Basic Contraption --> Stone Smelter --> Ore Smelter --> Ore Forge type: FCCUPGRADE @@ -80,6 +81,7 @@ factories: - Smelt_Iron_Ore_Advanced - Smelt_Gold_Ore - Craft_Cave_Concentrate + - Break_Fossil_Advanced - Repair_Advanced_Factory gemextractor: #Basic Contraption --> Stone Smelter --> Ore Smelter --> Gem Extractor @@ -91,6 +93,7 @@ factories: - Extract_Quartz_Advanced - Extract_Redstone_Advanced - Extract_Lapis + - Break_Fossil_Advanced - Repair_Advanced_Factory #Sand smelting @@ -10020,6 +10023,943 @@ recipes: enchant_item: armor: material: DIAMOND_SWORD +#Fossils + Break_Fossil_Basic: + type: RANDOM + name: Break Fossil + production_time: 10s + fuel_consumption_intervall: 10s + input: + sapling: + material: FLINT + amount: 1 + lore: + - Fossil + outputs: + god1: + chance: 0.000001 + dragonegg: + material: DRAGON_EGG + amount: 1 + lore: + - Egg of Creation + god2: + chance: 0.0004081 + ancientnote: + material: PAPER + amount: 1 + lore: + - Gezo was here !!! + god3: + chance: 0.00040909 + clockback: + material: CLOCK + amount: 1 + lore: + - Clockback + enchants: + kb: + enchant: KNOCKBACK + level: 3 + god4: + chance: 0.00040909 + apollosbow: + material: BOW + amount: 1 + lore: + - Apollo's Bow + enchants: + power: + enchant: ARROW_DAMAGE + level: 5 + ub: + enchant: DURABILITY + level: 5 + flame: + enchant: ARROW_FIRE + level: 1 + infinity: + enchant: ARROW_INFINITE + level: 1 + god5: + chance: 0.00040909 + imcandopickaxe: + material: DIAMOND_PICKAXE + amount: 1 + lore: + - Imcando Pickaxe + enchants: + efficiency: + enchant: DIG_SPEED + level: 5 + ub: + enchant: DURABILITY + level: 5 + godbook1: + chance: 0.00120909 + power5book: + material: BOOK + amount: 1 + stored_enchants: + power5: + enchant: ARROW_DAMAGE + level: 5 + godbook2: + chance: 0.00120909 + infinity: + material: BOOK + amount: 1 + stored_enchants: + infinity: + enchant: ARROW_INFINITE + level: 1 + godbook3: + chance: 0.00120909 + eff5: + material: BOOK + amount: 1 + stored_enchants: + eff5: + enchant: DIG_SPEED + level: 5 + godbook4: + chance: 0.00120909 + ub3: + material: BOOK + amount: 1 + stored_enchants: + ub3: + enchant: DURABILITY + level: 4 + godbook5: + chance: 0.00120909 + sharpness5: + material: BOOK + amount: 1 + stored_enchants: + sharpness5: + enchant: DAMAGE_ALL + level: 5 + godbook6: + chance: 0.00110909 + protection4: + material: BOOK + amount: 1 + stored_enchants: + protection4: + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + godbook7: + chance: 0.00120909 + silktouch: + material: BOOK + amount: 1 + stored_enchants: + silktouch: + enchant: SILK_TOUCH + level: 1 + high1: + chance: 0.0037038 + item: + material: DIAMOND_BARDING + amount: 1 + high2: + chance: 0.0037038 + item: + material: SPONGE + amount: 1 + high3: + chance: 0.0037038 + item: + material: DIAMOND_PICKAXE + amount: 1 + high4: + chance: 0.0037038 + item: + material: DIAMOND_AXE + amount: 1 + high5: + chance: 0.0037038 + item: + material: DIAMOND_SPADE + amount: 1 + high6: + chance: 0.0037038 + item: + material: DIAMOND_CHESTPLATE + amount: 1 + high7: + chance: 0.0037038 + item: + material: DIAMOND_LEGGINGS + amount: 1 + high8: + chance: 0.0037038 + item: + material: DIAMOND_HELMET + amount: 1 + high9: + chance: 0.0037038 + item: + material: DIAMOND_BOOTS + amount: 1 + high10: + chance: 0.0037038 + item: + material: IRON_INGOT + amount: 64 + high11: + chance: 0.0037038 + item: + material: DIAMOND_BLOCK + amount: 1 + high12: + chance: 0.0037038 + creeper: + material: MONSTER_EGG + amount: 1 + durability: 50 + high13: + chance: 0.0037038 + creeper: + material: MONSTER_EGG + amount: 1 + durability: 54 + high14: + chance: 0.0037038 + skeleton: + material: MONSTER_EGG + amount: 1 + durability: 51 + high15: + chance: 0.0037038 + spider: + material: MONSTER_EGG + amount: 1 + durability: 52 + high16: + chance: 0.0037038 + blaze: + material: MONSTER_EGG + amount: 1 + durability: 61 + high17: + chance: 0.0037038 + ghast: + material: MONSTER_EGG + amount: 1 + durability: 56 + high18: + chance: 0.0037038 + guardian: + material: MONSTER_EGG + amount: 1 + durability: 68 + high19: + chance: 0.0037038 + magmacube: + material: MONSTER_EGG + amount: 1 + durability: 62 + high20: + chance: 0.0037038 + slime: + material: MONSTER_EGG + amount: 1 + durability: 55 + high21: + chance: 0.0037038 + witch: + material: MONSTER_EGG + amount: 1 + durability: 66 + high22: + chance: 0.0037038 + villager: + material: MONSTER_EGG + amount: 1 + durability: 120 + high23: + chance: 0.0037038 + cavespider: + material: MONSTER_EGG + amount: 1 + durability: 59 + high24: + chance: 0.0037038 + enderman: + material: MONSTER_EGG + amount: 1 + durability: 58 + high25: + chance: 0.0037038 + zombiepigman: + material: MONSTER_EGG + amount: 1 + durability: 57 + high26: + chance: 0.0037038 + item: + material: COAL + amount: 32 + durability: 1 + lore: + - Compacted Item + high27: + chance: 0.0037012 + item: + material: COAL_ORE + amount: 5 + lore: + - Cave Concentrate + mid1: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 90 + mid2: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 92 + mid3: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 93 + mid4: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 94 + mid5: + chance: 0.026176 + item: + material: NOTE_BLOCK + amount: 5 + mid6: + chance: 0.026176 + item: + material: DIAMOND + amount: 1 + mid7: + chance: 0.026176 + item: + material: EMERALD_BLOCK + amount: 1 + mid8: + chance: 0.026176 + item: + material: IRON_BLOCK + amount: 1 + mid9: + chance: 0.026176 + item: + material: REDSTONE_BLOCK + amount: 1 + mid10: + chance: 0.026176 + item: + material: LAPIS_BLOCK + amount: 64 + mid11: + chance: 0.026176 + item: + material: GOLD_RECORD + amount: 1 + mid12: + chance: 0.026176 + item: + material: GREEN_RECORD + amount: 1 + mid13: + chance: 0.026176 + item: + material: RECORD_3 + amount: 1 + mid14: + chance: 0.026176 + item: + material: RECORD_4 + amount: 1 + mid15: + chance: 0.026176 + item: + material: RECORD_5 + amount: 1 + mid16: + chance: 0.026176 + item: + material: RECORD_6 + amount: 1 + mid17: + chance: 0.026176 + item: + material: RECORD_7 + amount: 1 + mid18: + chance: 0.026176 + item: + material: RECORD_8 + amount: 1 + mid19: + chance: 0.026176 + item: + material: RECORD_9 + amount: 1 + mid20: + chance: 0.026176 + item: + material: RECORD_10 + amount: 64 + mid21: + chance: 0.026176 + item: + material: RECORD_11 + amount: 1 + mid22: + chance: 0.026176 + item: + material: RECORD_12 + amount: 1 + mid23: + chance: 0.026176 + item: + material: MINECART + amount: 1 + mid24: + chance: 0.026176 + mooshroom: + material: MONSTER_EGG + amount: 1 + durability: 96 + mid25: + chance: 0.026176 + horse: + material: MONSTER_EGG + amount: 1 + durability: 100 + mid26: + chance: 0.026176 + rabbit: + material: MONSTER_EGG + amount: 1 + durability: 101 + mid27: + chance: 0.026176 + ocelot: + material: MONSTER_EGG + amount: 1 + durability: 98 + mid28: + chance: 0.026176 + squid: + material: MONSTER_EGG + amount: 1 + durability: 94 + mid29: + chance: 0.026176 + wolf: + material: MONSTER_EGG + amount: 1 + durability: 95 + mid30: + chance: 0.026176 + item: + material: IRON_BARDING + amount: 1 + mid31: + chance: 0.026176 + item: + material: BONE + amount: 32 + mid32: + chance: 0.026176 + item: + material: PRISMARINE_SHARD + amount: 5 + mid33: + chance: 0.026176 + item: + material: PRISMARINE_CRYSTALS + amount: 3 + mid34: + chance: 0.026192 + item: + material: JUKEBOX + amount: 1 + Break_Fossil_Advanced: + type: RANDOM + name: Break Fossil + production_time: 5s + fuel_consumption_intervall: 5s + input: + sapling: + material: FLINT + amount: 1 + lore: + - Fossil + outputs: + god1: + chance: 0.000001 + dragonegg: + material: DRAGON_EGG + amount: 1 + lore: + - Egg of Creation + god2: + chance: 0.0004081 + ancientnote: + material: PAPER + amount: 1 + lore: + - Gezo was here !!! + god3: + chance: 0.00040909 + clockback: + material: CLOCK + amount: 1 + lore: + - Clockback + enchants: + kb: + enchant: KNOCKBACK + level: 3 + god4: + chance: 0.00040909 + apollosbow: + material: BOW + amount: 1 + lore: + - Apollo's Bow + enchants: + power: + enchant: ARROW_DAMAGE + level: 5 + ub: + enchant: DURABILITY + level: 5 + flame: + enchant: ARROW_FIRE + level: 1 + infinity: + enchant: ARROW_INFINITE + level: 1 + god5: + chance: 0.00040909 + imcandopickaxe: + material: DIAMOND_PICKAXE + amount: 1 + lore: + - Imcando Pickaxe + enchants: + efficiency: + enchant: DIG_SPEED + level: 5 + ub: + enchant: DURABILITY + level: 5 + godbook1: + chance: 0.00120909 + power5book: + material: BOOK + amount: 1 + stored_enchants: + power5: + enchant: ARROW_DAMAGE + level: 5 + godbook2: + chance: 0.00120909 + infinity: + material: BOOK + amount: 1 + stored_enchants: + infinity: + enchant: ARROW_INFINITE + level: 1 + godbook3: + chance: 0.00120909 + eff5: + material: BOOK + amount: 1 + stored_enchants: + eff5: + enchant: DIG_SPEED + level: 5 + godbook4: + chance: 0.00120909 + ub3: + material: BOOK + amount: 1 + stored_enchants: + ub3: + enchant: DURABILITY + level: 4 + godbook5: + chance: 0.00120909 + sharpness5: + material: BOOK + amount: 1 + stored_enchants: + sharpness5: + enchant: DAMAGE_ALL + level: 5 + godbook6: + chance: 0.00110909 + protection4: + material: BOOK + amount: 1 + stored_enchants: + protection4: + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + godbook7: + chance: 0.00120909 + silktouch: + material: BOOK + amount: 1 + stored_enchants: + silktouch: + enchant: SILK_TOUCH + level: 1 + high1: + chance: 0.0037038 + item: + material: DIAMOND_BARDING + amount: 1 + high2: + chance: 0.0037038 + item: + material: SPONGE + amount: 1 + high3: + chance: 0.0037038 + item: + material: DIAMOND_PICKAXE + amount: 1 + high4: + chance: 0.0037038 + item: + material: DIAMOND_AXE + amount: 1 + high5: + chance: 0.0037038 + item: + material: DIAMOND_SPADE + amount: 1 + high6: + chance: 0.0037038 + item: + material: DIAMOND_CHESTPLATE + amount: 1 + high7: + chance: 0.0037038 + item: + material: DIAMOND_LEGGINGS + amount: 1 + high8: + chance: 0.0037038 + item: + material: DIAMOND_HELMET + amount: 1 + high9: + chance: 0.0037038 + item: + material: DIAMOND_BOOTS + amount: 1 + high10: + chance: 0.0037038 + item: + material: IRON_INGOT + amount: 64 + high11: + chance: 0.0037038 + item: + material: DIAMOND_BLOCK + amount: 1 + high12: + chance: 0.0037038 + creeper: + material: MONSTER_EGG + amount: 1 + durability: 50 + high13: + chance: 0.0037038 + creeper: + material: MONSTER_EGG + amount: 1 + durability: 54 + high14: + chance: 0.0037038 + skeleton: + material: MONSTER_EGG + amount: 1 + durability: 51 + high15: + chance: 0.0037038 + spider: + material: MONSTER_EGG + amount: 1 + durability: 52 + high16: + chance: 0.0037038 + blaze: + material: MONSTER_EGG + amount: 1 + durability: 61 + high17: + chance: 0.0037038 + ghast: + material: MONSTER_EGG + amount: 1 + durability: 56 + high18: + chance: 0.0037038 + guardian: + material: MONSTER_EGG + amount: 1 + durability: 68 + high19: + chance: 0.0037038 + magmacube: + material: MONSTER_EGG + amount: 1 + durability: 62 + high20: + chance: 0.0037038 + slime: + material: MONSTER_EGG + amount: 1 + durability: 55 + high21: + chance: 0.0037038 + witch: + material: MONSTER_EGG + amount: 1 + durability: 66 + high22: + chance: 0.0037038 + villager: + material: MONSTER_EGG + amount: 1 + durability: 120 + high23: + chance: 0.0037038 + cavespider: + material: MONSTER_EGG + amount: 1 + durability: 59 + high24: + chance: 0.0037038 + enderman: + material: MONSTER_EGG + amount: 1 + durability: 58 + high25: + chance: 0.0037038 + zombiepigman: + material: MONSTER_EGG + amount: 1 + durability: 57 + high26: + chance: 0.0037038 + item: + material: COAL + amount: 32 + durability: 1 + lore: + - Compacted Item + high27: + chance: 0.0037012 + item: + material: COAL_ORE + amount: 5 + lore: + - Cave Concentrate + mid1: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 90 + mid2: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 92 + mid3: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 93 + mid4: + chance: 0.026176 + item: + material: MONSTER_EGG + amount: 1 + durability: 94 + mid5: + chance: 0.026176 + item: + material: NOTE_BLOCK + amount: 5 + mid6: + chance: 0.026176 + item: + material: DIAMOND + amount: 1 + mid7: + chance: 0.026176 + item: + material: EMERALD_BLOCK + amount: 1 + mid8: + chance: 0.026176 + item: + material: IRON_BLOCK + amount: 1 + mid9: + chance: 0.026176 + item: + material: REDSTONE_BLOCK + amount: 1 + mid10: + chance: 0.026176 + item: + material: LAPIS_BLOCK + amount: 64 + mid11: + chance: 0.026176 + item: + material: GOLD_RECORD + amount: 1 + mid12: + chance: 0.026176 + item: + material: GREEN_RECORD + amount: 1 + mid13: + chance: 0.026176 + item: + material: RECORD_3 + amount: 1 + mid14: + chance: 0.026176 + item: + material: RECORD_4 + amount: 1 + mid15: + chance: 0.026176 + item: + material: RECORD_5 + amount: 1 + mid16: + chance: 0.026176 + item: + material: RECORD_6 + amount: 1 + mid17: + chance: 0.026176 + item: + material: RECORD_7 + amount: 1 + mid18: + chance: 0.026176 + item: + material: RECORD_8 + amount: 1 + mid19: + chance: 0.026176 + item: + material: RECORD_9 + amount: 1 + mid20: + chance: 0.026176 + item: + material: RECORD_10 + amount: 64 + mid21: + chance: 0.026176 + item: + material: RECORD_11 + amount: 1 + mid22: + chance: 0.026176 + item: + material: RECORD_12 + amount: 1 + mid23: + chance: 0.026176 + item: + material: MINECART + amount: 1 + mid24: + chance: 0.026176 + mooshroom: + material: MONSTER_EGG + amount: 1 + durability: 96 + mid25: + chance: 0.026176 + horse: + material: MONSTER_EGG + amount: 1 + durability: 100 + mid26: + chance: 0.026176 + rabbit: + material: MONSTER_EGG + amount: 1 + durability: 101 + mid27: + chance: 0.026176 + ocelot: + material: MONSTER_EGG + amount: 1 + durability: 98 + mid28: + chance: 0.026176 + squid: + material: MONSTER_EGG + amount: 1 + durability: 94 + mid29: + chance: 0.026176 + wolf: + material: MONSTER_EGG + amount: 1 + durability: 95 + mid30: + chance: 0.026176 + item: + material: IRON_BARDING + amount: 1 + mid31: + chance: 0.026176 + item: + material: BONE + amount: 32 + mid32: + chance: 0.026176 + item: + material: PRISMARINE_SHARD + amount: 5 + mid33: + chance: 0.026176 + item: + material: PRISMARINE_CRYSTALS + amount: 3 + mid34: + chance: 0.026192 + item: + material: JUKEBOX + amount: 1 #Destroy factory and returns the setup cost multiplied by a given factor Return_Materials: From 6467720204d25209f774397445a4e48f35b90aa1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 27 May 2016 19:28:25 +0200 Subject: [PATCH 398/459] Fix wrong material name --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index f964ab68..9d65cd4e 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -10053,7 +10053,7 @@ recipes: god3: chance: 0.00040909 clockback: - material: CLOCK + material: WATCH amount: 1 lore: - Clockback @@ -10521,7 +10521,7 @@ recipes: god3: chance: 0.00040909 clockback: - material: CLOCK + material: WATCH amount: 1 lore: - Clockback From 39052eef96b23b969b8b70045a738a21fa333229 Mon Sep 17 00:00:00 2001 From: Yearn0 Date: Fri, 3 Jun 2016 10:33:36 -0700 Subject: [PATCH 399/459] configCivcraft.yml (#271) Removed dead bush output from random sapling mutator recipe. --- configCivcraft.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 9d65cd4e..3177d9e7 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -3569,7 +3569,7 @@ recipes: amount: 1 outputs: 1: - chance: 0.125 + chance: 0.143 oaksapling: material: SAPLING amount: 48 @@ -3578,7 +3578,7 @@ recipes: material: BUCKET amount: 1 2: - chance: 0.125 + chance: 0.143 sprucesapling: material: SAPLING amount: 48 @@ -3587,7 +3587,7 @@ recipes: material: BUCKET amount: 1 3: - chance: 0.125 + chance: 0.143 birchsapling: material: SAPLING amount: 48 @@ -3596,7 +3596,7 @@ recipes: material: BUCKET amount: 1 4: - chance: 0.125 + chance: 0.143 junglesapling: material: SAPLING amount: 48 @@ -3605,7 +3605,7 @@ recipes: material: BUCKET amount: 1 5: - chance: 0.125 + chance: 0.143 acaciasapling: material: SAPLING amount: 48 @@ -3614,7 +3614,7 @@ recipes: material: BUCKET amount: 1 6: - chance: 0.125 + chance: 0.143 darkoaksapling: material: SAPLING amount: 48 @@ -3623,15 +3623,7 @@ recipes: material: BUCKET amount: 1 7: - chance: 0.125 - deadbush: - material: DEAD_BUSH - amount: 16 - emptybucket: - material: BUCKET - amount: 1 - 8: - chance: 0.125 + chance: 0.142 tallfern: material: DOUBLE_PLANT amount: 32 From 099508dae786283d0675bda260034e45557d8eb2 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 11 Jun 2016 02:30:14 +0200 Subject: [PATCH 400/459] Fix NPE for material return recipe --- pom.xml | 2 +- .../recipes/FactoryMaterialReturnRecipe.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed05230f..82bd949a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.02 + 2.2.03 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java index 12c446b0..0e9e53b7 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -1,9 +1,11 @@ package com.github.igotyou.FactoryMod.recipes; +import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -39,6 +41,14 @@ public List getInputRepresentation(Inventory i) { } public List getOutputRepresentation(Inventory i) { + if (i == null) { + ItemStack is = new ItemStack(Material.PAPER); + ISUtils.setName(is, "Total setupcost"); + ISUtils.addLore(is, ChatColor.AQUA + "All the materials invested into setting up and upgrading this factory"); + List stacks = new LinkedList(); + stacks.add(is); + return stacks; + } BlockState bs = (BlockState) i.getHolder(); Location loc = bs.getLocation(); FurnCraftChestFactory fcc = (FurnCraftChestFactory) FactoryMod From 813d0f2f5cae6ba027db2672c81027b2357ddd6a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 11 Jun 2016 02:31:00 +0200 Subject: [PATCH 401/459] Update to 1.10 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 82bd949a..a3cc22d6 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.03 + 2.2.10 FactoryMod https://github.com/Civcraft/FactoryMod @@ -33,7 +33,7 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.10-R0.1-SNAPSHOT provided From 3da661067473c91f0d955739f69f10dfdca5f967 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 11 Jun 2016 16:47:17 +0200 Subject: [PATCH 402/459] Update to 1.10 (#272) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 82bd949a..a3cc22d6 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.03 + 2.2.10 FactoryMod https://github.com/Civcraft/FactoryMod @@ -33,7 +33,7 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.10-R0.1-SNAPSHOT provided From 9bdfb258858b890ff6e357ad3b284b0303325c37 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 12 Jun 2016 18:06:51 +0200 Subject: [PATCH 403/459] Remove plugin setting for clickable inventory --- pom.xml | 4 ++-- src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a3cc22d6..961d7056 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.10 + 2.2.11 FactoryMod https://github.com/Civcraft/FactoryMod @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.3.2 + 1.4.3 provided diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 3889bd55..1df1b8db 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -49,7 +49,6 @@ public class MenuBuilder { private IFactoryEgg defaultMenu; public MenuBuilder(String defaultFactory) { - ClickableInventory.setPlugin(FactoryMod.getPlugin()); manager = FactoryMod.getManager(); for (IFactoryEgg egg : manager.getAllEggs().values()) { if (egg instanceof FurnCraftChestEgg) { From 772271ae4ef592b959d98702d810f27c5b5a4a13 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 12 Jun 2016 18:10:41 +0200 Subject: [PATCH 404/459] Actually commit fixed pom --- pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index 78c31185..961d7056 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,7 @@ com.github.igotyou FactoryMod jar -<<<<<<< HEAD 2.2.11 -======= - 2.2.10 ->>>>>>> 3da661067473c91f0d955739f69f10dfdca5f967 FactoryMod https://github.com/Civcraft/FactoryMod From 7c010de86d57da28ad905a7e31d8eca836c1cc7b Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 10 Jul 2016 23:01:27 +0200 Subject: [PATCH 405/459] Add reinforcement recipes --- configCivcraft.yml | 356 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 356 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 3177d9e7..d77db259 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -42,7 +42,54 @@ factories: - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor - Upgrade_to_Basic_Forge + - Upgrade_to_Basic_Fortification + #Reinforcement factories + #Basic Contraption --> Basic Fortification + basicFortification: + type: FCCUPGRADE + name: Basic Fortification + recipes: + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Upgrade_to_Intermediate_Fortification + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification + intermediateFortification: + type: FCCUPGRADE + name: Intermediate Fortification + recipes: + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Produce_strong_Hunter_Component + - Produce_strong_Miner_Component + - Produce_good_reinforcement + - Produce_Bracers + - Upgrade_to_Advanced_Fortification + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification --> Advanced Fortification + advancedFortification: + type: FCCUPGRADE + name: Advanced Fortification + recipes: + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Produce_strong_Hunter_Component + - Produce_strong_Miner_Component + - Produce_good_reinforcement + - Produce_Bracers + - Produce_best_reinforcement + - Produce_good_instant_reinforcement + #Smelting stonesmelter: #Basic Contraption --> Stone Smelter @@ -10952,6 +10999,315 @@ recipes: item: material: JUKEBOX amount: 1 + +#Reinforcement recipes: + Produce_decent_solid_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent solid Miner Component + input: + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + flint: + material: FLINT + amount: 24 + iron: + material: IRON_INGOT + amount: 48 + output: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 1 + + Produce_decent_shiny_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent shiny Miner Component + input: + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + redstone: + material: REDSTONE + amount: 24 + gold: + material: GOLD_INGOT + amount: 32 + output: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 1 + + Produce_decent_bouncy_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent bouncy Hunter Component + input: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + slime: + material: SLIME_BALL + amount: 32 + blazeRod: + material: BLAZE_ROD + amount: 24 + output: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + + Produce_decent_heatresistant_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent heatresistant Hunter Component + input: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + magmaCream: + material: MAGMA_CREAM + amount: 24 + gunpowder: + material: SULPHUR + amount: 32 + output: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + + Produce_decent_reinforcement: + type: PRODUCTION + production_time: 5s + name: Produce decent reinforcement + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 4 + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + amount: 4 + output: + slimeball: + material: SLIME_BALL + amount: 64 + lore: + - Decent Reinforcement + + Produce_strong_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce strong Hunter Component + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 6 + ghastTear: + material: GHAST_TEAR + amount: 16 + witherskull: + material: SKULL_ITEM + durability: 1 + output: + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 1 + + Produce_strong_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce strong Miner Component + input: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + amount: 6 + diamond: + material: DIAMOND + amount: 32 + lapis: + material: INK_SACK + durability: 4 + amount: 32 + output: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 1 + + Produce_good_reinforcement: + type: PRODUCTION + production_time: 10s + name: Produce good reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 4 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 4 + output: + goodReinforcement: + material: MAGMA_CREAM + amount: 64 + lore: + - Good Reinforcement + + Produce_Bracers: + type: PRODUCTION + production_time: 5s + name: Produce Bracers + input: + stone: + material: STONE + durability: -1 + amount: 64 + sand: + material: SAND + durability: -1 + amount: 64 + gravel: + material: GRAVEL + amount: 64 + output: + bracers: + material: FLINT + lore: + - Structure Bracing + amount: 64 + + Produce_best_reinforcement: + type: PRODUCTION + production_time: 15s + name: Produce best reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 6 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 6 + xp: + material: EMERALD_BLOCK + amount: 18 + output: + material: QUARTZ + lore: + - Best Reinforcement + amount: 32 + + Produce_good_instant_reinforcement: + type: PRODUCTION + production_time: 15s + name: Produce good instant reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 6 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 6 + xp: + material: EMERALD_BLOCK + amount: 12 + output: + material: INK_SACK + durability: 1 + lore: + - Rapid Reinforcement + amount: 32 + + Upgrade_to_Basic_Fortification: + production_time: 5m + type: UPGRADE + name: Upgrade to Basic Fortification + factory: Basic Fortification + fuel_consumption_intervall: 10s + input: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Upgrade_to_Intermediate_Fortification: + production_time: 1h + type: UPGRADE + name: Upgrade to Intermediate Fortification + factory: Intermediate Fortification + fuel_consumption_intervall: 1m + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 8 + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + amount: 8 + + Upgrade_to_Advanced_Fortification: + production_time: 12h + type: UPGRADE + name: Upgrade to Advanced Fortification + factory: Advanced Fortification + fuel_consumption_intervall: 15m + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 8 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 8 + #Destroy factory and returns the setup cost multiplied by a given factor Return_Materials: From 7bdcf5ce62cab3b43d49b88ab0a07fede9704a2d Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 10 Jul 2016 23:14:34 +0200 Subject: [PATCH 406/459] Use plural for reinforcement factory names --- configCivcraft.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d77db259..a808fd90 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -48,7 +48,7 @@ factories: #Basic Contraption --> Basic Fortification basicFortification: type: FCCUPGRADE - name: Basic Fortification + name: Basic Fortifications recipes: - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component @@ -60,7 +60,7 @@ factories: #Basic Contraption --> Basic Fortification --> Intermediate Fortification intermediateFortification: type: FCCUPGRADE - name: Intermediate Fortification + name: Intermediate Fortifications recipes: - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component @@ -76,7 +76,7 @@ factories: #Basic Contraption --> Basic Fortification --> Intermediate Fortification --> Advanced Fortification advancedFortification: type: FCCUPGRADE - name: Advanced Fortification + name: Advanced Fortifications recipes: - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component @@ -11258,7 +11258,7 @@ recipes: production_time: 5m type: UPGRADE name: Upgrade to Basic Fortification - factory: Basic Fortification + factory: Basic Fortifications fuel_consumption_intervall: 10s input: basicMiner: @@ -11276,7 +11276,7 @@ recipes: production_time: 1h type: UPGRADE name: Upgrade to Intermediate Fortification - factory: Intermediate Fortification + factory: Intermediate Fortifications fuel_consumption_intervall: 1m input: decentMiner: @@ -11294,7 +11294,7 @@ recipes: production_time: 12h type: UPGRADE name: Upgrade to Advanced Fortification - factory: Advanced Fortification + factory: Advanced Fortifications fuel_consumption_intervall: 15m input: strongMiner: From 9b38b10d30ef9099cd9abd49f6ee134c06d6aad1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 10 Jul 2016 23:37:03 +0200 Subject: [PATCH 407/459] Add fast basic recipes --- configCivcraft.yml | 149 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 3 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a808fd90..d9a7a652 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -50,6 +50,12 @@ factories: type: FCCUPGRADE name: Basic Fortifications recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -62,6 +68,12 @@ factories: type: FCCUPGRADE name: Intermediate Fortifications recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -78,6 +90,12 @@ factories: type: FCCUPGRADE name: Advanced Fortifications recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -11001,6 +11019,132 @@ recipes: amount: 1 #Reinforcement recipes: + Produce_basic_granite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Granite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 1 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Produce_basic_andesite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Andesite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 5 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Produce_basic_diorite_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce basic Diorite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 3 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Produce_basic_ink_splashed_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce basic ink splashed Hunter Component + input: + inksack: + material: INK_SACK + amount: 16 + bone: + material: BONE + amount: 24 + string: + material: STRING + amount: 32 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Produce_basic_sticky_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce basic sticky Hunter Component + input: + inksack: + material: SPIDER_EYE + amount: 32 + bone: + material: ROTTEN_FLESH + amount: 64 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Produce_basic_mysterious_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce basic mysterious Hunter Component + input: + inksack: + material: ENDER_PEARL + amount: 16 + bone: + material: ROTTEN_FLESH + amount: 32 + string: + material: STRING + amount: 32 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + Produce_decent_solid_Miner_Component: type: PRODUCTION production_time: 4s @@ -11200,7 +11344,7 @@ recipes: amount: 64 output: bracers: - material: FLINT + material: NETHER_BRICK_ITEM lore: - Structure Bracing amount: 64 @@ -11248,8 +11392,7 @@ recipes: material: EMERALD_BLOCK amount: 12 output: - material: INK_SACK - durability: 1 + material: FIREWORK_CHARGE lore: - Rapid Reinforcement amount: 32 From e95e2dab7bd913829a69b5083fd9f9e51ee8ffde Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 10 Jul 2016 23:46:49 +0200 Subject: [PATCH 408/459] Fix quantites for basic reinforcement component recipes --- configCivcraft.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index d9a7a652..f4029460 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -11039,7 +11039,6 @@ recipes: material: FLINT name: Miner Component lore: Basic Reinforcement Ingredient - amount: 8 Produce_basic_andesite_Miner_Component: type: PRODUCTION @@ -11061,7 +11060,6 @@ recipes: material: FLINT name: Miner Component lore: Basic Reinforcement Ingredient - amount: 8 Produce_basic_diorite_Miner_Component: type: PRODUCTION @@ -11083,7 +11081,6 @@ recipes: material: FLINT name: Miner Component lore: Basic Reinforcement Ingredient - amount: 8 Produce_basic_ink_splashed_Hunter_Component: type: PRODUCTION @@ -11103,8 +11100,7 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient - amount: 8 + lore: Basic Reinforcement Ingredient Produce_basic_sticky_Hunter_Component: type: PRODUCTION @@ -11122,7 +11118,6 @@ recipes: material: BONE name: Hunter Component lore: Basic Reinforcement Ingredient - amount: 8 Produce_basic_mysterious_Hunter_Component: type: PRODUCTION @@ -11143,7 +11138,6 @@ recipes: material: BONE name: Hunter Component lore: Basic Reinforcement Ingredient - amount: 8 Produce_decent_solid_Miner_Component: type: PRODUCTION From 83e75a2822705528b8db7a438171f4ae233c6947 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 11 Jul 2016 00:10:15 +0200 Subject: [PATCH 409/459] Add basic reinforcement recipes (not just components) and fix some mistakes --- configCivcraft.yml | 149 +++++++++++++++++++++++++++++++++------------ 1 file changed, 109 insertions(+), 40 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index f4029460..222d801b 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -56,6 +56,8 @@ factories: - Produce_basic_ink_splashed_Hunter_Component - Produce_basic_mysterious_Hunter_Component - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -74,6 +76,8 @@ factories: - Produce_basic_ink_splashed_Hunter_Component - Produce_basic_mysterious_Hunter_Component - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -96,6 +100,8 @@ factories: - Produce_basic_ink_splashed_Hunter_Component - Produce_basic_mysterious_Hunter_Component - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement - Produce_decent_solid_Miner_Component - Produce_decent_shiny_Miner_Component - Produce_decent_bouncy_Hunter_Component @@ -11038,7 +11044,8 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient Produce_basic_andesite_Miner_Component: type: PRODUCTION @@ -11059,11 +11066,12 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient Produce_basic_diorite_Miner_Component: type: PRODUCTION - production_time: 4s + production_time: 2s name: Produce basic Diorite Miner Component input: stone: @@ -11080,11 +11088,12 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient Produce_basic_ink_splashed_Hunter_Component: type: PRODUCTION - production_time: 4s + production_time: 2s name: Produce basic ink splashed Hunter Component input: inksack: @@ -11100,11 +11109,12 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient Produce_basic_sticky_Hunter_Component: type: PRODUCTION - production_time: 4s + production_time: 2s name: Produce basic sticky Hunter Component input: inksack: @@ -11117,11 +11127,12 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient Produce_basic_mysterious_Hunter_Component: type: PRODUCTION - production_time: 4s + production_time: 2s name: Produce basic mysterious Hunter Component input: inksack: @@ -11137,7 +11148,45 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient + + Produce_basic_miner_reinforcement: + type: PRODUCTION + production_time: 2s + name: Produce basic miner reinforcement + input: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + amount: 4 + + output: + basicRein: + material: CLAY_BALL + amount: 64 + lore: + - Basic Reinforcement + + Produce_basic_hunter_reinforcement: + type: PRODUCTION + production_time: 2s + amount: 4 + name: Produce basic hunter reinforcement + input: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + output: + basicRein: + material: CLAY_BALL + amount: 64 + lore: + - Basic Reinforcement Produce_decent_solid_Miner_Component: type: PRODUCTION @@ -11147,7 +11196,8 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 flint: material: FLINT @@ -11159,8 +11209,8 @@ recipes: decentMiner: material: QUARTZ name: Miner Component - lore: Decent Reinforcement Ingredient - amount: 1 + lore: + - Decent Reinforcement Ingredient Produce_decent_shiny_Miner_Component: type: PRODUCTION @@ -11170,7 +11220,8 @@ recipes: basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 redstone: material: REDSTONE @@ -11182,8 +11233,8 @@ recipes: decentMiner: material: QUARTZ name: Miner Component - lore: Decent Reinforcement Ingredient - amount: 1 + lore: + - Decent Reinforcement Ingredient Produce_decent_bouncy_Hunter_Component: type: PRODUCTION @@ -11193,7 +11244,8 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 slime: material: SLIME_BALL @@ -11205,7 +11257,8 @@ recipes: decentHunter: material: SULPHUR name: Hunter Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient Produce_decent_heatresistant_Hunter_Component: type: PRODUCTION @@ -11215,7 +11268,8 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 magmaCream: material: MAGMA_CREAM @@ -11227,7 +11281,8 @@ recipes: decentHunter: material: SULPHUR name: Hunter Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient Produce_decent_reinforcement: type: PRODUCTION @@ -11237,12 +11292,14 @@ recipes: decentMiner: material: QUARTZ name: Miner Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 4 decentHunter: material: SULPHUR name: Hunter Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 4 output: slimeball: @@ -11259,7 +11316,8 @@ recipes: decentMiner: material: QUARTZ name: Miner Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 6 ghastTear: material: GHAST_TEAR @@ -11271,7 +11329,8 @@ recipes: strongHunter: material: GHAST_TEAR name: Hunter Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 1 Produce_strong_Miner_Component: @@ -11282,7 +11341,8 @@ recipes: decentHunter: material: SULPHUR name: Hunter Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 6 diamond: material: DIAMOND @@ -11295,7 +11355,8 @@ recipes: strongMiner: material: PRISMARINE name: Miner Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 1 Produce_good_reinforcement: @@ -11306,12 +11367,14 @@ recipes: strongMiner: material: PRISMARINE name: Miner Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 4 strongHunter: material: GHAST_TEAR name: Hunter Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 4 output: goodReinforcement: @@ -11351,21 +11414,24 @@ recipes: strongMiner: material: PRISMARINE name: Miner Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 6 strongHunter: material: GHAST_TEAR name: Hunter Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 6 xp: material: EMERALD_BLOCK amount: 18 output: - material: QUARTZ - lore: - - Best Reinforcement - amount: 32 + bestRein: + material: QUARTZ + lore: + - Best Reinforcement + amount: 32 Produce_good_instant_reinforcement: type: PRODUCTION @@ -11375,21 +11441,24 @@ recipes: strongMiner: material: PRISMARINE name: Miner Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 6 strongHunter: material: GHAST_TEAR name: Hunter Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 6 xp: material: EMERALD_BLOCK amount: 12 output: - material: FIREWORK_CHARGE - lore: - - Rapid Reinforcement - amount: 32 + goodInstantRein: + material: FIREWORK_CHARGE + lore: + - Rapid Reinforcement + amount: 32 Upgrade_to_Basic_Fortification: production_time: 5m From 7cabb823d892539fda260495b0befb3751f9f1cf Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 11 Jul 2016 00:55:36 +0200 Subject: [PATCH 410/459] Remove unused factories while I'm on it --- configCivcraft.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 222d801b..49506655 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -695,12 +695,6 @@ factories: - Craft_Droppers - Craft_Redstone_Lamps - Repair_Advanced_Factory - xpfactory: - type: FCCUPGRADE - name: Emerald Extractor - recipes: - - Repair_Expert_Factory - - Return_Materials basicpylon: type: FCCUPGRADE name: Basic Pylon @@ -728,12 +722,6 @@ factories: - Pack_Snow_To_Ice - Compress_Ice_To_Packed_Ice - Repair_Factory - dowsingfactory: - type: FCCUPGRADE - name: Dowsing Factory - recipes: - - Return_Materials - - Repair_Advanced_Factory ## Enchanting basicforge: type: FCCUPGRADE From 61028925dab2ea62823ca1f8f6142ec53444cbed Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 13 Jul 2016 23:05:17 +0200 Subject: [PATCH 411/459] Further fixes for reinforcement recipes --- configCivcraft.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 49506655..a5894efa 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,8 @@ factories: - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic - Burn_Charcoal_from_Logs_Basic + - Produce_basic_andesite_Miner_Component + - Produce_basic_sticky_Hunter_Component - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory @@ -11161,12 +11163,12 @@ recipes: Produce_basic_hunter_reinforcement: type: PRODUCTION production_time: 2s - amount: 4 name: Produce basic hunter reinforcement input: basicHunter: material: BONE name: Hunter Component + amount: 4 lore: - Basic Reinforcement Ingredient output: From f5db0f4342c97b78e93540747e985321fcf5b543 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 14 Jul 2016 00:39:22 +0200 Subject: [PATCH 412/459] Add reinforcement recipes (#273) * Add reinforcement recipes * Use plural for reinforcement factory names * Add fast basic recipes * Fix quantites for basic reinforcement component recipes * Add basic reinforcement recipes (not just components) and fix some mistakes * Remove unused factories while I'm on it * Further fixes for reinforcement recipes --- configCivcraft.yml | 576 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 564 insertions(+), 12 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 3177d9e7..a5894efa 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,8 @@ factories: - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic - Burn_Charcoal_from_Logs_Basic + - Produce_basic_andesite_Miner_Component + - Produce_basic_sticky_Hunter_Component - Repair_Rudimentary_Factory - Upgrade_to_Stone_Smelter - Upgrade_to_Farmstead_Factory @@ -42,7 +44,78 @@ factories: - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor - Upgrade_to_Basic_Forge + - Upgrade_to_Basic_Fortification + #Reinforcement factories + #Basic Contraption --> Basic Fortification + basicFortification: + type: FCCUPGRADE + name: Basic Fortifications + recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Upgrade_to_Intermediate_Fortification + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification + intermediateFortification: + type: FCCUPGRADE + name: Intermediate Fortifications + recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Produce_strong_Hunter_Component + - Produce_strong_Miner_Component + - Produce_good_reinforcement + - Produce_Bracers + - Upgrade_to_Advanced_Fortification + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification --> Advanced Fortification + advancedFortification: + type: FCCUPGRADE + name: Advanced Fortifications + recipes: + - Produce_basic_andesite_Miner_Component + - Produce_basic_diorite_Miner_Component + - Produce_basic_granite_Miner_Component + - Produce_basic_ink_splashed_Hunter_Component + - Produce_basic_mysterious_Hunter_Component + - Produce_basic_sticky_Hunter_Component + - Produce_basic_miner_reinforcement + - Produce_basic_hunter_reinforcement + - Produce_decent_solid_Miner_Component + - Produce_decent_shiny_Miner_Component + - Produce_decent_bouncy_Hunter_Component + - Produce_decent_heatresistant_Hunter_Component + - Produce_decent_reinforcement + - Produce_strong_Hunter_Component + - Produce_strong_Miner_Component + - Produce_good_reinforcement + - Produce_Bracers + - Produce_best_reinforcement + - Produce_good_instant_reinforcement + #Smelting stonesmelter: #Basic Contraption --> Stone Smelter @@ -624,12 +697,6 @@ factories: - Craft_Droppers - Craft_Redstone_Lamps - Repair_Advanced_Factory - xpfactory: - type: FCCUPGRADE - name: Emerald Extractor - recipes: - - Repair_Expert_Factory - - Return_Materials basicpylon: type: FCCUPGRADE name: Basic Pylon @@ -657,12 +724,6 @@ factories: - Pack_Snow_To_Ice - Compress_Ice_To_Packed_Ice - Repair_Factory - dowsingfactory: - type: FCCUPGRADE - name: Dowsing Factory - recipes: - - Return_Materials - - Repair_Advanced_Factory ## Enchanting basicforge: type: FCCUPGRADE @@ -10952,6 +11013,497 @@ recipes: item: material: JUKEBOX amount: 1 + +#Reinforcement recipes: + Produce_basic_granite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Granite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 1 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_andesite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Andesite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 5 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_diorite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Diorite Miner Component + input: + stone: + material: STONE + amount: 128 + granite: + material: STONE + amount: 64 + durability: 3 + coalore: + material: COAL_ORE + amount: 24 + output: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_ink_splashed_Hunter_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic ink splashed Hunter Component + input: + inksack: + material: INK_SACK + amount: 16 + bone: + material: BONE + amount: 24 + string: + material: STRING + amount: 32 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_sticky_Hunter_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic sticky Hunter Component + input: + inksack: + material: SPIDER_EYE + amount: 32 + bone: + material: ROTTEN_FLESH + amount: 64 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_mysterious_Hunter_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic mysterious Hunter Component + input: + inksack: + material: ENDER_PEARL + amount: 16 + bone: + material: ROTTEN_FLESH + amount: 32 + string: + material: STRING + amount: 32 + output: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + + Produce_basic_miner_reinforcement: + type: PRODUCTION + production_time: 2s + name: Produce basic miner reinforcement + input: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + amount: 4 + + output: + basicRein: + material: CLAY_BALL + amount: 64 + lore: + - Basic Reinforcement + + Produce_basic_hunter_reinforcement: + type: PRODUCTION + production_time: 2s + name: Produce basic hunter reinforcement + input: + basicHunter: + material: BONE + name: Hunter Component + amount: 4 + lore: + - Basic Reinforcement Ingredient + output: + basicRein: + material: CLAY_BALL + amount: 64 + lore: + - Basic Reinforcement + + Produce_decent_solid_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent solid Miner Component + input: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + amount: 8 + flint: + material: FLINT + amount: 24 + iron: + material: IRON_INGOT + amount: 48 + output: + decentMiner: + material: QUARTZ + name: Miner Component + lore: + - Decent Reinforcement Ingredient + + Produce_decent_shiny_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent shiny Miner Component + input: + basicHunter: + material: BONE + name: Hunter Component + lore: + - Basic Reinforcement Ingredient + amount: 8 + redstone: + material: REDSTONE + amount: 24 + gold: + material: GOLD_INGOT + amount: 32 + output: + decentMiner: + material: QUARTZ + name: Miner Component + lore: + - Decent Reinforcement Ingredient + + Produce_decent_bouncy_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent bouncy Hunter Component + input: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + amount: 8 + slime: + material: SLIME_BALL + amount: 32 + blazeRod: + material: BLAZE_ROD + amount: 24 + output: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + + Produce_decent_heatresistant_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce decent heatresistant Hunter Component + input: + basicMiner: + material: FLINT + name: Miner Component + lore: + - Basic Reinforcement Ingredient + amount: 8 + magmaCream: + material: MAGMA_CREAM + amount: 24 + gunpowder: + material: SULPHUR + amount: 32 + output: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + + Produce_decent_reinforcement: + type: PRODUCTION + production_time: 5s + name: Produce decent reinforcement + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: + - Decent Reinforcement Ingredient + amount: 4 + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + amount: 4 + output: + slimeball: + material: SLIME_BALL + amount: 64 + lore: + - Decent Reinforcement + + Produce_strong_Hunter_Component: + type: PRODUCTION + production_time: 4s + name: Produce strong Hunter Component + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: + - Decent Reinforcement Ingredient + amount: 6 + ghastTear: + material: GHAST_TEAR + amount: 16 + witherskull: + material: SKULL_ITEM + durability: 1 + output: + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 1 + + Produce_strong_Miner_Component: + type: PRODUCTION + production_time: 4s + name: Produce strong Miner Component + input: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + amount: 6 + diamond: + material: DIAMOND + amount: 32 + lapis: + material: INK_SACK + durability: 4 + amount: 32 + output: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 1 + + Produce_good_reinforcement: + type: PRODUCTION + production_time: 10s + name: Produce good reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 4 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 4 + output: + goodReinforcement: + material: MAGMA_CREAM + amount: 64 + lore: + - Good Reinforcement + + Produce_Bracers: + type: PRODUCTION + production_time: 5s + name: Produce Bracers + input: + stone: + material: STONE + durability: -1 + amount: 64 + sand: + material: SAND + durability: -1 + amount: 64 + gravel: + material: GRAVEL + amount: 64 + output: + bracers: + material: NETHER_BRICK_ITEM + lore: + - Structure Bracing + amount: 64 + + Produce_best_reinforcement: + type: PRODUCTION + production_time: 15s + name: Produce best reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 6 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 6 + xp: + material: EMERALD_BLOCK + amount: 18 + output: + bestRein: + material: QUARTZ + lore: + - Best Reinforcement + amount: 32 + + Produce_good_instant_reinforcement: + type: PRODUCTION + production_time: 15s + name: Produce good instant reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 6 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 6 + xp: + material: EMERALD_BLOCK + amount: 12 + output: + goodInstantRein: + material: FIREWORK_CHARGE + lore: + - Rapid Reinforcement + amount: 32 + + Upgrade_to_Basic_Fortification: + production_time: 5m + type: UPGRADE + name: Upgrade to Basic Fortification + factory: Basic Fortifications + fuel_consumption_intervall: 10s + input: + basicMiner: + material: FLINT + name: Miner Component + lore: Basic Reinforcement Ingredient + amount: 8 + basicHunter: + material: BONE + name: Hunter Component + lore: Basic Reinforcement Ingredient + amount: 8 + + Upgrade_to_Intermediate_Fortification: + production_time: 1h + type: UPGRADE + name: Upgrade to Intermediate Fortification + factory: Intermediate Fortifications + fuel_consumption_intervall: 1m + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: Decent Reinforcement Ingredient + amount: 8 + decentHunter: + material: SULPHUR + name: Hunter Component + lore: Decent Reinforcement Ingredient + amount: 8 + + Upgrade_to_Advanced_Fortification: + production_time: 12h + type: UPGRADE + name: Upgrade to Advanced Fortification + factory: Advanced Fortifications + fuel_consumption_intervall: 15m + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: Strong Reinforcement Ingredient + amount: 8 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: Strong Reinforcement Ingredient + amount: 8 + #Destroy factory and returns the setup cost multiplied by a given factor Return_Materials: From 9b0e7742e1b492a57d99e52e9fa65b171acc1362 Mon Sep 17 00:00:00 2001 From: Daniel Boston Date: Thu, 14 Jul 2016 01:59:25 -0400 Subject: [PATCH 413/459] Adding repair to all recipes, adjusting existing, matching agreed on balance spreadsheet --- configCivcraft.yml | 190 ++++++++++++++++++++++----------------------- 1 file changed, 91 insertions(+), 99 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a5894efa..40be6e87 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -66,6 +66,7 @@ factories: - Produce_decent_heatresistant_Hunter_Component - Produce_decent_reinforcement - Upgrade_to_Intermediate_Fortification + - Repair_Basic_Factory #Basic Contraption --> Basic Fortification --> Intermediate Fortification intermediateFortification: @@ -90,6 +91,7 @@ factories: - Produce_good_reinforcement - Produce_Bracers - Upgrade_to_Advanced_Fortification + - Repair_Advanced_Factory #Basic Contraption --> Basic Fortification --> Intermediate Fortification --> Advanced Fortification advancedFortification: @@ -115,6 +117,7 @@ factories: - Produce_Bracers - Produce_best_reinforcement - Produce_good_instant_reinforcement + - Repair_Expert_Factory #Smelting stonesmelter: @@ -180,7 +183,7 @@ factories: - Smelt_Sandstone_Basic - Smelt_Red_Sandstone_Basic - Convert_Normal_Sand_to_Red_Sand - - Repair_Small_Factory + - Repair_Basic_Factory - Upgrade_to_Glass_Blowing_Workshop - Upgrade_to_Sandstone_Smelter - Upgrade_to_Glass_Dying_Factory @@ -261,7 +264,7 @@ factories: - Craft_Stonebricks_Basic - Craft_Prismarine_Basic - Craft_Netherbrick_Basic - - Repair_Small_Factory + - Repair_Basic_Factory - Upgrade_to_Stonebrick_Smelter - Upgrade_to_Netherbrick_Smelter - Upgrade_to_Aquatic_Brick_Smelter @@ -356,7 +359,7 @@ factories: - Craft_any_type_of_wooden_slab - Craft_any_type_of_wooden_door - Cut_any_type_of_Plank_Expert - - Repair_Small_Factory + - Repair_Basic_Factory - Create_Crate finewoodworking: type: FCCUPGRADE @@ -366,7 +369,7 @@ factories: - Craft_any_type_of_fence_gate - Craft_ladder - Craft_trap_door - - Repair_Small_Factory + - Repair_Basic_Factory coalburner: type: FCCUPGRADE name: Coal Burner @@ -374,7 +377,7 @@ factories: - Burn_Charcoal_from_Logs_Expert - Burn_Charcoal_from_Logs2_Expert - Burn_Charcoal_from_Coal - - Repair_Small_Factory + - Repair_Basic_Factory farmsteadfactory: type: FCCUPGRADE name: Farmstead Factory @@ -412,7 +415,7 @@ factories: - Cook_Fish - Cook_Mutton - Cook_Rabbit - - Repair_Small_Factory + - Repair_Factory stewmaker: type: FCCUPGRADE name: Soup kitchen @@ -448,7 +451,7 @@ factories: - Dye_Wool_Green - Dye_Wool_Red - Dye_Wool_Black - - Repair_Factory + - Repair_Basic_Factory biolab: type: FCCUPGRADE name: Bio Lab @@ -457,7 +460,7 @@ factories: - Mutate_Tall_Grass_Basic - Take_friendly_mob_egg_apart_Basic - Create_Podzol_Basic - - Repair_Small_Factory + - Repair_Basic_Factory - Upgrade_to_Grass_Gardening - Upgrade_to_Flower_Gardening - Upgrade_to_Tree_Mutator @@ -473,13 +476,13 @@ factories: - Grow_Fern - Grow_Vine - Kill_Dead_Shrub - - Repair_Factory + - Repair_Basic_Factory flowergardening: type: FCCUPGRADE name: Flower Gardening recipes: - Grow_random_flower - - Repair_Factory + - Repair_Basic_Factory treemutator: type: FCCUPGRADE name: Tree Mutator @@ -487,7 +490,7 @@ factories: - Mutate_random_sapling - Mutate_random_leaves - Grow_Concentrate_Of_Nature - - Repair_Factory + - Repair_Basic_Factory organicblockfactory: type: FCCUPGRADE name: Organic Block Factory @@ -495,7 +498,7 @@ factories: - Create_Podzol_Advanced - Create_Coarse_Dirt - Create_Mycelium - - Repair_Factory + - Repair_Basic_Factory blacksmith: type: FCCUPGRADE name: Blacksmith @@ -505,7 +508,7 @@ factories: - Forge_Stone_Shovel - Forge_Stone_Hoe - Forge_Stone_Axe - - Repair_Small_Factory + - Repair_Rudimentary_Factory - Upgrade_to_Iron_Forge_Basic - Upgrade_to_Iron_Equipment_Forge ironforgebasic: @@ -623,7 +626,7 @@ factories: recipes: - Craft_Redstone_Repeater_Basic - Craft_Dispenser_Basic - - Repair_Small_Factory + - Repair_Rudimentary_Factory - Upgrade_to_Bastion_Factory - Upgrade_to_Compactor_Basic - Upgrade_to_Printing_Press @@ -646,7 +649,7 @@ factories: recipes: - Compact_Stack_Basic - De-compact_Stack_Basic - - Repair_Factory + - Repair_Basic_Factory - Upgrade_to_Dedicated_Compactor - Upgrade_to_Dedicated_De-Compactor dedicatedcompactor: @@ -655,13 +658,13 @@ factories: updatetime: 5t recipes: - Compact_Stack_Advanced - - Repair_Advanced_Factory + - Repair_Basic_Factory dedicateddecompactor: type: FCCUPGRADE name: Dedicated De-Compactor recipes: - De-compact_Stack_Advanced - - Repair_Advanced_Factory + - Repair_Basic_Factory redstonefactorybasic: type: FCCUPGRADE name: Redstone Techniques @@ -797,7 +800,7 @@ factories: - Enchant_Flame_I - Enchant_FireAspect_I - Enchant_FireAspect_II - - Repair_Factory + - Repair_Advanced_Factory #Water riverforge: type: FCCUPGRADE @@ -822,7 +825,7 @@ factories: - Enchant_Respiration_III - Enchant_Frost_Walker_I - Enchant_Frost_Walker_II - - Repair_Factory + - Repair_Advanced_Factory #Magic magicforge: type: FCCUPGRADE @@ -852,7 +855,7 @@ factories: - Enchant_BOA_III - Enchant_BOA_IV - Enchant_BOA_V - - Repair_Factory + - Repair_Advanced_Factory #Armor mithrilforge: type: FCCUPGRADE @@ -900,7 +903,7 @@ factories: - Enchant_Thorns_I - Enchant_Thorns_II - Upgrade_to_Meteor_Forge - - Repair_Factory + - Repair_Advanced_Factory Meteorforge: type: FCCUPGRADE name: Meteor Forge @@ -940,7 +943,7 @@ factories: - Enchant_Thorns_I - Enchant_Thorns_II - Enchant_Thorns_III - - Repair_Factory + - Repair_Expert_Factory #Archery archerforge: type: FCCUPGRADE @@ -976,7 +979,7 @@ factories: - Enchant_Boots_ProjectileProtection_III - Enchant_Punch_I - Upgrade_to_Sniper_Forge - - Repair_Factory + - Repair_Advanced_Factory sniperforge: type: FCCUPGRADE name: Sniper Forge @@ -1004,7 +1007,7 @@ factories: - Enchant_Boots_ProjectileProtection_IV - Enchant_Punch_I - Enchant_Punch_II - - Repair_Factory + - Repair_Expert_Factory #Swords daggerforge: type: FCCUPGRADE @@ -1030,7 +1033,7 @@ factories: - Enchant_Smite_IV - Enchant_Knockback_I - Upgrade_to_Blade_Forge - - Repair_Factory + - Repair_Advanced_Factory bladeforge: type: FCCUPGRADE name: Blade Forge @@ -1047,7 +1050,7 @@ factories: - Enchant_Smite_V - Enchant_Knockback_I - Enchant_Knockback_II - - Repair_Factory + - Repair_Expert_Factory #Efficiency quickforge: type: FCCUPGRADE @@ -1078,7 +1081,7 @@ factories: - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Upgrade_to_Sonic_Forge - - Repair_Factory + - Repair_Advanced_Factory sonicforge: type: FCCUPGRADE name: Sonic Forge @@ -1098,7 +1101,7 @@ factories: - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Enchant_Shovel_Efficiency_V - - Repair_Factory + - Repair_Expert_Factory #Unbreaking rockforge: type: FCCUPGRADE @@ -1141,7 +1144,7 @@ factories: - Enchant_Bow_Unbreaking_I - Enchant_Bow_Unbreaking_II - Upgrade_to_Carbon_Forge - - Repair_Factory + - Repair_Advanced_Factory carbonforge: type: FCCUPGRADE name: Carbon Forge @@ -1176,7 +1179,7 @@ factories: - Enchant_Bow_Unbreaking_I - Enchant_Bow_Unbreaking_II - Enchant_Bow_Unbreaking_III - - Repair_Factory + - Repair_Expert_Factory ## XP Production apprenticetransmuter: @@ -1199,7 +1202,7 @@ factories: - Copper_Enrichment - Tin_Enrichment - Upgrade_to_Grandmaster_Transmuter - - Repair_Factory + - Repair_Advanced_Factory grandmastertransmuter: type: FCCUPGRADE name: Grandmaster Transmuter @@ -1213,7 +1216,7 @@ factories: - Amethyst_Enrichment - Topaz_Enrichment - Ruby_Enrichment - - Repair_Factory + - Repair_Expert_Factory #Pipes @@ -1267,92 +1270,81 @@ factories: maximum_materials_per_side: 10 recipes: - +# lvl 1 Repair_Rudimentary_Factory: type: REPAIR name: Repair Factory - production_time: 60s + production_time: 30s input: -# eye of ender: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY -# amount: 1 - emerald: - material: DIRT - amount: 1 - health_gained: 1500 - Repair_Small_Factory: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 35 + health_gained: 3334 +# lvl 2 + Repair_Basic_Factory: type: REPAIR name: Repair Factory - production_time: 30s + production_time: 40s input: -# eye of ender: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY -# amount: 1 - emerald: - material: DIRT - amount: 3 - health_gained: 800 + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 53 + health_gained: 3334 +# lvl 3 Repair_Factory: type: REPAIR name: Repair Factory - production_time: 30s + production_time: 50s input: -# eye of ender: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY -# amount: 1 - emeraldblock: - material: DIRT - amount: 1 - health_gained: 350 + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 70 + health_gained: 3334 +# lvl 4 Repair_Advanced_Factory: type: REPAIR name: Repair Advanced Factory - production_time: 15s + production_time: 60s input: -# eye of ender: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY -# amount: 1 - emeraldblock: - material: DIRT - amount: 3 - health_gained: 225 + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 140 + health_gained: 3334 +# lvl 5 Repair_Expert_Factory: type: REPAIR name: Repair Expert Factory - production_time: 10s + production_time: 90s input: -# eye of ender: -# material: EYE_OF_ENDER -# lore: -# - Essence -# enchants: -# dura: -# enchant: DURABILITY -# amount: 1 - emeraldblock: - material: DIRT - amount: 5 - health_gained: 65 + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 210 + health_gained: 3334 Bake_Bread_Advanced: type: PRODUCTION name: Bake Bread From 6c0f7fdafceded902526ea16b989cb0f0644da9e Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 14 Jul 2016 19:45:12 +0200 Subject: [PATCH 414/459] Fix lore for reinforcement factory upgrades and remove dowsing factory upgrade recipe --- configCivcraft.yml | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index a5894efa..40dcc4f4 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -673,7 +673,6 @@ factories: - Repair_Factory - Upgrade_to_Redstone_Circularity_Factory - Upgrade_to_Redstone_Mechanics_Factory - - Upgrade_to_Dowsing_Factory redstonecircularityfactory: type: FCCUPGRADE name: Redstone Electronics @@ -5428,22 +5427,6 @@ recipes: durability: 1 lore: - Compacted Item - Upgrade_to_Dowsing_Factory: - type: UPGRADE - name: Upgrade to Dowsing Factory - production_time: 8h - fuel_consumption_intervall: 5m - factory: Dowsing Factory - input: - redstoneblocks: - material: REDSTONE_BLOCK - amount: 64 - compass: - material: COMPASS - amount: 1 - xp: - material: EMERALD_BLOCK - amount: 128 #Pylon recipes Pylon_Basic: @@ -11460,12 +11443,14 @@ recipes: basicMiner: material: FLINT name: Miner Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 basicHunter: material: BONE name: Hunter Component - lore: Basic Reinforcement Ingredient + lore: + - Basic Reinforcement Ingredient amount: 8 Upgrade_to_Intermediate_Fortification: @@ -11478,12 +11463,14 @@ recipes: decentMiner: material: QUARTZ name: Miner Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 8 decentHunter: material: SULPHUR name: Hunter Component - lore: Decent Reinforcement Ingredient + lore: + - Decent Reinforcement Ingredient amount: 8 Upgrade_to_Advanced_Fortification: @@ -11496,12 +11483,14 @@ recipes: strongMiner: material: PRISMARINE name: Miner Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 8 strongHunter: material: GHAST_TEAR name: Hunter Component - lore: Strong Reinforcement Ingredient + lore: + - Strong Reinforcement Ingredient amount: 8 From c19e252a9adfbd432ec13d1e907f6437c5c92b08 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 25 Jul 2016 22:45:24 +0200 Subject: [PATCH 415/459] Fix book material for fossil output enchanted books --- configCivcraft.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 49562cf7..2cc1d141 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -10126,7 +10126,7 @@ recipes: godbook1: chance: 0.00120909 power5book: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: power5: @@ -10135,7 +10135,7 @@ recipes: godbook2: chance: 0.00120909 infinity: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: infinity: @@ -10144,7 +10144,7 @@ recipes: godbook3: chance: 0.00120909 eff5: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: eff5: @@ -10153,7 +10153,7 @@ recipes: godbook4: chance: 0.00120909 ub3: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: ub3: @@ -10162,7 +10162,7 @@ recipes: godbook5: chance: 0.00120909 sharpness5: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: sharpness5: @@ -10171,7 +10171,7 @@ recipes: godbook6: chance: 0.00110909 protection4: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: protection4: @@ -10180,7 +10180,7 @@ recipes: godbook7: chance: 0.00120909 silktouch: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: silktouch: @@ -10594,7 +10594,7 @@ recipes: godbook1: chance: 0.00120909 power5book: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: power5: @@ -10603,7 +10603,7 @@ recipes: godbook2: chance: 0.00120909 infinity: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: infinity: @@ -10612,7 +10612,7 @@ recipes: godbook3: chance: 0.00120909 eff5: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: eff5: @@ -10621,7 +10621,7 @@ recipes: godbook4: chance: 0.00120909 ub3: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: ub3: @@ -10630,7 +10630,7 @@ recipes: godbook5: chance: 0.00120909 sharpness5: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: sharpness5: @@ -10639,7 +10639,7 @@ recipes: godbook6: chance: 0.00110909 protection4: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: protection4: @@ -10648,7 +10648,7 @@ recipes: godbook7: chance: 0.00120909 silktouch: - material: BOOK + material: ENCHANTED_BOOK amount: 1 stored_enchants: silktouch: From 67760c12fc95a0869c4b2498b39f6202e9aa9a5a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 27 Jul 2016 22:28:23 +0200 Subject: [PATCH 416/459] Dynamically adjust size of recipe selection to fix issues with not all recipes properly showing in factories with many recipes --- .../FurnCraftChestInteractionManager.java | 434 +++++++++--------- 1 file changed, 223 insertions(+), 211 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index afee48c0..5a5c14ec 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -31,241 +31,253 @@ import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; public class FurnCraftChestInteractionManager implements IInteractionManager { - private FurnCraftChestFactory fccf; - private HashMap recipes = new HashMap(); + private FurnCraftChestFactory fccf; + private HashMap recipes = new HashMap(); - public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { - this.fccf = fccf; - } + public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { + this.fccf = fccf; + } - public FurnCraftChestInteractionManager() { + public FurnCraftChestInteractionManager() { - } + } - public void setFactory(FurnCraftChestFactory fccf) { - this.fccf = fccf; - } + public void setFactory(FurnCraftChestFactory fccf) { + this.fccf = fccf; + } - public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { - ReinforcementManager rm = FactoryMod.getManager().isCitadelEnabled() ? Citadel - .getReinforcementManager() : null; - int threshold = FactoryMod.getManager().getRedstonePowerOn(); - if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { - if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold - && fccf.isActive()) { - if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e - .getBlock()))) { - fccf.deactivate(); - } - } else if (e.getOldCurrent() < threshold - && e.getNewCurrent() >= threshold && !fccf.isActive()) { - if (rm == null - || MultiBlockStructure.citadelRedstoneChecks(e - .getBlock())) { - fccf.attemptToActivate(null); - } - } else { - return; - } + public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { + ReinforcementManager rm = FactoryMod.getManager().isCitadelEnabled() ? Citadel + .getReinforcementManager() : null; + int threshold = FactoryMod.getManager().getRedstonePowerOn(); + if (factoryBlock.getLocation().equals(fccf.getFurnace().getLocation())) { + if (e.getOldCurrent() >= threshold && e.getNewCurrent() < threshold + && fccf.isActive()) { + if ((rm == null || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock()))) { + fccf.deactivate(); + } + } else if (e.getOldCurrent() < threshold + && e.getNewCurrent() >= threshold && !fccf.isActive()) { + if (rm == null + || MultiBlockStructure.citadelRedstoneChecks(e + .getBlock())) { + fccf.attemptToActivate(null); } + } else { + return; + } } + } - public void blockBreak(Player p, Block b) { - if (p != null && !fccf.getRepairManager().inDisrepair()) { - p.sendMessage(ChatColor.DARK_RED - + "You broke the factory, it is in disrepair now"); - FactoryMod.sendResponse("FactoryBreak", p); - } - if (fccf.isActive()) { - fccf.deactivate(); - } - fccf.getRepairManager().breakIt(); + public void blockBreak(Player p, Block b) { + if (p != null && !fccf.getRepairManager().inDisrepair()) { + p.sendMessage(ChatColor.DARK_RED + + "You broke the factory, it is in disrepair now"); + FactoryMod.sendResponse("FactoryBreak", p); + } + if (fccf.isActive()) { + fccf.deactivate(); } + fccf.getRepairManager().breakIt(); + } - public void leftClick(Player p, Block b, BlockFace bf) { - if (p.getItemInHand().getType() != FactoryMod.getManager() - .getFactoryInteractionMaterial()) { - return; + public void leftClick(Player p, Block b, BlockFace bf) { + if (p.getItemInHand().getType() != FactoryMod.getManager() + .getFactoryInteractionMaterial()) { + return; + } + if (FactoryMod.getManager().isCitadelEnabled()) { + ReinforcementManager rm = Citadel.getReinforcementManager(); + // is this cast safe? Let's just assume yes for now + PlayerReinforcement rein = (PlayerReinforcement) rm + .getReinforcement(b); + if (rein != null) { + Group g = rein.getGroup(); + if (!NameAPI.getGroupManager().hasAccess(g.getName(), + p.getUniqueId(), + PermissionType.getPermission("USE_FACTORY"))) { + p.sendMessage(ChatColor.RED + + "You dont have permission to interact with this factory"); + FactoryMod.sendResponse("FactoryNoPermission", p); + return; } - if (FactoryMod.getManager().isCitadelEnabled()) { - ReinforcementManager rm = Citadel.getReinforcementManager(); - // is this cast safe? Let's just assume yes for now - PlayerReinforcement rein = (PlayerReinforcement) rm - .getReinforcement(b); - if (rein != null) { - Group g = rein.getGroup(); - if (!NameAPI.getGroupManager().hasAccess(g.getName(), p.getUniqueId(), PermissionType.getPermission("USE_FACTORY"))) { - p.sendMessage(ChatColor.RED - + "You dont have permission to interact with this factory"); - FactoryMod.sendResponse("FactoryNoPermission", p); - return; - } - } + } + } + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getChest())) { // chest interaction + if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff + ClickableInventory ci = new ClickableInventory(54, fccf + .getCurrentRecipe().getRecipeName()); + int index = 4; + List inp = ((InputRecipe) fccf.getCurrentRecipe()) + .getInputRepresentation(fccf.getInventory()); + if (inp.size() > 18) { + inp = new ItemMap(inp).getLoredItemCountRepresentation(); } - if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getChest())) { // chest interaction - if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff - ClickableInventory ci = new ClickableInventory(54, fccf - .getCurrentRecipe().getRecipeName()); - int index = 4; - List inp = ((InputRecipe) fccf.getCurrentRecipe()) - .getInputRepresentation(fccf.getInventory()); - if (inp.size() > 18) { - inp = new ItemMap(inp).getLoredItemCountRepresentation(); - } - for (ItemStack is : inp) { - Clickable c = new Clickable(is) { - @Override - public void clicked(Player arg0) { - // nothing, just supposed to look nice - } - }; - ci.setSlot(c, index); - // weird math to fill up the gui nicely - if ((index % 9) == 4) { - index++; - continue; - } - if ((index % 9) > 4) { - index -= (((index % 9) - 4) * 2); - } else { - if ((index % 9) == 0) { - index += 13; - } else { - index += (((4 - (index % 9)) * 2) + 1); - } - } - - } - index = 49; - List outp = ((InputRecipe) fccf.getCurrentRecipe()) - .getOutputRepresentation(fccf.getInventory()); - if (outp.size() > 18) { - outp = new ItemMap(outp).getLoredItemCountRepresentation(); - } - for (ItemStack is : outp) { - Clickable c = new Clickable(is) { - @Override - public void clicked(Player arg0) { - // nothing, just supposed to look nice - } - }; - ci.setSlot(c, index); - if ((index % 9) == 4) { - index++; - continue; - } - if ((index % 9) > 4) { - index -= (((index % 9) - 4) * 2); - } else { - if ((index % 9) == 0) { - index -= 13; - } else { - index += (((4 - (index % 9)) * 2) + 1); - } - } - - } - ci.showInventory(p); + for (ItemStack is : inp) { + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + // nothing, just supposed to look nice + } + }; + ci.setSlot(c, index); + // weird math to fill up the gui nicely + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index += 13; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } - } else { // not sneaking, so just a short sumup - p.sendMessage(ChatColor.GOLD + fccf.getName() - + " currently turned " - + (fccf.isActive() ? "on" : "off")); - if (fccf.isActive()) { - p.sendMessage(ChatColor.GOLD - + String.valueOf((fccf.getCurrentRecipe() - .getProductionTime() - fccf - .getRunningTime()) / 20) - + " seconds remaining until current run is complete"); - } - p.sendMessage(ChatColor.GOLD + "Currently selected recipe: " - + fccf.getCurrentRecipe().getRecipeName()); - p.sendMessage(ChatColor.GOLD + "Currently at " - + fccf.getRepairManager().getHealth() + " health"); - if (fccf.getRepairManager().inDisrepair()) { - long breaktime = ((PercentageHealthRepairManager) fccf - .getRepairManager()).getBreakTime(); - long leftTime = FactoryMod.getManager() - .getNoHealthGracePeriod() - - (System.currentTimeMillis() - breaktime); - long months = leftTime % (60 * 60 * 24 * 30 * 1000); - long days = leftTime - (months * 60 * 60 * 24 * 30 * 1000) - % (60 * 60 * 24 * 1000); - long hours = leftTime - (months * 60 * 60 * 24 * 30 * 1000) - - (days * 60 * 60 * 24 * 1000) % (60 * 60 * 1000); - String time = (months != 0 ? months + " months, " : "") - + (days != 0 ? days + " days, " : "") - + (hours != 0 ? hours + " hours" : ""); - //p.sendMessage(ChatColor.GOLD + "It will break in " + time); - //TODO FIX THIS - } + } + index = 49; + List outp = ((InputRecipe) fccf.getCurrentRecipe()) + .getOutputRepresentation(fccf.getInventory()); + if (outp.size() > 18) { + outp = new ItemMap(outp).getLoredItemCountRepresentation(); + } + for (ItemStack is : outp) { + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + // nothing, just supposed to look nice } + }; + ci.setSlot(c, index); + if ((index % 9) == 4) { + index++; + continue; + } + if ((index % 9) > 4) { + index -= (((index % 9) - 4) * 2); + } else { + if ((index % 9) == 0) { + index -= 13; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } - return; } - if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) - .getCraftingTable())) { // crafting table interaction - ClickableInventory ci = new ClickableInventory(36, - "Select a recipe"); - for (IRecipe rec : fccf.getRecipes()) { - InputRecipe recipe = (InputRecipe) (rec); - ItemStack recStack = recipe.getRecipeRepresentation(); - ISUtils.addLore( - recStack, - ChatColor.GOLD + "Ran " - + String.valueOf(fccf.getRunCount(recipe)) - + " times"); - Clickable c = new Clickable(recStack) { + ci.showInventory(p); - @Override - public void clicked(Player p) { - if (fccf.isActive()) { - p.sendMessage(ChatColor.RED - + "You can't switch recipes while the factory is running"); - } else { - fccf.setRecipe(recipes.get(this)); - p.sendMessage(ChatColor.GREEN - + "Switched recipe to " - + recipes.get(this).getRecipeName()); - FactoryMod.sendResponse("RecipeSwitch", p); - } + } else { // not sneaking, so just a short sumup + p.sendMessage(ChatColor.GOLD + fccf.getName() + + " currently turned " + + (fccf.isActive() ? "on" : "off")); + if (fccf.isActive()) { + p.sendMessage(ChatColor.GOLD + + String.valueOf((fccf.getCurrentRecipe() + .getProductionTime() - fccf + .getRunningTime()) / 20) + + " seconds remaining until current run is complete"); + } + p.sendMessage(ChatColor.GOLD + "Currently selected recipe: " + + fccf.getCurrentRecipe().getRecipeName()); + p.sendMessage(ChatColor.GOLD + "Currently at " + + fccf.getRepairManager().getHealth() + " health"); + if (fccf.getRepairManager().inDisrepair()) { + long breaktime = ((PercentageHealthRepairManager) fccf + .getRepairManager()).getBreakTime(); + long leftTime = FactoryMod.getManager() + .getNoHealthGracePeriod() + - (System.currentTimeMillis() - breaktime); + long months = leftTime % (60 * 60 * 24 * 30 * 1000); + long days = leftTime - (months * 60 * 60 * 24 * 30 * 1000) + % (60 * 60 * 24 * 1000); + long hours = leftTime - (months * 60 * 60 * 24 * 30 * 1000) + - (days * 60 * 60 * 24 * 1000) % (60 * 60 * 1000); + String time = (months != 0 ? months + " months, " : "") + + (days != 0 ? days + " days, " : "") + + (hours != 0 ? hours + " hours" : ""); + // p.sendMessage(ChatColor.GOLD + "It will break in " + + // time); + // TODO FIX THIS + } + } - } - }; - recipes.put(c, recipe); - ci.addSlot(c); - } - ItemStack menuStack = new ItemStack(Material.PAINTING); - ISUtils.setName(menuStack, "Open menu"); - ISUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE - + "Click to open a detailed menu"); - Clickable menuC = new Clickable(menuStack) { - @Override - public void clicked(Player arg0) { - FactoryMod.getMenuBuilder().openFactoryBrowser(arg0, fccf.getName()); - } - }; - ci.setSlot(menuC, 35); + return; + } + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getCraftingTable())) { // crafting table interaction + int rows = (fccf.getRecipes().size() / 9) + 1; + if (fccf.getRecipes().size() > 53 || rows > 6) { + p.sendMessage(ChatColor.RED + + "This factory has more than 53 recipes and the GUI for it can't be opened. Either complain to " + + "your admin to have them put less recipes in this factory or complain to /u/maxopoly to add " + + "scrollviews to this"); + return; + } + ClickableInventory ci = new ClickableInventory(rows * 9, + "Select a recipe"); + for (IRecipe rec : fccf.getRecipes()) { + InputRecipe recipe = (InputRecipe) (rec); + ItemStack recStack = recipe.getRecipeRepresentation(); + ISUtils.addLore( + recStack, + ChatColor.GOLD + "Ran " + + String.valueOf(fccf.getRunCount(recipe)) + + " times"); + Clickable c = new Clickable(recStack) { - ci.showInventory(p); - return; - } - if (b.equals(fccf.getFurnace())) { // furnace interaction + @Override + public void clicked(Player p) { if (fccf.isActive()) { - fccf.deactivate(); - p.sendMessage(ChatColor.RED + "Deactivated " + fccf.getName()); - FactoryMod.sendResponse("FactoryActivation", p); + p.sendMessage(ChatColor.RED + + "You can't switch recipes while the factory is running"); } else { - fccf.attemptToActivate(p); - FactoryMod.sendResponse("FactoryDeactivation", p); + fccf.setRecipe(recipes.get(this)); + p.sendMessage(ChatColor.GREEN + + "Switched recipe to " + + recipes.get(this).getRecipeName()); + FactoryMod.sendResponse("RecipeSwitch", p); } + + } + }; + recipes.put(c, recipe); + ci.addSlot(c); + } + ItemStack menuStack = new ItemStack(Material.PAINTING); + ISUtils.setName(menuStack, "Open menu"); + ISUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE + + "Click to open a detailed menu"); + Clickable menuC = new Clickable(menuStack) { + @Override + public void clicked(Player arg0) { + FactoryMod.getMenuBuilder().openFactoryBrowser(arg0, + fccf.getName()); } - } + }; + ci.setSlot(menuC, (rows * 9) - 1); - public void rightClick(Player p, Block b, BlockFace bf) { - // Nothing to do here, every block already has a right click - // functionality + ci.showInventory(p); + return; } + if (b.equals(fccf.getFurnace())) { // furnace interaction + if (fccf.isActive()) { + fccf.deactivate(); + p.sendMessage(ChatColor.RED + "Deactivated " + fccf.getName()); + FactoryMod.sendResponse("FactoryActivation", p); + } else { + fccf.attemptToActivate(p); + FactoryMod.sendResponse("FactoryDeactivation", p); + } + } + } + + public void rightClick(Player p, Block b, BlockFace bf) { + // Nothing to do here, every block already has a right click + // functionality + } } From 56eb5149f85451601005bafada5aa279d7b53e9a Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Thu, 4 Aug 2016 15:24:50 +0100 Subject: [PATCH 417/459] Added Basic/Advanced Charcoal burn for Acacia/Dark Oak (#278) Correcting Mojang's silly decisions. --- configCivcraft.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index 2cc1d141..23564980 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -35,6 +35,7 @@ factories: - Cut_any_type_of_Plank_Basic - Bake_Bread_Basic - Burn_Charcoal_from_Logs_Basic + - Burn_Charcoal_from_Logs2_Basic - Produce_basic_andesite_Miner_Component - Produce_basic_sticky_Hunter_Component - Repair_Rudimentary_Factory @@ -343,6 +344,7 @@ factories: name: Wood Processor recipes: - Burn_Charcoal_from_Logs_Advanced + - Burn_Charcoal_from_Logs2_Advanced - Craft_Oak_Fence - Cut_any_type_of_Plank_Advanced - Repair_Rudimentary_Factory @@ -1477,6 +1479,20 @@ recipes: material: COAL amount: 80 durability: 1 + Burn_Charcoal_from_Logs2_Basic: + type: PRODUCTION + name: Burn Charcoal from Acacia or Dark Oak + production_time: 16s + input: + log: + material: LOG_2 + durability: -1 + amount: 64 + output: + charcoal: + material: COAL + amount: 80 + durability: 1 Burn_Charcoal_from_Logs_Advanced: type: PRODUCTION name: Burn Charcoal from Logs @@ -1491,6 +1507,20 @@ recipes: material: COAL amount: 192 durability: 1 + Burn_Charcoal_from_Logs2_Advanced: + type: PRODUCTION + name: Burn Charcoal from Acacia or Dark Oak + production_time: 28s + input: + log: + material: LOG_2 + durability: -1 + amount: 128 + output: + charcoal: + material: COAL + amount: 192 + durability: 1 Burn_Charcoal_from_Logs_Expert: type: PRODUCTION name: Burn Charcoal from Normal Logs From 638e8d3372ba5d0557338de0a6efe26fa583998a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 7 Aug 2016 05:55:00 +0200 Subject: [PATCH 418/459] Small QOL fixes --- configCivcraft.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 23564980..315958f7 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1740,24 +1740,24 @@ recipes: production_time: 5s input: iron block: - material: IRON_BLOCK - amount: 4 + material: IRON_INGOT + amount: 18 output: bucket: material: BUCKET - amount: 16 + amount: 10 Craft_Buckets_Basic: type: PRODUCTION name: Craft Buckets production_time: 5s input: iron block: - material: IRON_BLOCK - amount: 5 + material: IRON_INGOT + amount: 24 output: bucket: material: BUCKET - amount: 16 + amount: 10 Craft_Chiselled_Quartz_Blocks: type: PRODUCTION name: Craft Chiselled Quartz Blocks @@ -2200,10 +2200,10 @@ recipes: input: iron ingot: material: IRON_INGOT - amount: 32 + amount: 30 stick: material: STICK - amount: 4 + amount: 5 output: rail: material: RAILS @@ -2805,6 +2805,9 @@ recipes: iron ingot: material: IRON_INGOT amount: 32 + sticks: + material: STICK + amount: 5 output: rail: material: RAILS @@ -10188,7 +10191,7 @@ recipes: stored_enchants: ub3: enchant: DURABILITY - level: 4 + level: 3 godbook5: chance: 0.00120909 sharpness5: @@ -10473,7 +10476,7 @@ recipes: chance: 0.026176 item: material: RECORD_10 - amount: 64 + amount: 1 mid21: chance: 0.026176 item: @@ -10656,7 +10659,7 @@ recipes: stored_enchants: ub3: enchant: DURABILITY - level: 4 + level: 3 godbook5: chance: 0.00120909 sharpness5: @@ -10941,7 +10944,7 @@ recipes: chance: 0.026176 item: material: RECORD_10 - amount: 64 + amount: 1 mid21: chance: 0.026176 item: From 565fdf0038493bcc5d44de1fc363bbe7f9e040ef Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 7 Aug 2016 17:50:07 +0200 Subject: [PATCH 419/459] Small QOL fixes (#281) --- configCivcraft.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 23564980..315958f7 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -1740,24 +1740,24 @@ recipes: production_time: 5s input: iron block: - material: IRON_BLOCK - amount: 4 + material: IRON_INGOT + amount: 18 output: bucket: material: BUCKET - amount: 16 + amount: 10 Craft_Buckets_Basic: type: PRODUCTION name: Craft Buckets production_time: 5s input: iron block: - material: IRON_BLOCK - amount: 5 + material: IRON_INGOT + amount: 24 output: bucket: material: BUCKET - amount: 16 + amount: 10 Craft_Chiselled_Quartz_Blocks: type: PRODUCTION name: Craft Chiselled Quartz Blocks @@ -2200,10 +2200,10 @@ recipes: input: iron ingot: material: IRON_INGOT - amount: 32 + amount: 30 stick: material: STICK - amount: 4 + amount: 5 output: rail: material: RAILS @@ -2805,6 +2805,9 @@ recipes: iron ingot: material: IRON_INGOT amount: 32 + sticks: + material: STICK + amount: 5 output: rail: material: RAILS @@ -10188,7 +10191,7 @@ recipes: stored_enchants: ub3: enchant: DURABILITY - level: 4 + level: 3 godbook5: chance: 0.00120909 sharpness5: @@ -10473,7 +10476,7 @@ recipes: chance: 0.026176 item: material: RECORD_10 - amount: 64 + amount: 1 mid21: chance: 0.026176 item: @@ -10656,7 +10659,7 @@ recipes: stored_enchants: ub3: enchant: DURABILITY - level: 4 + level: 3 godbook5: chance: 0.00120909 sharpness5: @@ -10941,7 +10944,7 @@ recipes: chance: 0.026176 item: material: RECORD_10 - amount: 64 + amount: 1 mid21: chance: 0.026176 item: From 12cc6eeee908ff0d61411c7438a02357dd52a577 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 7 Aug 2016 20:32:41 +0200 Subject: [PATCH 420/459] Make health, damage taken per decay intervall and 0% grace period configurable for each factory --- config.yml | 49 +++++------- .../igotyou/FactoryMod/ConfigParser.java | 77 ++++++++---------- .../igotyou/FactoryMod/FactoryModManager.java | 15 +--- .../FactoryMod/eggs/FurnCraftChestEgg.java | 28 +++++-- .../factories/FurnCraftChestFactory.java | 6 +- .../FurnCraftChestInteractionManager.java | 14 ++-- .../FactoryMod/recipes/Upgraderecipe.java | 3 +- .../PercentageHealthRepairManager.java | 79 ++++++++++--------- .../utility/FactoryGarbageCollector.java | 9 +-- .../FactoryMod/utility/FileHandler.java | 6 +- 10 files changed, 133 insertions(+), 153 deletions(-) diff --git a/config.yml b/config.yml index bc3a6910..526f3ba0 100644 --- a/config.yml +++ b/config.yml @@ -128,31 +128,6 @@ #This section allows you to define global default values and some general stuff. -#First of all under the crafting option you can disable existing -#vanilla crafting recipes here and enable new custom recipes. - -#An example to disable recipes: - -#crafting: -# disabled: -# firstdisabledidentifer: -# material: TORCH -# crackedStoneBrick: -# material: SMOOTH_BRICK -# durability: 2 - -#Basically you only need to give a list of items here and all their crafting recipes will be disabled - -#To enable new crafting recipes - -#TODO TODO TODO TODO TODO - - -crafting: - disabled: - enabled: - - #Additionally you can specify default options here, which are applied to all factories which use this option, unless #you chose to overwrite the default for a specific factory, in that case the option specified in the factories config #will apply to it. @@ -184,6 +159,10 @@ default_fuel: default_fuel_consumption_intervall: 2s +#default_health specifies a default for how much health a factory has. Factories will continuously lose health over time and have +#to be repaired before they can be used again, once they are at 0 health +default_health: 10000 + #default_menu_factory allows you to specify the menu for which factory will be opened when a player runs /fm without #specifying a factory. If this is not specified and the player runs "/fm" one will be picked randomly. default_menu_factory: @@ -200,14 +179,14 @@ disable_nether: false #When FCCs are in disrepair they will be removed after a set amount of time, which can be specified here -break_grace_period: 7d +default_break_grace_period: 7d #How often factories are passively decayed decay_intervall: 1h -#How much health is decayed from factories, factories have 10k health total -decay_amount: 21 +#How much health is decayed from factories by default each damaging run +default_decay_amount: 21 #Whether the yaml identifier or the factory name should be used when assigning recipes to factories, default to false use_recipe_yamlidentifiers: false @@ -254,6 +233,9 @@ saving_intervall: 15m # type: FCC # name: Smelter # updatetime: 2s +# health: 20000 +# grace_period: 14d +# decay_amount: 40 # fuel: # fuelidentifier: # material: COAL @@ -278,6 +260,17 @@ saving_intervall: 15m #If this is not specified the default option which was specified above will be used. For more details on this option read #the explaination next to the default updatetime above +#health determines how much health the factory has and how long it takes for it go in disrepair. If this option is not set, +#the default_health specified at the beginning of the config will be used + +#grace_period determines how long the factory will stay alive while at 0 health. If the factory remains at 0 health for this +#time period, it will be permanently removed. Repairing the factory once will reset this counter and if this value is not set +#for a factory, default_grace_period as specified at the start of the config will be used + +#decay_amount is the amount of health the factory loses every time factories are damaged by time based decay. The intervall for +#this damaging is the same for all factories and specified as decay_intervall at the top of the config. If no decay_amount is +#specified for a factory, default_decay_amount as specified at the top of the config will be used + #fuel specifies which item is used in the furnace to power this factory. You will still need to give the fuel it's own #sub identifer here, because it's techincally part of a list of items. If this option is not set, the default fuel specified #above will be used. diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index e9311855..6a390a56 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -56,7 +56,10 @@ public class ConfigParser { private HashMap upgradeEggs; private HashMap> recipeLists; private String defaultMenuFactory; + private long defaultBreakGracePeriod; + private int defaultDamagePerBreakPeriod; private boolean useYamlIdentifers; + private int defaultHealth; public ConfigParser(FactoryMod plugin) { this.plugin = plugin; @@ -93,6 +96,7 @@ public FactoryModManager parse() { useYamlIdentifers = config.getBoolean("use_recipe_yamlidentifiers", false); defaultUpdateTime = (int) parseTime(config.getString( "default_update_time", "5")); + defaultHealth = config.getInt("default_health", 10000); ItemMap dFuel = parseItemMap(config.getConfigurationSection("default_fuel")); if (dFuel.getTotalUniqueItemAmount() > 0) { defaultFuel = dFuel.getItemStackRepresentation().get(0); @@ -104,8 +108,9 @@ public FactoryModManager parse() { defaultReturnRate = config.getDouble("default_return_rate", 0.0); int redstonePowerOn = config.getInt("redstone_power_on", 7); int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); - long gracePeriod = 50 * parseTime(config - .getString("break_grace_period")); + defaultBreakGracePeriod = 50 * parseTime(config + .getString("default_break_grace_period")); + defaultDamagePerBreakPeriod = config.getInt("default_decay_amount", 21); long savingIntervall = parseTime(config.getString("saving_intervall", "15m")); //save factories on a regular base, unless disabled if (savingIntervall != -1) { @@ -122,9 +127,7 @@ public void run() { Map factoryRenames = parseRenames(config.getConfigurationSection("renames")); manager = new FactoryModManager(plugin, factoryInteractionMaterial, citadelEnabled, nameLayerEnabled, redstonePowerOn, redstoneRecipeChange, - logInventories, gracePeriod, factoryRenames); - handleEnabledAndDisabledRecipes(config - .getConfigurationSection("crafting")); + logInventories, factoryRenames); upgradeEggs = new HashMap(); recipeLists = new HashMap>(); parseFactories(config.getConfigurationSection("factories")); @@ -377,6 +380,13 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { } else { fuel = defaultFuel; } + int health; + if (config.contains("health")) { + health = config.getInt("health"); + } + else { + health = defaultHealth; + } int fuelIntervall; if (config.contains("fuel_consumption_intervall")) { fuelIntervall = (int) parseTime(config @@ -384,54 +394,31 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { } else { fuelIntervall = defaultFuelConsumptionTime; } + long gracePeriod; + if (config.contains("grace_period")) { + //milliseconds + gracePeriod = 50 * parseTime(config.getString("grace_period")); + } + else { + gracePeriod = defaultBreakGracePeriod; + } + int healthPerDamageIntervall; + if (config.contains("decay_amount")) { + healthPerDamageIntervall = config.getInt("decay_amount"); + } + else { + healthPerDamageIntervall = defaultDamagePerBreakPeriod; + } FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, null, fuel, - fuelIntervall, returnRate); + fuelIntervall, returnRate, health, gracePeriod, healthPerDamageIntervall); recipeLists.put(egg, config.getStringList("recipes")); return egg; } public void enableFactoryDecay(ConfigurationSection config) { long interval = parseTime(config.getString("decay_intervall")); - int amount = config.getInt("decay_amount"); plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, - new FactoryGarbageCollector(amount), interval, interval); - } - - /** - * Disables and enables crafting recipes as specified in the config - * - * @param config - * ConfigurationSection to parse from - */ - private void handleEnabledAndDisabledRecipes(ConfigurationSection config) { - // Disabling recipes - List toDisable = new ArrayList(); - ItemMap disabledRecipes = parseItemMap(config - .getConfigurationSection("disabled")); - for (ItemStack recipe : disabledRecipes.getItemStackRepresentation()) { - plugin.info("Attempting to disable recipes for " - + recipe.toString()); - List tempList = plugin.getServer().getRecipesFor(recipe); - for (Recipe potential : tempList) { - if (potential.getResult().isSimilar(recipe)) { - plugin.info("Found a disable recipe match " - + potential.toString()); - toDisable.add(potential); - } - } - } - Iterator it = plugin.getServer().recipeIterator(); - while (it.hasNext()) { - Recipe recipe = it.next(); - for (Recipe disable : toDisable) { - if (disable.getResult().isSimilar(recipe.getResult())) { - it.remove(); - plugin.info("Disabling recipe " + recipe.getResult().toString()); - } - } - } - - // TODO enable shaped and unshaped recipes here + new FactoryGarbageCollector(), interval, interval); } /** diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index f3a78fd3..44ecd733 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -55,20 +55,18 @@ public class FactoryModManager { private int redstonePowerOn; private int redstoneRecipeChange; private String compactLore; - private long noHealthGracePeriod; public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, boolean nameLayerEnabled, int redstonePowerOn, int redstoneRecipeChange, boolean logInventories, - long noHealthGracePeriod, Map factoryRenames) { + Map factoryRenames) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; this.nameLayerEnabled = nameLayerEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; - this.noHealthGracePeriod = noHealthGracePeriod; fileHandler = new FileHandler(this, factoryRenames); @@ -576,17 +574,6 @@ public int getRedstonePowerOn() { return this.redstonePowerOn; } - /** - * Gets how long factories using percentage health managers will stay alive - * after being broken. This is measure in milliseconds, because unix - * timestamps are used to track it - * - * @return How long a factory will be alive at 0 % health in milli seconds - */ - public long getNoHealthGracePeriod() { - return noHealthGracePeriod; - } - /** * Gets the Redstone power change necessary to alter the recipe setting of a * factory. Any change >= this level, either positive or negative, will diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index b5e4118b..28e1d9a0 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -21,17 +21,23 @@ public class FurnCraftChestEgg implements IFactoryEgg { private List recipes; private ItemStack fuel; private int fuelConsumptionIntervall; + private int maximumHealth; + private long breakGracePeriod; + private int healthPerDamagePeriod; private double returnRateOnDestruction; public FurnCraftChestEgg(String name, int updateTime, List recipes, ItemStack fuel, - int fuelConsumptionIntervall, double returnRateOnDestruction) { + int fuelConsumptionIntervall, double returnRateOnDestruction, int maximumHealth, long breakGracePeriod, int healthPerDamagePeriod) { this.name = name; this.updateTime = updateTime; this.recipes = recipes; this.fuel = fuel; + this.breakGracePeriod = breakGracePeriod; + this.healthPerDamagePeriod = healthPerDamagePeriod; this.fuelConsumptionIntervall = fuelConsumptionIntervall; this.returnRateOnDestruction = returnRateOnDestruction; + this.maximumHealth = maximumHealth; } public Factory hatch(MultiBlockStructure mbs, Player p) { @@ -39,8 +45,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); - PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( - PercentageHealthRepairManager.getMaximumHealth()); + PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, healthPerDamagePeriod, breakGracePeriod); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); @@ -78,15 +83,26 @@ public double getReturnRate() { public int getFuelConsumptionIntervall() { return fuelConsumptionIntervall; } + + public int getMaximumHealth() { + return maximumHealth; + } + + public int getDamagePerDamagingPeriod() { + return healthPerDamagePeriod; + } + + public long getBreakGracePeriod() { + return breakGracePeriod; + } public Factory revive(List blocks, int health, - String selectedRecipe, int productionTimer) { + String selectedRecipe, int productionTimer, int breakTime) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); - PercentageHealthRepairManager phrm = new PercentageHealthRepairManager( - health); + PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(health, maximumHealth, breakTime, healthPerDamagePeriod, breakGracePeriod); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, fpm, fccs, updateTime, name, recipes); fccim.setFactory(fccf); diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 361d13ea..6d04429d 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -21,7 +21,6 @@ import vg.civcraft.mc.citadel.ReinforcementManager; import vg.civcraft.mc.citadel.reinforcement.PlayerReinforcement; import vg.civcraft.mc.namelayer.NameAPI; -import vg.civcraft.mc.namelayer.NameLayerPlugin; import vg.civcraft.mc.namelayer.permission.PermissionType; import com.github.igotyou.FactoryMod.FactoryMod; @@ -441,7 +440,7 @@ public static void removePylon(Factory f) { } public void upgrade(String name, List recipes, ItemStack fuel, - int fuelConsumptionIntervall, int updateTime) { + int fuelConsumptionIntervall, int updateTime, int maximumHealth, int damageAmountPerDecayIntervall, long gracePeriod) { LoggingUtils.log("Upgrading " + getLogData() + " to " + name); pylonFactories.remove(this); deactivate(); @@ -450,8 +449,7 @@ public void upgrade(String name, List recipes, ItemStack fuel, this.updateTime = updateTime; this.pm = new FurnacePowerManager(getFurnace(), fuel, fuelConsumptionIntervall); - ((PercentageHealthRepairManager) this.rm) - .repair(PercentageHealthRepairManager.getMaximumHealth()); + this.rm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, damageAmountPerDecayIntervall, gracePeriod); if (recipes.size() != 0) { setRecipe(recipes.get(0)); } else { diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 5a5c14ec..879c139a 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -186,11 +186,8 @@ public void clicked(Player arg0) { p.sendMessage(ChatColor.GOLD + "Currently at " + fccf.getRepairManager().getHealth() + " health"); if (fccf.getRepairManager().inDisrepair()) { - long breaktime = ((PercentageHealthRepairManager) fccf - .getRepairManager()).getBreakTime(); - long leftTime = FactoryMod.getManager() - .getNoHealthGracePeriod() - - (System.currentTimeMillis() - breaktime); + PercentageHealthRepairManager rm = ((PercentageHealthRepairManager) fccf.getRepairManager()); + long leftTime = rm.getGracePeriod() - rm.getBreakTime(); long months = leftTime % (60 * 60 * 24 * 30 * 1000); long days = leftTime - (months * 60 * 60 * 24 * 30 * 1000) % (60 * 60 * 24 * 1000); @@ -199,9 +196,10 @@ public void clicked(Player arg0) { String time = (months != 0 ? months + " months, " : "") + (days != 0 ? days + " days, " : "") + (hours != 0 ? hours + " hours" : ""); - // p.sendMessage(ChatColor.GOLD + "It will break in " + - // time); - // TODO FIX THIS + if (time.equals("")) { + time = " less than an hour"; + } + p.sendMessage(ChatColor.GOLD + "It will break permanently in " + time); } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index e0caba67..92294f59 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -36,7 +36,8 @@ public void applyEffect(Inventory i, Factory f) { FurnCraftChestEgg e = (FurnCraftChestEgg) egg; ((FurnCraftChestFactory) f).upgrade(e.getName(), e.getRecipes(), e.getFuel(), - e.getFuelConsumptionIntervall(), e.getUpdateTime()); + e.getFuelConsumptionIntervall(), e.getUpdateTime(), e.getMaximumHealth(), + e.getDamagePerDamagingPeriod(), e.getBreakGracePeriod()); } } logAfterRecipeRun(i, f); diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index 4c7dfe18..c806f21c 100644 --- a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -14,20 +14,33 @@ public class PercentageHealthRepairManager implements IRepairManager { private int health; private Factory factory; private long breakTime; - private static final int maximumHealth = 10000; + private int maximumHealth; + private int damageAmountPerDecayIntervall; + private long gracePeriod; - public PercentageHealthRepairManager(int initialHealth) { - health = initialHealth; - breakTime = 0; + public PercentageHealthRepairManager(int initialHealth, int maximumHealth, int breakTime, int damageAmountPerDecayIntervall, long gracePeriod) { + this.health = initialHealth; + this.maximumHealth = maximumHealth; + this.breakTime = breakTime; + this.damageAmountPerDecayIntervall = damageAmountPerDecayIntervall; + this.gracePeriod = gracePeriod; } public boolean atFullHealth() { return health >= maximumHealth; } - - public static int getMaximumHealth() { + + public int getMaximumHealth() { return maximumHealth; } + + public int getDamageAmountPerDecayIntervall() { + return damageAmountPerDecayIntervall; + } + + public long getGracePeriod() { + return gracePeriod; + } public boolean inDisrepair() { return health <= 0; @@ -38,8 +51,8 @@ public void setFactory(Factory factory) { } public String getHealth() { - return String.valueOf(health / 100) + "." - + String.valueOf(health % 100) + " %"; + return String.valueOf(health / (maximumHealth / 100)) + "." + String.valueOf(health % (maximumHealth / 100)) + + " %"; } public void repair(int amount) { @@ -50,26 +63,19 @@ public void repair(int amount) { public void breakIt() { health = 0; breakTime = System.currentTimeMillis(); - FactoryMod - .getPlugin() - .getServer() - .getScheduler() - .scheduleSyncDelayedTask(FactoryMod.getPlugin(), - new Runnable() { - - @Override - public void run() { - if (factory.getMultiBlockStructure() - .relevantBlocksDestroyed()) { - LoggingUtils.log(factory.getLogData() - + " removed because blocks were destroyed"); - FactoryMod.getManager().removeFactory( - factory); - returnStuff(factory); - } - - } - }); + FactoryMod.getPlugin().getServer().getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), new Runnable() { + + @Override + public void run() { + if (factory.getMultiBlockStructure().relevantBlocksDestroyed()) { + LoggingUtils.log(factory.getLogData() + " removed because blocks were destroyed"); + FactoryMod.getManager().removeFactory(factory); + returnStuff(factory); + } + + } + }); } public int getRawHealth() { @@ -81,24 +87,19 @@ public void setHealth(int health) { } public static void returnStuff(Factory factory) { - double rate = FactoryMod.getManager().getEgg(factory.getName()) - .getReturnRate(); + double rate = FactoryMod.getManager().getEgg(factory.getName()).getReturnRate(); if (rate == 0.0) { return; } - for (Entry items : FactoryMod.getManager() - .getTotalSetupCost(factory).getEntrySet()) { + for (Entry items : FactoryMod.getManager().getTotalSetupCost(factory).getEntrySet()) { int returnAmount = (int) (items.getValue() * rate); ItemMap im = new ItemMap(); im.addItemAmount(items.getKey(), returnAmount); for (ItemStack is : im.getItemStackRepresentation()) { - if(is.getDurability() == -1) is.setDurability((short)0); - factory.getMultiBlockStructure() - .getCenter() - .getWorld() - .dropItemNaturally( - factory.getMultiBlockStructure().getCenter(), - is); + if (is.getDurability() == -1) + is.setDurability((short) 0); + factory.getMultiBlockStructure().getCenter().getWorld() + .dropItemNaturally(factory.getMultiBlockStructure().getCenter(), is); } } } diff --git a/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java b/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java index 83fc432b..42210ce8 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java +++ b/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java @@ -5,17 +5,12 @@ import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; public class FactoryGarbageCollector implements Runnable { - private int healthPerCall; - - public FactoryGarbageCollector(int healthPerCall) { - this.healthPerCall = healthPerCall; - } public void run() { - long graceTime = FactoryMod.getManager().getNoHealthGracePeriod(); for(Factory f: FactoryMod.getManager().getAllFactories()) { if (f.getRepairManager() instanceof PercentageHealthRepairManager) { PercentageHealthRepairManager rm = (PercentageHealthRepairManager) f.getRepairManager(); + long graceTime = rm.getGracePeriod(); long broke = rm.getBreakTime(); if (broke != 0) { if (System.currentTimeMillis() - broke > graceTime) { @@ -25,7 +20,7 @@ public void run() { } } else { - rm.setHealth(rm.getRawHealth()-healthPerCall); + rm.setHealth(rm.getRawHealth() - rm.getDamageAmountPerDecayIntervall()); if (rm.getRawHealth() <= 0) { rm.breakIt(); } diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index 7943fdce..f76a2766 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -78,6 +78,9 @@ public void save(Collection factories) { config.set(current + ".health", ((PercentageHealthRepairManager) fccf .getRepairManager()).getRawHealth()); + config.set(current + ".breakTime", + ((PercentageHealthRepairManager) fccf + .getRepairManager()).getBreakTime()); config.set(current + ".runtime", fccf.getRunningTime()); config.set(current + ".selectedRecipe", fccf .getCurrentRecipe().getRecipeName()); @@ -191,9 +194,10 @@ private void loadFromFile(File f, Map eggs) { } } int health = current.getInt("health"); + int breakTime = current.getInt("breakTime", 0); String selectedRecipe = current.getString("selectedRecipe"); FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, - runtime); + runtime, breakTime); String activator = current.getString("activator", "null"); UUID acti; if (activator.equals("null")) { From d5fb1b375074d44ddc59e46eb33929bc537c38a5 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 7 Aug 2016 21:34:10 +0200 Subject: [PATCH 421/459] configchanges to go along with structure changes --- configCivcraft.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index 315958f7..aaa3d8d3 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -6,9 +6,10 @@ default_fuel: default_fuel_consumption_intervall: 2s default_menu_factory: Basic Contraption default_return_rate: 0.5 -break_grace_period: 10d +default_break_grace_period: 10d decay_intervall: 1h -decay_amount: 21 +default_decay_amount: 21 +default_health: 10000 use_recipe_yamlidentifiers: true global_pylon_limit: 100 From 572b54881aefe60e07e05c8fb7f33dc1fc44bac7 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 8 Aug 2016 00:48:23 +0200 Subject: [PATCH 422/459] Fix lapis block amount in fossil recipe --- configCivcraft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configCivcraft.yml b/configCivcraft.yml index aaa3d8d3..c1ae6f89 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -10427,7 +10427,7 @@ recipes: chance: 0.026176 item: material: LAPIS_BLOCK - amount: 64 + amount: 1 mid11: chance: 0.026176 item: @@ -10895,7 +10895,7 @@ recipes: chance: 0.026176 item: material: LAPIS_BLOCK - amount: 64 + amount: 1 mid11: chance: 0.026176 item: From e161da39ee48665552ce5f8bfcf7cd6ffbd04d7a Mon Sep 17 00:00:00 2001 From: Gatlin Newhouse Date: Thu, 11 Aug 2016 14:22:37 -0700 Subject: [PATCH 423/459] Added recipes for Beetroots (#283) * Added recipes for Beetroots I added a recipe for Beetroot Soup which makes crafting it more efficient than vanilla, and then I added Beetroots to the Soup Concentrate recipe like Maxopoly suggested to me in Slack. * Added space Should be good now --- configCivcraft.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configCivcraft.yml b/configCivcraft.yml index c1ae6f89..41a66e29 100644 --- a/configCivcraft.yml +++ b/configCivcraft.yml @@ -425,6 +425,7 @@ factories: recipes: - Make_Rabbit_Stew - Make_Mushroom_Stew + - Make_Beetroot_Soup - Brew_Soup_Concentrate - Repair_Factory animalhusbandryfactorybasic: @@ -3641,6 +3642,22 @@ recipes: rabbit stew: material: RABBIT_STEW amount: 18 + Make_Beetroot_Soup: + type: PRODUCTION + name: Make Beetroot Soup + production_time: 8s + input: + beetroot: + material: BEETROOT + amount: 16 + planks: + material: WOOD + durability: -1 + amount: 32 + output: + beetroot soup: + material: BEETROOT_SOUP + amount: 18 Mutate_random_sapling: type: RANDOM name: Mutate Random Sapling @@ -5549,6 +5566,9 @@ recipes: mushroom2: material: BROWN_MUSHROOM amount: 256 + beetroot: + material: BEETROOT + amount: 256 bucket: material: WATER_BUCKET amount: 8 From 4aec303bb36d231fd68a0abbf4fedd407459e8c2 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 12 Aug 2016 18:29:56 +0200 Subject: [PATCH 424/459] Bypass permission checks on start up so factory upgrades arent cancelled --- .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../igotyou/FactoryMod/eggs/PipeEgg.java | 2 +- .../igotyou/FactoryMod/eggs/SorterEgg.java | 2 +- .../igotyou/FactoryMod/factories/Factory.java | 31 +++++++++---------- .../factories/FurnCraftChestFactory.java | 6 ++-- .../igotyou/FactoryMod/factories/Pipe.java | 2 +- .../igotyou/FactoryMod/factories/Sorter.java | 2 +- .../FurnCraftChestInteractionManager.java | 6 ++-- .../PipeInteractionManager.java | 6 ++-- .../SorterInteractionManager.java | 10 +++--- .../FactoryMod/recipes/AOERepairRecipe.java | 2 +- 11 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 28e1d9a0..70bb520a 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -116,7 +116,7 @@ public Factory revive(List blocks, int health, fccf.setRecipe(recipes.get(0)); } if (productionTimer != 0) { - fccf.attemptToActivate(null); + fccf.attemptToActivate(null, true); if (fccf.isActive()) { fccf.setProductionTimer(productionTimer); } diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index 2c93d668..a754e8bc 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -107,7 +107,7 @@ public Factory revive(List blocks, List allowedMaterials, ((NoRepairDestroyOnBreakManager)rm).setFactory(pipe); pipe.setAllowedMaterials(allowedMaterials); if (runTime != 0) { - pipe.attemptToActivate(null); + pipe.attemptToActivate(null, true); if (pipe.isActive()) { pipe.setRunTime(runTime); } diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index 6f77e3ee..c70819ef 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -71,7 +71,7 @@ public Factory revive(List blocks, ((NoRepairDestroyOnBreakManager) rm).setFactory(sorter); sorter.setAssignments(assignments); if (runTime != 0) { - sorter.attemptToActivate(null); + sorter.attemptToActivate(null, true); if (sorter.isActive()) { sorter.setRunTime(runTime); } diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/com/github/igotyou/FactoryMod/factories/Factory.java index 801188a4..1baacba1 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Factory.java +++ b/src/com/github/igotyou/FactoryMod/factories/Factory.java @@ -28,10 +28,9 @@ public abstract class Factory implements Runnable { protected int updateTime; protected String name; protected int threadId; - - public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, - MultiBlockStructure mbs, int updateTime, String name) { + public Factory(IInteractionManager im, IRepairManager rm, IPowerManager pm, MultiBlockStructure mbs, + int updateTime, String name) { this.im = im; this.rm = rm; this.mbs = mbs; @@ -114,16 +113,15 @@ public String getName() { * @param p * Player turning the factory on or null if something other than * a player is attempting to turn it on + * @param onStartUp + * Whether this factory is just being reactivated after a + * restart/reload and any permissions checks should be bypassed */ - public abstract void attemptToActivate(Player p); + public abstract void attemptToActivate(Player p, boolean onStartUp); public void scheduleUpdate() { - threadId = FactoryMod - .getPlugin() - .getServer() - .getScheduler() - .scheduleSyncDelayedTask(FactoryMod.getPlugin(), this, - (long) updateTime); + threadId = FactoryMod.getPlugin().getServer().getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), this, (long) updateTime); } public void turnFurnaceOn(Block f) { @@ -132,29 +130,30 @@ public void turnFurnaceOn(Block f) { } Furnace furnace = (Furnace) f.getState(); ItemStack[] oldContents = furnace.getInventory().getContents(); - BlockFace facing = ((DirectionalContainer)furnace.getData()).getFacing(); + BlockFace facing = ((DirectionalContainer) furnace.getData()).getFacing(); furnace.getInventory().clear(); f.setType(Material.BURNING_FURNACE); furnace = (Furnace) f.getState(); MaterialData data = furnace.getData(); - ((DirectionalContainer)data).setFacingDirection(facing); + ((DirectionalContainer) data).setFacingDirection(facing); furnace.setData(data); furnace.update(); furnace.setBurnTime(Short.MAX_VALUE); furnace.getInventory().setContents(oldContents); } - + public String getLogData() { - return name+" at " + mbs.getCenter().toString(); + return name + " at " + mbs.getCenter().toString(); } public void turnFurnaceOff(Block f) { - //Since we are turning it off that implies its on, that means we should check if the furnace is burning. + // Since we are turning it off that implies its on, that means we should + // check if the furnace is burning. if (f.getType() != Material.BURNING_FURNACE) { return; } Furnace furnace = (Furnace) f.getState(); - furnace.setBurnTime((short)0); + furnace.setBurnTime((short) 0); furnace.update(); } } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 6d04429d..bf8d7c5c 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -104,11 +104,11 @@ public FurnaceInventory getFurnaceInventory() { * Attempts to turn the factory on and does all the checks needed to ensure * that the factory is allowed to turn on */ - public void attemptToActivate(Player p) { + public void attemptToActivate(Player p, boolean onStartUp) { LoggingUtils.log((p != null ? p.getName() : "Redstone") + " is attempting to activate " + getLogData()); mbs.recheckComplete(); - + if (active) { return; } @@ -130,7 +130,7 @@ public void attemptToActivate(Player p) { } return; } - if (currentRecipe instanceof Upgraderecipe + if (!onStartUp && currentRecipe instanceof Upgraderecipe && FactoryMod.getManager().isCitadelEnabled()) { // only allow permitted members to upgrade the factory ReinforcementManager rm = Citadel diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/com/github/igotyou/FactoryMod/factories/Pipe.java index 2916153c..fa8bab6f 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Pipe.java +++ b/src/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -39,7 +39,7 @@ public Pipe(IInteractionManager im, IRepairManager rm, IPowerManager pm, runTime = 0; } - public void attemptToActivate(Player p) { + public void attemptToActivate(Player p, boolean onStartUp) { LoggingUtils.log((p != null ? p.getName() : "Redstone") + "is attempting to activate " + getLogData()); mbs.recheckComplete(); diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/com/github/igotyou/FactoryMod/factories/Sorter.java index 555dea46..1d69d7a2 100644 --- a/src/com/github/igotyou/FactoryMod/factories/Sorter.java +++ b/src/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -46,7 +46,7 @@ public Sorter(IInteractionManager im, IRepairManager rm, IPowerManager pm, } } - public void attemptToActivate(Player p) { + public void attemptToActivate(Player p, boolean onStartUp) { LoggingUtils.log((p != null ? p.getName() : "Redstone") + "is attempting to activate " + getLogData()); mbs.recheckComplete(); diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 879c139a..236af89a 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -62,7 +62,7 @@ public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { if (rm == null || MultiBlockStructure.citadelRedstoneChecks(e .getBlock())) { - fccf.attemptToActivate(null); + fccf.attemptToActivate(null, false); } } else { return; @@ -83,7 +83,7 @@ public void blockBreak(Player p, Block b) { } public void leftClick(Player p, Block b, BlockFace bf) { - if (p.getItemInHand().getType() != FactoryMod.getManager() + if (p.getInventory().getItemInMainHand().getType() != FactoryMod.getManager() .getFactoryInteractionMaterial()) { return; } @@ -267,7 +267,7 @@ public void clicked(Player arg0) { p.sendMessage(ChatColor.RED + "Deactivated " + fccf.getName()); FactoryMod.sendResponse("FactoryActivation", p); } else { - fccf.attemptToActivate(p); + fccf.attemptToActivate(p, false); FactoryMod.sendResponse("FactoryDeactivation", p); } } diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java index 5bf402c6..223fcc2b 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -44,7 +44,7 @@ public void rightClick(Player p, Block b, BlockFace bf) { } public void leftClick(Player p, Block b, BlockFace bf) { - ItemStack hand = p.getItemInHand(); + ItemStack hand = p.getInventory().getItemInMainHand(); if (FactoryMod.getManager().isCitadelEnabled()) { ReinforcementManager rm = Citadel.getReinforcementManager(); // is this cast safe? Let's just assume yes for now @@ -91,7 +91,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { p.sendMessage(ChatColor.GOLD + pipe.getName() + " has been deactivated"); } else { - pipe.attemptToActivate(p); + pipe.attemptToActivate(p, false); } } } @@ -114,7 +114,7 @@ public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { if (rm == null || MultiBlockStructure.citadelRedstoneChecks(e .getBlock())) { - pipe.attemptToActivate(null); + pipe.attemptToActivate(null, false); } } else { return; diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java index 2020f81f..91bdfc75 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -68,22 +68,22 @@ public void leftClick(Player p, Block b, BlockFace bf) { } } if (b.equals(bfs.getFurnace())) { - if (p.getItemInHand() + if (p.getInventory().getItemInMainHand() .getType() .equals(FactoryMod.getManager() .getFactoryInteractionMaterial())) { - sorter.attemptToActivate(p); + sorter.attemptToActivate(p, false); } } else { // center if (p.isSneaking() - && p.getItemInHand() + && p.getInventory().getItemInMainHand() .getType() .equals(FactoryMod.getManager() .getFactoryInteractionMaterial())) { mb.showSorterFace(p, sorter, bf); return; } - ItemStack is = p.getItemInHand(); + ItemStack is = p.getInventory().getItemInMainHand(); if (is == null) { return; //no item in hand @@ -126,7 +126,7 @@ public void redStoneEvent(BlockRedstoneEvent e, Block factoryBlock) { if (rm == null || MultiBlockStructure.citadelRedstoneChecks(e .getBlock())) { - sorter.attemptToActivate(null); + sorter.attemptToActivate(null, false); } } else { return; diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index 2cdff87a..7134a773 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -161,7 +161,7 @@ public void applyEffect(Inventory i, Factory f) { break; } } - fac.attemptToActivate(null); + fac.attemptToActivate(null, false); break; } } From 48a6b3090c06fba2e269bb9de3b4f63927b00150 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 12 Aug 2016 18:31:19 +0200 Subject: [PATCH 425/459] Increment pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 961d7056..65d63927 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.11 + 2.2.12 FactoryMod https://github.com/Civcraft/FactoryMod From b752b0f03d107d350da8ecafa031f15f200b2d3a Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 17 Aug 2016 06:34:35 +0200 Subject: [PATCH 426/459] Add lore enchant recipe --- config.yml | 55 ++++++++ .../igotyou/FactoryMod/ConfigParser.java | 27 ++-- .../FactoryMod/recipes/LoreEnchantRecipe.java | 124 ++++++++++++++++++ 3 files changed, 198 insertions(+), 8 deletions(-) create mode 100644 src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java diff --git a/config.yml b/config.yml index 526f3ba0..c8b1165d 100644 --- a/config.yml +++ b/config.yml @@ -620,6 +620,61 @@ factories: #output is a list of item configurations with a chance for it each. It's important to note here that the items themselves still need be a level lower #yaml structure wise than the chance + +#8. Cost return recipe + +#Cost return recipes allow you to return a percentage of the total setup cost of a factory, which is different from the return rate on break. This can for +#example be very useful when making factories obsolete to reimburse players. When the recipe completes, the factory will be destroyed. + +#Example: + +#return: +# type: COSTRETURN +# input: +# dirt: +# material: DIRT +# factor: 1.0 + +#type has to be COSTRETURN + +#input allows you to specify items which are consumed when breaking the factory, it may be left empty if desired + +#factor specifies a multiplier for how much of the total setup cost is dropped, where 1.0 means full setupcost. + + +#9. Lore enchanting recipes + +#This type of recipe allows you to apply a set of lore to an item in exchange for consuming another set of lore, basically custom enchants + +#Example: + +#loreEnchant: +# type: LOREENCHANT +# input: +# emeralds: +# material: EMERALD +# amount: 9 +# loredItem: +# pick: +# material: DIAMOND_PICKAXE +# overwrittenLore: +# - TNTBreaker I +# appliedLore: +# - TNTBreaker II + +#This recipe will increment the count after the lore line 'TNTBreaker' + +#type has to be LOREENCHANT + +#input is whatever input is consumed additionally + +#loredItem specifies the tool to which this enchant is applied. Only it's material is respected here, specific ItemMeta is ignored + +#overwrittenLore is the lore which is required on the item which is being enchanted. This list may be empty or have multiple lines, both will work + +#appliedLore is the lore which is applied as replacement for the removed lore. This list may not be empty, but it may contain multiple entries + + recipes: diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 6a390a56..590a9835 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -1,22 +1,19 @@ package com.github.igotyou.FactoryMod; -import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Recipe; +import org.bukkit.scheduler.BukkitRunnable; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import static vg.civcraft.mc.civmodcore.util.ConfigParsing.parseItemMap; @@ -34,9 +31,9 @@ import com.github.igotyou.FactoryMod.recipes.FactoryMaterialReturnRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.recipes.LoreEnchantRecipe; import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.PylonRecipe; -import com.github.igotyou.FactoryMod.recipes.RandomEnchantingRecipe; import com.github.igotyou.FactoryMod.recipes.RandomOutputRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; @@ -114,12 +111,14 @@ public FactoryModManager parse() { long savingIntervall = parseTime(config.getString("saving_intervall", "15m")); //save factories on a regular base, unless disabled if (savingIntervall != -1) { - Bukkit.getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() { + new BukkitRunnable() { + @Override public void run() { - FactoryMod.getManager().saveFactories(); + FactoryMod.getManager().saveFactories(); + } - }, savingIntervall, savingIntervall); + }.runTaskTimerAsynchronously(plugin, savingIntervall, savingIntervall); } defaultMenuFactory = config.getString("default_menu_factory"); int globalPylonLimit = config.getInt("global_pylon_limit"); @@ -561,6 +560,18 @@ private IRecipe parseRecipe(ConfigurationSection config) { double factor = config.getDouble("factor", 1.0); result = new FactoryMaterialReturnRecipe(name, productionTime, costIn, factor); break; + case "LOREENCHANT": + ItemMap loreCostIn = parseItemMap(config.getConfigurationSection("input")); + ItemMap loreTool = parseItemMap(config.getConfigurationSection("lored_item")); + List appliedLore = config.getStringList("appliedLore"); + List overwrittenLore = config.getStringList("overwrittenLore"); + if (appliedLore == null || appliedLore.size() == 0) { + plugin.warning("No result lore specified for lore enchant recipe at " + config.getCurrentPath() + ". It was skipped"); + result = null; + break; + } + result = new LoreEnchantRecipe(name, productionTime, loreCostIn, loreTool, appliedLore, overwrittenLore); + break; default: plugin.severe("Could not identify type " + config.getString("type") + " as a valid recipe identifier"); diff --git a/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java new file mode 100644 index 00000000..63747805 --- /dev/null +++ b/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -0,0 +1,124 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +import com.github.igotyou.FactoryMod.factories.Factory; + +public class LoreEnchantRecipe extends InputRecipe { + + private List appliedLore; + private List overwritenLore; + private ItemMap tool; + + public LoreEnchantRecipe(String name, int productionTime, ItemMap input, ItemMap tool, List appliedLore, + List overwritenLore) { + super(name, productionTime, input); + this.overwritenLore = overwritenLore; + this.appliedLore = appliedLore; + this.tool = tool; + } + + public boolean enoughMaterialAvailable(Inventory i) { + if (input.isContainedIn(i)) { + ItemStack toolio = tool.getItemStackRepresentation().get(0); + for (ItemStack is : i.getContents()) { + if (is != null && toolio.getType() == is.getType() && hasStackRequiredLore(is)) { + return true; + } + } + } + return false; + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = tool.getItemStackRepresentation().get(0); + for (String s : appliedLore) { + ISUtils.addLore(is, s); + } + ISUtils.setName(is, name); + return is; + } + + public List getOutputRepresentation(Inventory i) { + ItemStack is = tool.getItemStackRepresentation().get(0); + for (String s : appliedLore) { + ISUtils.addLore(is, s); + } + if (i != null) { + ISUtils.addLore( + is, + ChatColor.GREEN + + "Enough materials for " + + String.valueOf(Math.min(tool.getMultiplesContainedIn(i), input.getMultiplesContainedIn(i))) + + " runs"); + } + List stacks = new LinkedList(); + stacks.add(is); + return stacks; + } + + public List getInputRepresentation(Inventory i) { + if (i == null) { + List bla = input.getItemStackRepresentation(); + ItemStack is = tool.getItemStackRepresentation().get(0); + for (String s : overwritenLore) { + ISUtils.addLore(is, s); + } + return bla; + } + List returns = createLoredStacksForInfo(i); + ItemStack toSt = tool.getItemStackRepresentation().get(0); + for (String s : overwritenLore) { + ISUtils.addLore(toSt, s); + } + ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + new ItemMap(toSt).getMultiplesContainedIn(i) + + " runs"); + returns.add(toSt); + return returns; + } + + public void applyEffect(Inventory i, Factory f) { + logBeforeRecipeRun(i, f); + if (input.removeSafelyFrom(i)) { + ItemStack toolio = tool.getItemStackRepresentation().get(0); + for (ItemStack is : i.getContents()) { + if (is != null && toolio.getType() == is.getType() && hasStackRequiredLore(toolio)) { + ItemMeta im = is.getItemMeta(); + List currentLore = im.getLore(); + if (overwritenLore.size() != 0) { + currentLore.removeAll(overwritenLore); + } + currentLore.addAll(appliedLore); + im.setLore(currentLore); + is.setItemMeta(im); + break; + } + } + } + logAfterRecipeRun(i, f); + } + + private boolean hasStackRequiredLore(ItemStack is) { + if (overwritenLore.size() == 0) { + return true; + } + if (!is.hasItemMeta()) { + return false; + } + ItemMeta im = is.getItemMeta(); + if (!im.hasLore()) { + return false; + } + List lore = im.getLore(); + return lore.containsAll(overwritenLore); + } +} From df590c49e986870ab7982cdb308e3a19096355d4 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 17 Aug 2016 06:37:40 +0200 Subject: [PATCH 427/459] Ensure noone cheats with tool compaction --- src/com/github/igotyou/FactoryMod/ConfigParser.java | 2 +- .../github/igotyou/FactoryMod/recipes/DecompactingRecipe.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 590a9835..5f80b2d8 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -562,7 +562,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { break; case "LOREENCHANT": ItemMap loreCostIn = parseItemMap(config.getConfigurationSection("input")); - ItemMap loreTool = parseItemMap(config.getConfigurationSection("lored_item")); + ItemMap loreTool = parseItemMap(config.getConfigurationSection("loredItem")); List appliedLore = config.getStringList("appliedLore"); List overwrittenLore = config.getStringList("overwrittenLore"); if (appliedLore == null || appliedLore.size() == 0) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index d3af8cef..97b71efc 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -122,7 +122,9 @@ public List getOutputRepresentation(Inventory i) { } private boolean isDecompactable(ItemStack is) { - if ((is.getItemMeta().hasEnchants() && is.getType().getMaxStackSize() == 1)) { + //dont allow decompation if the item is enchanted or has additional lore, as the enchant/additional lore could have been applied to the compacted item + //and decompacting it would produce many items, which all have that enchant/lore + if (((is.getItemMeta().hasEnchants() || (is.getItemMeta().hasLore() && is.getItemMeta().getLore().size() >= 2)) && is.getType().getMaxStackSize() == 1)) { return false; } List lore = is.getItemMeta().getLore(); From 40e815818cef7aa2fdf22bd2813532f266b55c31 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 19 Aug 2016 03:50:25 +0200 Subject: [PATCH 428/459] Clean up a bit --- .../igotyou/FactoryMod/FactoryModManager.java | 29 +++++++++++++------ .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../igotyou/FactoryMod/eggs/IFactoryEgg.java | 2 +- .../igotyou/FactoryMod/eggs/PipeEgg.java | 2 +- .../igotyou/FactoryMod/eggs/SorterEgg.java | 2 +- .../listeners/FactoryModListener.java | 2 +- .../FactoryMod/recipes/AOERepairRecipe.java | 1 - .../structures/FurnCraftChestStructure.java | 6 ++++ .../FactoryMod/utility/MenuBuilder.java | 15 ---------- 9 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index 44ecd733..d75fc603 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -41,16 +41,16 @@ public class FactoryModManager { private FactoryMod plugin; private FileHandler fileHandler; - private HashMap, HashMap> factoryCreationRecipes; + private HashMap, HashMap> factoryCreationRecipes; private HashMap totalSetupCosts; private HashMap locations; private HashMap eggs; private HashSet factories; + private Map recipes; private HashSet possibleCenterBlocks; private HashSet possibleInteractionBlock; private Material factoryInteractionMaterial; private boolean citadelEnabled; - private boolean nameLayerEnabled; private boolean logInventories; private int redstonePowerOn; private int redstoneRecipeChange; @@ -60,15 +60,14 @@ public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, boolean nameLayerEnabled, int redstonePowerOn, int redstoneRecipeChange, boolean logInventories, - Map factoryRenames) { + Map factoryRenames, Map recipes) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; - this.nameLayerEnabled = nameLayerEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; - - fileHandler = new FileHandler(this, factoryRenames); + this.recipes = recipes; + this.fileHandler = new FileHandler(this, factoryRenames); if(nameLayerEnabled) { //register our own permissions @@ -85,7 +84,7 @@ public FactoryModManager(FactoryMod plugin, PermissionType.registerPermission("UPGRADE_FACTORY", modAndAbove); } - factoryCreationRecipes = new HashMap, HashMap>(); + factoryCreationRecipes = new HashMap, HashMap>(); locations = new HashMap(); eggs = new HashMap(); possibleCenterBlocks = new HashSet(); @@ -140,7 +139,7 @@ public String getCompactLore() { * Name of the factory * @return Setupcost if the factory if it was found or null if it wasnt */ - public ItemMap getSetupCost(Class c, String name) { + public ItemMap getSetupCost(Class c, String name) { for (Entry entry : factoryCreationRecipes.get(c) .entrySet()) { if (entry.getValue().getName().equals(name)) { @@ -487,7 +486,7 @@ public ItemMap getTotalSetupCost(IFactoryEgg e) { * @param egg * Encapsulates the factory itself */ - public void addFactoryCreationEgg(Class blockStructureClass, + public void addFactoryCreationEgg(Class blockStructureClass, ItemMap recipe, IFactoryEgg egg) { HashMap eggs = factoryCreationRecipes .get(blockStructureClass); @@ -595,4 +594,16 @@ public int getRedstoneRecipeChange() { public HashSet getAllFactories() { return factories; } + + /** + * Gets the recipe with the given name, if it exists + * @param name Name of the recipe + * @return Recipe with the given name or null if either the recipe doesn't exist or the given string was null + */ + public IRecipe getRecipe(String name) { + if (name == null) { + return null; + } + return recipes.get(name); + } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 70bb520a..138112f4 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -124,7 +124,7 @@ public Factory revive(List blocks, int health, return fccf; } - public Class getMultiBlockStructure() { + public Class getMultiBlockStructure() { return FurnCraftChestStructure.class; } diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java index 39184ccd..e3722be4 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -52,7 +52,7 @@ public interface IFactoryEgg { * * @return Structure class of the factories created by this egg */ - public Class getMultiBlockStructure(); + public Class getMultiBlockStructure(); /** * Java wont let me specify a method here without specifying its parameters diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index a754e8bc..43e6638d 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -115,7 +115,7 @@ public Factory revive(List blocks, List allowedMaterials, return pipe; } - public Class getMultiBlockStructure() { + public Class getMultiBlockStructure() { return PipeStructure.class; } } diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java index c70819ef..6eb576eb 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -111,7 +111,7 @@ public int getSortAmount() { return sortAmount; } - public Class getMultiBlockStructure() { + public Class getMultiBlockStructure() { return BlockFurnaceStructure.class; } diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index f7c4a8bc..5c3e52ce 100644 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -130,7 +130,7 @@ public void playerInteract(PlayerInteractEvent e) { if (e.getAction() == Action.LEFT_CLICK_BLOCK) { if (c == null) { if (manager.isPossibleCenterBlock(block.getType())) { - if (player.getItemInHand().getType() == manager + if (player.getInventory().getItemInMainHand().getType() == manager .getFactoryInteractionMaterial()) { manager.attemptCreation(block, player); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index 7134a773..57199ee5 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -135,7 +135,6 @@ public void applyEffect(Inventory i, Factory f) { Chest c = (Chest) i.getHolder(); Location loc = c.getLocation(); List facs = getNearbyFactoriesSortedByDistance(loc); - ItemStack is = new ItemStack(Material.WORKBENCH); int essenceCount = new ItemMap(i).getAmount(essence); for (FurnCraftChestFactory fac : facs) { PercentageHealthRepairManager rm = (PercentageHealthRepairManager) fac diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index fc765d7a..fede08cc 100644 --- a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -32,36 +32,42 @@ public FurnCraftChestStructure(Block center) { furnace = center.getRelative(BlockFace.NORTH) .getLocation(); } + break; case NORTH: if (center.getRelative(BlockFace.SOUTH).getType() == Material.FURNACE) { chest = b.getLocation(); furnace = center.getRelative(BlockFace.SOUTH) .getLocation(); } + break; case WEST: if (center.getRelative(BlockFace.EAST).getType() == Material.FURNACE) { chest = b.getLocation(); furnace = center.getRelative(BlockFace.EAST) .getLocation(); } + break; case EAST: if (center.getRelative(BlockFace.WEST).getType() == Material.FURNACE) { chest = b.getLocation(); furnace = center.getRelative(BlockFace.WEST) .getLocation(); } + break; case UP: if (center.getRelative(BlockFace.DOWN).getType() == Material.FURNACE) { chest = b.getLocation(); furnace = center.getRelative(BlockFace.DOWN) .getLocation(); } + break; case DOWN: if (center.getRelative(BlockFace.UP).getType() == Material.FURNACE) { chest = b.getLocation(); furnace = center.getRelative(BlockFace.UP) .getLocation(); } + break; } } diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 1df1b8db..7196b8ec 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -8,15 +8,11 @@ import java.util.UUID; import org.bukkit.ChatColor; -import org.bukkit.DyeColor; import org.bukkit.Material; import org.bukkit.block.BlockFace; -import org.bukkit.block.banner.Pattern; -import org.bukkit.block.banner.PatternType; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.BannerMeta; import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; @@ -75,17 +71,6 @@ public MenuBuilder(String defaultFactory) { } } - private DecorationStack createBannerDeco(PatternType... types) { - ItemStack is = new ItemStack(Material.BANNER); - BannerMeta bm = (BannerMeta) is.getItemMeta(); - bm.setBaseColor(DyeColor.GRAY); - for (PatternType type : types) { - bm.addPattern(new Pattern(DyeColor.YELLOW, type)); - } - is.setItemMeta(bm); - return new DecorationStack(is); - } - public void openFactoryBrowser(Player p, String startingFac) { ClickableInventory.forceCloseInventory(p); IFactoryEgg egg; From e4e03986717a1c4fe215453388e245035338a1a5 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 19 Aug 2016 04:53:06 +0200 Subject: [PATCH 429/459] Persist recipes of a factory --- pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 42 ++++++++++++------- .../igotyou/FactoryMod/FactoryModManager.java | 26 ++++++++---- .../FactoryMod/eggs/FurnCraftChestEgg.java | 27 ++++++++++-- .../factories/FurnCraftChestFactory.java | 8 ++-- .../FurnCraftChestInteractionManager.java | 6 +-- .../FactoryMod/recipes/AOERepairRecipe.java | 4 +- .../FactoryMod/recipes/CompactingRecipe.java | 8 ++-- .../recipes/DecompactingRecipe.java | 6 +-- .../DeterministicEnchantingRecipe.java | 4 +- .../recipes/FactoryMaterialReturnRecipe.java | 4 +- .../igotyou/FactoryMod/recipes/IRecipe.java | 7 +++- .../FactoryMod/recipes/InputRecipe.java | 10 ++++- .../FactoryMod/recipes/LoreEnchantRecipe.java | 4 +- .../FactoryMod/recipes/ProductionRecipe.java | 6 +-- .../FactoryMod/recipes/PylonRecipe.java | 6 +-- .../recipes/RandomEnchantingRecipe.java | 4 +- .../recipes/RandomOutputRecipe.java | 4 +- .../FactoryMod/recipes/RepairRecipe.java | 6 +-- .../FactoryMod/recipes/Upgraderecipe.java | 6 +-- .../FactoryMod/utility/FileHandler.java | 14 +++++-- .../FactoryMod/utility/MenuBuilder.java | 4 +- 22 files changed, 132 insertions(+), 76 deletions(-) diff --git a/pom.xml b/pom.xml index 65d63927..d6c0e359 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.12 + 2.2.13 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/com/github/igotyou/FactoryMod/ConfigParser.java index 5f80b2d8..0faed7dc 100644 --- a/src/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/com/github/igotyou/FactoryMod/ConfigParser.java @@ -161,11 +161,12 @@ private void parseRecipes(ConfigurationSection config) { if (recipe == null) { plugin.warning(String.format("Recipe %s unable to be added.", key)); } else { - if (useYamlIdentifers) { - recipes.put(key, recipe); + if (recipes.containsKey(recipe.getIdentifier())) { + plugin.warning("Recipe identifier " + recipe.getIdentifier() + " was found twice in the config. One instance was skipped"); } - { - recipes.put(recipe.getRecipeName(), recipe); + else { + recipes.put(recipe.getIdentifier(), recipe); + manager.registerRecipe(recipe); } } } @@ -434,6 +435,15 @@ private IRecipe parseRecipe(ConfigurationSection config) { plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); return null; } + String identifier = config.getString("identifier"); + if (identifier == null) { + if (useYamlIdentifers) { + identifier = config.getName(); + } + else { + identifier = name; + } + } String prodTime = config.getString("production_time"); if (prodTime == null) { plugin.warning("No production time specied for recipe " + name + ". Skipping it"); @@ -451,7 +461,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { .getConfigurationSection("input")); ItemMap output = parseItemMap(config .getConfigurationSection("output")); - result = new ProductionRecipe(name, productionTime, input, output); + result = new ProductionRecipe(identifier, name, productionTime, input, output); break; case "COMPACT": ItemMap extraMats = parseItemMap(config @@ -466,20 +476,20 @@ private IRecipe parseRecipe(ConfigurationSection config) { plugin.warning(mat + " is not a valid material to exclude: " + config.getCurrentPath()); } } - result = new CompactingRecipe(extraMats, excluded, name, + result = new CompactingRecipe(identifier, extraMats, excluded, name, productionTime, compactedLore); break; case "DECOMPACT": ItemMap extraMate = parseItemMap(config .getConfigurationSection("input")); String decompactedLore = config.getString("compact_lore"); - result = new DecompactingRecipe(extraMate, name, productionTime, + result = new DecompactingRecipe(identifier, extraMate, name, productionTime, decompactedLore); break; case "REPAIR": ItemMap rep = parseItemMap(config.getConfigurationSection("input")); int health = config.getInt("health_gained"); - result = new RepairRecipe(name, productionTime, rep, health); + result = new RepairRecipe(identifier, name, productionTime, rep, health); break; case "UPGRADE": ItemMap upgradeCost = parseItemMap(config @@ -491,7 +501,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { + " for upgrade recipe " + name); result = null; } else { - result = new Upgraderecipe(name, productionTime, upgradeCost, egg); + result = new Upgraderecipe(identifier, name, productionTime, upgradeCost, egg); } break; case "AOEREPAIR": @@ -502,7 +512,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { .getItemStackRepresentation().get(0); int repPerEssence = config.getInt("repair_per_essence"); int range = config.getInt("range"); - result = new AOERepairRecipe(name, productionTime, essence, range, + result = new AOERepairRecipe(identifier, name, productionTime, essence, range, repPerEssence); } else { plugin.severe("No essence specified for AOEREPAIR " + config.getCurrentPath()); @@ -515,7 +525,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { ItemMap out = parseItemMap(config .getConfigurationSection("output")); int weight = config.getInt("weight"); - result = new PylonRecipe(name, productionTime, in, out, weight); + result = new PylonRecipe(identifier, name, productionTime, in, out, weight); break; case "ENCHANT": ItemMap inp = parseItemMap(config @@ -523,7 +533,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { Enchantment enchant = Enchantment.getByName(config.getString("enchant")); int level = config.getInt("level", 1); ItemMap tool = parseItemMap(config.getConfigurationSection("enchant_item")); - result = new DeterministicEnchantingRecipe(name, productionTime, inp, tool, enchant, level); + result = new DeterministicEnchantingRecipe(identifier, name, productionTime, inp, tool, enchant, level); break; case "RANDOM": ItemMap inpu = parseItemMap(config.getConfigurationSection("input")); @@ -552,13 +562,13 @@ private IRecipe parseRecipe(ConfigurationSection config) { if (Math.abs(totalChance - 1.0) > 0.001) { plugin.warning("Sum of output chances for recipe " + name + " is not 1.0. Total sum is: " + totalChance); } - result = new RandomOutputRecipe(name, productionTime, inpu, outputs, displayThis); + result = new RandomOutputRecipe(identifier, name, productionTime, inpu, outputs, displayThis); break; case "COSTRETURN": ItemMap costIn = parseItemMap(config .getConfigurationSection("input")); double factor = config.getDouble("factor", 1.0); - result = new FactoryMaterialReturnRecipe(name, productionTime, costIn, factor); + result = new FactoryMaterialReturnRecipe(identifier, name, productionTime, costIn, factor); break; case "LOREENCHANT": ItemMap loreCostIn = parseItemMap(config.getConfigurationSection("input")); @@ -570,7 +580,7 @@ private IRecipe parseRecipe(ConfigurationSection config) { result = null; break; } - result = new LoreEnchantRecipe(name, productionTime, loreCostIn, loreTool, appliedLore, overwrittenLore); + result = new LoreEnchantRecipe(identifier, name, productionTime, loreCostIn, loreTool, appliedLore, overwrittenLore); break; default: plugin.severe("Could not identify type " + config.getString("type") @@ -623,7 +633,7 @@ public void assignRecipesToFactories() { } for(IRecipe reci : recipes.values()) { if (!usedRecipes.contains(reci)) { - plugin.warning("The recipe " + reci.getRecipeName() + " is specified in the config, but not used in any factory"); + plugin.warning("The recipe " + reci.getName() + " is specified in the config, but not used in any factory"); } } } diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/FactoryModManager.java index d75fc603..bf021ae1 100644 --- a/src/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -60,13 +60,12 @@ public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, boolean nameLayerEnabled, int redstonePowerOn, int redstoneRecipeChange, boolean logInventories, - Map factoryRenames, Map recipes) { + Map factoryRenames) { this.plugin = plugin; this.factoryInteractionMaterial = factoryInteractionMaterial; this.citadelEnabled = citadelEnabled; this.redstonePowerOn = redstonePowerOn; this.redstoneRecipeChange = redstoneRecipeChange; - this.recipes = recipes; this.fileHandler = new FileHandler(this, factoryRenames); if(nameLayerEnabled) { @@ -91,6 +90,7 @@ public FactoryModManager(FactoryMod plugin, possibleInteractionBlock = new HashSet(); factories = new HashSet(); totalSetupCosts = new HashMap(); + recipes = new HashMap(); // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); @@ -596,14 +596,22 @@ public HashSet getAllFactories() { } /** - * Gets the recipe with the given name, if it exists - * @param name Name of the recipe - * @return Recipe with the given name or null if either the recipe doesn't exist or the given string was null + * Gets the recipe with the given identifier, if it exists + * @param name Identifier of the recipe + * @return Recipe with the given identifier or null if either the recipe doesn't exist or the given string was null */ - public IRecipe getRecipe(String name) { - if (name == null) { + public IRecipe getRecipe(String identifier) { + if (identifier == null) { return null; } - return recipes.get(name); + return recipes.get(identifier); } -} + + /** + * Registers a recipe and add it to the recipe tracking. + * @param recipe Recipe to register + */ + public void registerRecipe(IRecipe recipe) { + recipes.put(recipe.getIdentifier(), recipe); + } +} diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 138112f4..9f495149 100644 --- a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -1,11 +1,13 @@ package com.github.igotyou.FactoryMod.eggs; +import java.util.ArrayList; import java.util.List; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager; @@ -97,18 +99,37 @@ public long getBreakGracePeriod() { } public Factory revive(List blocks, int health, - String selectedRecipe, int productionTimer, int breakTime) { + String selectedRecipe, int productionTimer, int breakTime, List recipeStrings) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(health, maximumHealth, breakTime, healthPerDamagePeriod, breakGracePeriod); + List currRecipes = new ArrayList (recipes); + for(String recName : recipeStrings) { + boolean found = false; + for(IRecipe exRec : currRecipes) { + if (exRec.getIdentifier().equals(recName)) { + found = true; + break; + } + } + if (!found) { + IRecipe rec = FactoryMod.getManager().getRecipe(recName); + if (rec == null) { + FactoryMod.getPlugin().warning("Factory at " + blocks.get(0).toString() + " had recipe " + recName + " saved, but it could not be loaded from the config"); + } + else { + currRecipes.add(rec); + } + } + } FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, - fpm, fccs, updateTime, name, recipes); + fpm, fccs, updateTime, name, currRecipes); fccim.setFactory(fccf); phrm.setFactory(fccf); for (IRecipe recipe : recipes) { - if (recipe.getRecipeName().equals(selectedRecipe)) { + if (recipe.getName().equals(selectedRecipe)) { fccf.setRecipe(recipe); } } diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index bf8d7c5c..42ce3871 100644 --- a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -165,7 +165,7 @@ public void attemptToActivate(Player p, boolean onStartUp) { } p.sendMessage(ChatColor.GREEN + "Activated " + name + " with recipe: " - + currentRecipe.getRecipeName()); + + currentRecipe.getName()); activator = p.getUniqueId(); } activate(); @@ -309,20 +309,20 @@ public void run() { else if (currentProductionTimer >= currentRecipe .getProductionTime()) { LoggingUtils.log("Executing recipe " - + currentRecipe.getRecipeName() + " for " + + currentRecipe.getName() + " for " + getLogData()); RecipeExecuteEvent ree = new RecipeExecuteEvent(this, (InputRecipe) currentRecipe); Bukkit.getPluginManager().callEvent(ree); if (ree.isCancelled()) { LoggingUtils.log("Executing recipe " - + currentRecipe.getRecipeName() + " for " + + currentRecipe.getName() + " for " + getLogData() + " was cancelled over the event"); return; } sendActivatorMessage(ChatColor.GOLD - + currentRecipe.getRecipeName() + " in " + name + + currentRecipe.getName() + " in " + name + " completed"); if (currentRecipe instanceof Upgraderecipe) { // this if else might look a bit weird, but because diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 236af89a..671e0922 100644 --- a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -108,7 +108,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { .getChest())) { // chest interaction if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff ClickableInventory ci = new ClickableInventory(54, fccf - .getCurrentRecipe().getRecipeName()); + .getCurrentRecipe().getName()); int index = 4; List inp = ((InputRecipe) fccf.getCurrentRecipe()) .getInputRepresentation(fccf.getInventory()); @@ -182,7 +182,7 @@ public void clicked(Player arg0) { + " seconds remaining until current run is complete"); } p.sendMessage(ChatColor.GOLD + "Currently selected recipe: " - + fccf.getCurrentRecipe().getRecipeName()); + + fccf.getCurrentRecipe().getName()); p.sendMessage(ChatColor.GOLD + "Currently at " + fccf.getRepairManager().getHealth() + " health"); if (fccf.getRepairManager().inDisrepair()) { @@ -236,7 +236,7 @@ public void clicked(Player p) { fccf.setRecipe(recipes.get(this)); p.sendMessage(ChatColor.GREEN + "Switched recipe to " - + recipes.get(this).getRecipeName()); + + recipes.get(this).getName()); FactoryMod.sendResponse("RecipeSwitch", p); } diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index 57199ee5..bd5d8d6f 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -26,9 +26,9 @@ public class AOERepairRecipe extends InputRecipe { private int repairPerEssence; private int range; - public AOERepairRecipe(String name, int productionTime, ItemStack essence, + public AOERepairRecipe(String identifier, String name, int productionTime, ItemStack essence, int range, int repairPerEssence) { - super(name, productionTime, new ItemMap(essence)); + super(identifier, name, productionTime, new ItemMap(essence)); this.essence = essence; this.range = range; this.repairPerEssence = repairPerEssence; diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 5c815e47..fac2cd06 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -25,9 +25,9 @@ public class CompactingRecipe extends InputRecipe { private List excludedMaterials; private String compactedLore; - public CompactingRecipe(ItemMap input, List excludedMaterial, + public CompactingRecipe(String identifier, ItemMap input, List excludedMaterial, String name, int productionTime, String compactedLore) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.excludedMaterials = excludedMaterial; this.compactedLore = compactedLore; } @@ -51,7 +51,7 @@ public int getProductionTime() { return productionTime; } - public String getRecipeName() { + public String getName() { return name; } @@ -124,7 +124,7 @@ public List getOutputRepresentation(Inventory i) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.CHEST); ItemMeta im = res.getItemMeta(); - im.setDisplayName(getRecipeName()); + im.setDisplayName(getName()); res.setItemMeta(im); return res; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 97b71efc..e2428eaa 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -22,9 +22,9 @@ public class DecompactingRecipe extends InputRecipe { private String compactedLore; - public DecompactingRecipe(ItemMap input, String name, int productionTime, + public DecompactingRecipe(String identifier, ItemMap input, String name, int productionTime, String compactedLore) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.compactedLore = compactedLore; } @@ -96,7 +96,7 @@ public List getInputRepresentation(Inventory i) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.CHEST); ItemMeta im = res.getItemMeta(); - im.setDisplayName(getRecipeName()); + im.setDisplayName(getName()); res.setItemMeta(im); return res; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index cd2ab171..304a1a8c 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -19,9 +19,9 @@ public class DeterministicEnchantingRecipe extends InputRecipe { private int level; private ItemMap tool; - public DeterministicEnchantingRecipe(String name, int productionTime, + public DeterministicEnchantingRecipe(String identifier, String name, int productionTime, ItemMap input, ItemMap tool, Enchantment enchant, int level) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.enchant = enchant; this.tool = tool; this.level = level; diff --git a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java index 0e9e53b7..3c1cad80 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -27,9 +27,9 @@ public class FactoryMaterialReturnRecipe extends InputRecipe { private double factor; - public FactoryMaterialReturnRecipe(String name, int productionTime, + public FactoryMaterialReturnRecipe(String identifier, String name, int productionTime, ItemMap input, double factor) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.factor = factor; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java index 10a2b012..e6b964c9 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -15,7 +15,12 @@ public interface IRecipe { * @return The identifier for this recipe, which is used both internally and * to display the recipe to a player */ - public String getRecipeName(); + public String getName(); + + /** + * @return A unique identifier for this recipe + */ + public String getIdentifier(); /** * @return How long this recipe takes for one run in ticks diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 56d10e6d..7394e096 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -23,11 +23,13 @@ public abstract class InputRecipe implements IRecipe { protected int productionTime; protected ItemMap input; protected int fuel_consumption_intervall = -1; + protected String identifier; - public InputRecipe(String name, int productionTime, ItemMap input) { + public InputRecipe(String identifier, String name, int productionTime, ItemMap input) { this.name = name; this.productionTime = productionTime; this.input = input; + this.identifier = identifier; } /** @@ -62,7 +64,7 @@ public InputRecipe(String name, int productionTime, ItemMap input) { */ public abstract List getOutputRepresentation(Inventory i); - public String getRecipeName() { + public String getName() { return name; } @@ -85,6 +87,10 @@ public ItemMap getInput() { public boolean enoughMaterialAvailable(Inventory i) { return input.isContainedIn(i); } + + public String getIdentifier() { + return identifier; + } /** * @return A single itemstack which is used to represent this recipe as a diff --git a/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java index 63747805..b0587ceb 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -19,9 +19,9 @@ public class LoreEnchantRecipe extends InputRecipe { private List overwritenLore; private ItemMap tool; - public LoreEnchantRecipe(String name, int productionTime, ItemMap input, ItemMap tool, List appliedLore, + public LoreEnchantRecipe(String identifier, String name, int productionTime, ItemMap input, ItemMap tool, List appliedLore, List overwritenLore) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.overwritenLore = overwritenLore; this.appliedLore = appliedLore; this.tool = tool; diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 875dddd5..a5157e10 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -20,9 +20,9 @@ public class ProductionRecipe extends InputRecipe { private ItemMap output; - public ProductionRecipe(String name, int productionTime, ItemMap inputs, + public ProductionRecipe(String identifier, String name, int productionTime, ItemMap inputs, ItemMap output) { - super(name, productionTime, inputs); + super(identifier, name, productionTime, inputs); this.output = output; } @@ -82,7 +82,7 @@ public ItemStack getRecipeRepresentation() { } else { res = out.get(0); } - ISUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index da6a7cc1..82a15252 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -23,9 +23,9 @@ public class PylonRecipe extends InputRecipe { private static int globalLimit; private int weight; - public PylonRecipe(String name, int productionTime, ItemMap input, + public PylonRecipe(String identifier, String name, int productionTime, ItemMap input, ItemMap output, int weight) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.output = output; this.weight = weight; } @@ -82,7 +82,7 @@ public ItemStack getRecipeRepresentation() { } else { res = out.get(0); } - ISUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getName()); return res; } diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index 2575af10..31ce853d 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -33,9 +33,9 @@ public RandomEnchant(Enchantment enchant, int level, double chance) { } } - public RandomEnchantingRecipe(String name, int productionTime, + public RandomEnchantingRecipe(String identifier, String name, int productionTime, ItemMap input, Material tool, List enchants) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.enchants = enchants; this.tool = tool; if (rng == null) { diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java index 89ce9878..660fa343 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -20,9 +20,9 @@ public class RandomOutputRecipe extends InputRecipe { private static Random rng; private ItemMap lowestChanceMap; - public RandomOutputRecipe(String name, int productionTime, ItemMap input, + public RandomOutputRecipe(String identifier, String name, int productionTime, ItemMap input, Map outputs, ItemMap displayOutput) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.outputs = outputs; if (rng == null) { rng = new Random(); diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index fd1704bd..098dae28 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -22,9 +22,9 @@ public class RepairRecipe extends InputRecipe { private int healthPerRun; - public RepairRecipe(String name, int productionTime, ItemMap input, + public RepairRecipe(String identifier, String name, int productionTime, ItemMap input, int healthPerRun) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.healthPerRun = healthPerRun; } @@ -60,7 +60,7 @@ public void applyEffect(Inventory i, Factory f) { public ItemStack getRecipeRepresentation() { ItemStack res = new ItemStack(Material.FURNACE); - ISUtils.setName(res, getRecipeName()); + ISUtils.setName(res, getName()); return res; } } diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 92294f59..deb83805 100644 --- a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -23,9 +23,9 @@ public class Upgraderecipe extends InputRecipe { private IFactoryEgg egg; - public Upgraderecipe(String name, int productionTime, ItemMap input, + public Upgraderecipe(String identifier, String name, int productionTime, ItemMap input, IFactoryEgg egg) { - super(name, productionTime, input); + super(identifier, name, productionTime, input); this.egg = egg; } @@ -95,7 +95,7 @@ public List getOutputRepresentation(Inventory i) { ISUtils.setName(fur, egg.getName()); ISUtils.setLore(fur, ChatColor.LIGHT_PURPLE + "Recipes:"); for (IRecipe rec : ((FurnCraftChestEgg) egg).getRecipes()) { - ISUtils.addLore(fur, ChatColor.YELLOW + rec.getRecipeName()); + ISUtils.addLore(fur, ChatColor.YELLOW + rec.getName()); } res.add(fur); ItemStack che = new ItemStack(Material.CHEST); diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java index f76a2766..58bcd3eb 100644 --- a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -83,7 +83,12 @@ public void save(Collection factories) { .getRepairManager()).getBreakTime()); config.set(current + ".runtime", fccf.getRunningTime()); config.set(current + ".selectedRecipe", fccf - .getCurrentRecipe().getRecipeName()); + .getCurrentRecipe().getName()); + List recipeList = new LinkedList(); + for(IRecipe rec : fccf.getRecipes()) { + recipeList.add(rec.getIdentifier()); + } + config.set(current + ".recipes", recipeList); if (fccf.getActivator() == null) { config.set(current + ".activator", "null"); } @@ -91,7 +96,7 @@ public void save(Collection factories) { config.set(current + ".activator", fccf.getActivator().toString()); } for(IRecipe i : ((FurnCraftChestFactory) f).getRecipes()) { - config.set(current + ".runcounts." + i.getRecipeName(), fccf.getRunCount(i)); + config.set(current + ".runcounts." + i.getName(), fccf.getRunCount(i)); } } else if (f instanceof Pipe) { Pipe p = (Pipe) f; @@ -196,8 +201,9 @@ private void loadFromFile(File f, Map eggs) { int health = current.getInt("health"); int breakTime = current.getInt("breakTime", 0); String selectedRecipe = current.getString("selectedRecipe"); + List recipes = current.getStringList("recipes"); FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, - runtime, breakTime); + runtime, breakTime, recipes); String activator = current.getString("activator", "null"); UUID acti; if (activator.equals("null")) { @@ -212,7 +218,7 @@ private void loadFromFile(File f, Map eggs) { for(String countKey : runCounts.getKeys(false)) { int runs = runCounts.getInt(countKey); for(IRecipe r : fac.getRecipes()) { - if (r.getRecipeName().equals(countKey)) { + if (r.getName().equals(countKey)) { fac.setRunCount(r, runs); break; } diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index 7196b8ec..f823d522 100644 --- a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -392,13 +392,13 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { .getEgg(factoryViewed.get(p.getUniqueId())); InputRecipe rec = null; for (IRecipe recipe : egg.getRecipes()) { - if (recipe == null || recipe.getRecipeName() == null) { + if (recipe == null || recipe.getName() == null) { FactoryMod.getPlugin().warning( "Null recipe or recipe name registered with " + egg.getName()); continue; } - if (recipeName.equals(recipe.getRecipeName())) { + if (recipeName.equals(recipe.getName())) { rec = (InputRecipe) recipe; break; } From e035ef3cf95f49b6361e551968d02545d93a3dcc Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 19 Aug 2016 04:59:07 +0200 Subject: [PATCH 430/459] Make maven a bit happier --- pom.xml | 13 ++++++------- .../com/github/igotyou/FactoryMod/ConfigParser.java | 0 .../com/github/igotyou/FactoryMod/FactoryMod.java | 0 .../igotyou/FactoryMod/FactoryModManager.java | 0 .../commands/FactoryModCommandHandler.java | 0 .../FactoryMod/commands/commands/Create.java | 0 .../igotyou/FactoryMod/commands/commands/Menu.java | 0 .../igotyou/FactoryMod/eggs/FurnCraftChestEgg.java | 0 .../github/igotyou/FactoryMod/eggs/IFactoryEgg.java | 0 .../com/github/igotyou/FactoryMod/eggs/PipeEgg.java | 0 .../github/igotyou/FactoryMod/eggs/SorterEgg.java | 0 .../FactoryMod/events/FactoryActivateEvent.java | 0 .../FactoryMod/events/ItemTransferEvent.java | 0 .../FactoryMod/events/RecipeExecuteEvent.java | 0 .../igotyou/FactoryMod/factories/Factory.java | 0 .../FactoryMod/factories/FurnCraftChestFactory.java | 0 .../github/igotyou/FactoryMod/factories/Pipe.java | 0 .../github/igotyou/FactoryMod/factories/Sorter.java | 0 .../FurnCraftChestInteractionManager.java | 0 .../interactionManager/IInteractionManager.java | 0 .../interactionManager/PipeInteractionManager.java | 0 .../SorterInteractionManager.java | 0 .../FactoryMod/listeners/CompactItemListener.java | 0 .../FactoryMod/listeners/FactoryModListener.java | 0 .../FactoryMod/listeners/NetherPortalListener.java | 0 .../powerManager/FurnacePowerManager.java | 0 .../FactoryMod/powerManager/IPowerManager.java | 0 .../igotyou/FactoryMod/recipes/AOERepairRecipe.java | 0 .../FactoryMod/recipes/CompactingRecipe.java | 0 .../FactoryMod/recipes/DecompactingRecipe.java | 0 .../recipes/DeterministicEnchantingRecipe.java | 0 .../recipes/FactoryMaterialReturnRecipe.java | 0 .../github/igotyou/FactoryMod/recipes/IRecipe.java | 0 .../igotyou/FactoryMod/recipes/InputRecipe.java | 0 .../FactoryMod/recipes/LoreEnchantRecipe.java | 0 .../FactoryMod/recipes/ProductionRecipe.java | 0 .../igotyou/FactoryMod/recipes/PylonRecipe.java | 0 .../FactoryMod/recipes/RandomEnchantingRecipe.java | 0 .../FactoryMod/recipes/RandomOutputRecipe.java | 0 .../igotyou/FactoryMod/recipes/RepairRecipe.java | 0 .../igotyou/FactoryMod/recipes/Upgraderecipe.java | 0 .../FactoryMod/repairManager/IRepairManager.java | 0 .../NoRepairDestroyOnBreakManager.java | 0 .../PercentageHealthRepairManager.java | 0 .../structures/BlockFurnaceStructure.java | 0 .../structures/FurnCraftChestStructure.java | 0 .../FactoryMod/structures/MultiBlockStructure.java | 0 .../FactoryMod/structures/PipeStructure.java | 0 .../FactoryMod/utility/FactoryGarbageCollector.java | 0 .../igotyou/FactoryMod/utility/FileHandler.java | 0 .../igotyou/FactoryMod/utility/LoggingUtils.java | 0 .../igotyou/FactoryMod/utility/MenuBuilder.java | 0 config.yml => src/main/resources/config.yml | 0 .../main/resources/configCivcraft.yml | 0 plugin.yml => src/main/resources/plugin.yml | 0 55 files changed, 6 insertions(+), 7 deletions(-) rename src/{ => main/java}/com/github/igotyou/FactoryMod/ConfigParser.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/FactoryMod.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/FactoryModManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/commands/commands/Create.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/commands/commands/Menu.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/eggs/PipeEgg.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/eggs/SorterEgg.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/factories/Factory.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/factories/Pipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/factories/Sorter.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/IRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/InputRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/structures/PipeStructure.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/utility/FileHandler.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/utility/LoggingUtils.java (100%) rename src/{ => main/java}/com/github/igotyou/FactoryMod/utility/MenuBuilder.java (100%) rename config.yml => src/main/resources/config.yml (100%) rename configCivcraft.yml => src/main/resources/configCivcraft.yml (100%) rename plugin.yml => src/main/resources/plugin.yml (100%) diff --git a/pom.xml b/pom.xml index d6c0e359..6c2130eb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,20 +10,20 @@ https://github.com/Civcraft/FactoryMod - 1.7 - 1.7 + 1.8 + 1.8 - ${basedir}/src - ${basedir} - *.yml - license.txt + LICENSE.txt + + + src/main/resources true @@ -60,7 +60,6 @@ 1.3 provided - diff --git a/src/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/ConfigParser.java rename to src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java diff --git a/src/com/github/igotyou/FactoryMod/FactoryMod.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/FactoryMod.java rename to src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java diff --git a/src/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/FactoryModManager.java rename to src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java diff --git a/src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java b/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java rename to src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Create.java b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Create.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/commands/commands/Create.java rename to src/main/java/com/github/igotyou/FactoryMod/commands/commands/Create.java diff --git a/src/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Menu.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/commands/commands/Menu.java rename to src/main/java/com/github/igotyou/FactoryMod/commands/commands/Menu.java diff --git a/src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java rename to src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java diff --git a/src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java rename to src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java diff --git a/src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/eggs/PipeEgg.java rename to src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java diff --git a/src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/SorterEgg.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/eggs/SorterEgg.java rename to src/main/java/com/github/igotyou/FactoryMod/eggs/SorterEgg.java diff --git a/src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java rename to src/main/java/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java diff --git a/src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java rename to src/main/java/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java diff --git a/src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java rename to src/main/java/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java diff --git a/src/com/github/igotyou/FactoryMod/factories/Factory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Factory.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/factories/Factory.java rename to src/main/java/com/github/igotyou/FactoryMod/factories/Factory.java diff --git a/src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java rename to src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java diff --git a/src/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Pipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/factories/Pipe.java rename to src/main/java/com/github/igotyou/FactoryMod/factories/Pipe.java diff --git a/src/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Sorter.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/factories/Sorter.java rename to src/main/java/com/github/igotyou/FactoryMod/factories/Sorter.java diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java rename to src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java rename to src/main/java/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java rename to src/main/java/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java diff --git a/src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java rename to src/main/java/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java diff --git a/src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java rename to src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java rename to src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java diff --git a/src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java rename to src/main/java/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java diff --git a/src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/main/java/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java rename to src/main/java/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java diff --git a/src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/main/java/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java rename to src/main/java/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/IRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/InputRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java diff --git a/src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java rename to src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java diff --git a/src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java rename to src/main/java/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java diff --git a/src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java rename to src/main/java/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java diff --git a/src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java rename to src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java diff --git a/src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java rename to src/main/java/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java diff --git a/src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java rename to src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java diff --git a/src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java rename to src/main/java/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java diff --git a/src/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/structures/PipeStructure.java rename to src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java diff --git a/src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java rename to src/main/java/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java diff --git a/src/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/utility/FileHandler.java rename to src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java diff --git a/src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java b/src/main/java/com/github/igotyou/FactoryMod/utility/LoggingUtils.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/utility/LoggingUtils.java rename to src/main/java/com/github/igotyou/FactoryMod/utility/LoggingUtils.java diff --git a/src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java similarity index 100% rename from src/com/github/igotyou/FactoryMod/utility/MenuBuilder.java rename to src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java diff --git a/config.yml b/src/main/resources/config.yml similarity index 100% rename from config.yml rename to src/main/resources/config.yml diff --git a/configCivcraft.yml b/src/main/resources/configCivcraft.yml similarity index 100% rename from configCivcraft.yml rename to src/main/resources/configCivcraft.yml diff --git a/plugin.yml b/src/main/resources/plugin.yml similarity index 100% rename from plugin.yml rename to src/main/resources/plugin.yml From fd047e5e729b1b6502484571cce3390380bd2821 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 19 Aug 2016 05:11:44 +0200 Subject: [PATCH 431/459] Let player hit factory in creative --- .../igotyou/FactoryMod/listeners/FactoryModListener.java | 5 +++++ .../com/github/igotyou/FactoryMod/utility/FileHandler.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index 5c3e52ce..d5f50863 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -2,6 +2,7 @@ import java.util.List; +import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -48,6 +49,10 @@ public void blockBreakEvent(BlockBreakEvent e) { Factory c = manager.getFactoryAt(block); if (c != null) { c.getInteractionManager().blockBreak(e.getPlayer(), block); + //let creative player interact without breaking it + if (e.getPlayer().getGameMode() == GameMode.CREATIVE) { + e.setCancelled(true); + } } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java index 58bcd3eb..3df20cab 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -202,6 +202,9 @@ private void loadFromFile(File f, Map eggs) { int breakTime = current.getInt("breakTime", 0); String selectedRecipe = current.getString("selectedRecipe"); List recipes = current.getStringList("recipes"); + if (recipes == null) { + recipes = new LinkedList(); + } FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, runtime, breakTime, recipes); String activator = current.getString("activator", "null"); From 8e9fb8eafc60bcab4a99b51ed8ebcdf6696ac3e1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 19 Aug 2016 05:50:59 +0200 Subject: [PATCH 432/459] Fix lots of random broken shit --- .../igotyou/FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../FurnCraftChestInteractionManager.java | 12 ++++++------ .../FactoryMod/listeners/FactoryModListener.java | 6 ++++-- .../repairManager/PercentageHealthRepairManager.java | 6 ++++-- .../igotyou/FactoryMod/utility/FileHandler.java | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 9f495149..c4bd7f54 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -99,7 +99,7 @@ public long getBreakGracePeriod() { } public Factory revive(List blocks, int health, - String selectedRecipe, int productionTimer, int breakTime, List recipeStrings) { + String selectedRecipe, int productionTimer, long breakTime, List recipeStrings) { FurnCraftChestStructure fccs = new FurnCraftChestStructure(blocks); FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), fuel, fuelConsumptionIntervall); diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 671e0922..5ee7f4a1 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -187,12 +187,12 @@ public void clicked(Player arg0) { + fccf.getRepairManager().getHealth() + " health"); if (fccf.getRepairManager().inDisrepair()) { PercentageHealthRepairManager rm = ((PercentageHealthRepairManager) fccf.getRepairManager()); - long leftTime = rm.getGracePeriod() - rm.getBreakTime(); - long months = leftTime % (60 * 60 * 24 * 30 * 1000); - long days = leftTime - (months * 60 * 60 * 24 * 30 * 1000) - % (60 * 60 * 24 * 1000); - long hours = leftTime - (months * 60 * 60 * 24 * 30 * 1000) - - (days * 60 * 60 * 24 * 1000) % (60 * 60 * 1000); + long leftTime = rm.getGracePeriod() - (System.currentTimeMillis() - rm.getBreakTime()); + long months = leftTime / (60L * 60L * 24L * 30L * 1000L); + long days = (leftTime - (months * 60L * 60L * 24L * 30L * 1000L)) + / (60L * 60L * 24L * 1000L); + long hours = (leftTime - (months * 60L * 60L * 24L * 30L * 1000L) + - (days * 60L * 60L * 24L * 1000L)) / (60L * 60L * 1000L); String time = (months != 0 ? months + " months, " : "") + (days != 0 ? days + " days, " : "") + (hours != 0 ? hours + " hours" : ""); diff --git a/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java index d5f50863..6a43e064 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -48,11 +48,13 @@ public void blockBreakEvent(BlockBreakEvent e) { if (manager.isPossibleInteractionBlock(block.getType())) { Factory c = manager.getFactoryAt(block); if (c != null) { - c.getInteractionManager().blockBreak(e.getPlayer(), block); //let creative player interact without breaking it - if (e.getPlayer().getGameMode() == GameMode.CREATIVE) { + if (e.getPlayer().getGameMode() == GameMode.CREATIVE && e.getPlayer().getInventory().getItemInMainHand() != null + && e.getPlayer().getInventory().getItemInMainHand().getType() == manager.getFactoryInteractionMaterial()) { e.setCancelled(true); + return; } + c.getInteractionManager().blockBreak(e.getPlayer(), block); } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java index c806f21c..f4902027 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -18,7 +18,7 @@ public class PercentageHealthRepairManager implements IRepairManager { private int damageAmountPerDecayIntervall; private long gracePeriod; - public PercentageHealthRepairManager(int initialHealth, int maximumHealth, int breakTime, int damageAmountPerDecayIntervall, long gracePeriod) { + public PercentageHealthRepairManager(int initialHealth, int maximumHealth, long breakTime, int damageAmountPerDecayIntervall, long gracePeriod) { this.health = initialHealth; this.maximumHealth = maximumHealth; this.breakTime = breakTime; @@ -62,7 +62,9 @@ public void repair(int amount) { public void breakIt() { health = 0; - breakTime = System.currentTimeMillis(); + if (breakTime == 0) { + breakTime = System.currentTimeMillis(); + } FactoryMod.getPlugin().getServer().getScheduler() .scheduleSyncDelayedTask(FactoryMod.getPlugin(), new Runnable() { diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java index 3df20cab..ff41064b 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -199,7 +199,7 @@ private void loadFromFile(File f, Map eggs) { } } int health = current.getInt("health"); - int breakTime = current.getInt("breakTime", 0); + long breakTime = current.getLong("breakTime", 0); String selectedRecipe = current.getString("selectedRecipe"); List recipes = current.getStringList("recipes"); if (recipes == null) { From b0cf4124bcce2061cb6cedd50ae88c0ab821aa86 Mon Sep 17 00:00:00 2001 From: ProgrammerDan Date: Fri, 19 Aug 2016 11:00:58 -0400 Subject: [PATCH 433/459] Reinforcement rebalance stage --- src/main/resources/configCivcraft.yml | 74 +++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 41a66e29..616deed6 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -11051,14 +11051,14 @@ recipes: input: stone: material: STONE - amount: 128 + amount: 96 granite: material: STONE amount: 64 durability: 1 coalore: material: COAL_ORE - amount: 24 + amount: 16 output: basicMiner: material: FLINT @@ -11073,14 +11073,14 @@ recipes: input: stone: material: STONE - amount: 128 + amount: 96 granite: material: STONE amount: 64 durability: 5 coalore: material: COAL_ORE - amount: 24 + amount: 16 output: basicMiner: material: FLINT @@ -11095,14 +11095,14 @@ recipes: input: stone: material: STONE - amount: 128 + amount: 96 granite: material: STONE amount: 64 durability: 3 coalore: material: COAL_ORE - amount: 24 + amount: 16 output: basicMiner: material: FLINT @@ -11117,13 +11117,13 @@ recipes: input: inksack: material: INK_SACK - amount: 16 + amount: 8 bone: material: BONE - amount: 24 + amount: 12 string: material: STRING - amount: 32 + amount: 16 output: basicHunter: material: BONE @@ -11138,10 +11138,10 @@ recipes: input: inksack: material: SPIDER_EYE - amount: 32 + amount: 16 bone: material: ROTTEN_FLESH - amount: 64 + amount: 32 output: basicHunter: material: BONE @@ -11156,13 +11156,13 @@ recipes: input: inksack: material: ENDER_PEARL - amount: 16 + amount: 8 bone: material: ROTTEN_FLESH - amount: 32 + amount: 16 string: material: STRING - amount: 32 + amount: 16 output: basicHunter: material: BONE @@ -11180,7 +11180,7 @@ recipes: name: Miner Component lore: - Basic Reinforcement Ingredient - amount: 4 + amount: 3 output: basicRein: @@ -11197,7 +11197,7 @@ recipes: basicHunter: material: BONE name: Hunter Component - amount: 4 + amount: 3 lore: - Basic Reinforcement Ingredient output: @@ -11217,13 +11217,13 @@ recipes: name: Hunter Component lore: - Basic Reinforcement Ingredient - amount: 8 + amount: 6 flint: material: FLINT amount: 24 iron: material: IRON_INGOT - amount: 48 + amount: 32 output: decentMiner: material: QUARTZ @@ -11241,13 +11241,13 @@ recipes: name: Hunter Component lore: - Basic Reinforcement Ingredient - amount: 8 + amount: 6 redstone: material: REDSTONE - amount: 24 + amount: 16 gold: material: GOLD_INGOT - amount: 32 + amount: 24 output: decentMiner: material: QUARTZ @@ -11265,13 +11265,13 @@ recipes: name: Miner Component lore: - Basic Reinforcement Ingredient - amount: 8 + amount: 6 slime: material: SLIME_BALL - amount: 32 + amount: 24 blazeRod: material: BLAZE_ROD - amount: 24 + amount: 16 output: decentHunter: material: SULPHUR @@ -11289,13 +11289,13 @@ recipes: name: Miner Component lore: - Basic Reinforcement Ingredient - amount: 8 + amount: 6 magmaCream: material: MAGMA_CREAM amount: 24 gunpowder: material: SULPHUR - amount: 32 + amount: 24 output: decentHunter: material: SULPHUR @@ -11313,13 +11313,13 @@ recipes: name: Miner Component lore: - Decent Reinforcement Ingredient - amount: 4 + amount: 3 decentHunter: material: SULPHUR name: Hunter Component lore: - Decent Reinforcement Ingredient - amount: 4 + amount: 3 output: slimeball: material: SLIME_BALL @@ -11340,7 +11340,7 @@ recipes: amount: 6 ghastTear: material: GHAST_TEAR - amount: 16 + amount: 12 witherskull: material: SKULL_ITEM durability: 1 @@ -11365,11 +11365,11 @@ recipes: amount: 6 diamond: material: DIAMOND - amount: 32 + amount: 1 lapis: material: INK_SACK durability: 4 - amount: 32 + amount: 10 output: strongMiner: material: PRISMARINE @@ -11388,13 +11388,13 @@ recipes: name: Miner Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 strongHunter: material: GHAST_TEAR name: Hunter Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 output: goodReinforcement: material: MAGMA_CREAM @@ -11435,13 +11435,13 @@ recipes: name: Miner Component lore: - Strong Reinforcement Ingredient - amount: 6 + amount: 4 strongHunter: material: GHAST_TEAR name: Hunter Component lore: - Strong Reinforcement Ingredient - amount: 6 + amount: 4 xp: material: EMERALD_BLOCK amount: 18 @@ -11462,13 +11462,13 @@ recipes: name: Miner Component lore: - Strong Reinforcement Ingredient - amount: 6 + amount: 4 strongHunter: material: GHAST_TEAR name: Hunter Component lore: - Strong Reinforcement Ingredient - amount: 6 + amount: 4 xp: material: EMERALD_BLOCK amount: 12 From 49fb2085de5a518a5f9be011bf13dc2e9168f648 Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Mon, 22 Aug 2016 05:38:50 +0300 Subject: [PATCH 434/459] Balance Changes (#284) * Update configCivcraft.yml * Reduce the amount of dyes required to build dyeing factories and slightly modify fossil drops --- src/main/resources/configCivcraft.yml | 207 ++++++++++++++++++-------- 1 file changed, 143 insertions(+), 64 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 616deed6..8ae83554 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -4517,19 +4517,19 @@ recipes: input: piston: material: PISTON_BASE - amount: 128 + amount: 64 pistonSticky: material: PISTON_STICKY_BASE - amount: 128 + amount: 64 chest: material: CHEST amount: 256 iron: material: IRON_BLOCK - amount: 64 + amount: 32 redstone: material: REDSTONE_BLOCK - amount: 32 + amount: 16 crate: material: CHEST amount: 256 @@ -4592,7 +4592,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 64 + amount: 48 char: material: COAL durability: 1 @@ -4602,7 +4602,7 @@ recipes: amount: 16 anvil: material: ANVIL - amount: 128 + amount: 5 factory: Diamond Armour Forge Upgrade_to_Diamond_Equipment_Forge: production_time: 1h @@ -4612,7 +4612,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 24 + amount: 16 char: material: COAL durability: 1 @@ -4622,7 +4622,7 @@ recipes: amount: 8 anvil: material: ANVIL - amount: 64 + amount: 5 factory: Diamond Equipment Forge Upgrade_to_Diamond_Tools_Forge: production_time: 1h @@ -4632,7 +4632,7 @@ recipes: input: diamond block: material: DIAMOND_BLOCK - amount: 48 + amount: 32 char: material: COAL durability: 1 @@ -4642,7 +4642,7 @@ recipes: amount: 16 anvil: material: ANVIL - amount: 128 + amount: 5 factory: Diamond Tools Forge Upgrade_to_Farmstead_Factory: production_time: 10m @@ -4698,16 +4698,16 @@ recipes: input: diamond: material: DIAMOND_BLOCK - amount: 64 + amount: 20 quartz: material: QUARTZ - amount: 2048 + amount: 1280 lapis: material: LAPIS_BLOCK - amount: 256 + amount: 128 redstone: material: REDSTONE_BLOCK - amount: 256 + amount: 128 factory: Gem Extractor Upgrade_to_Glass_Dying_Factory: production_time: 1h @@ -4723,67 +4723,67 @@ recipes: amount: 576 dye0: material: INK_SACK - amount: 128 + amount: 32 durability: 0 dye1: material: INK_SACK - amount: 128 + amount: 32 durability: 1 dye2: material: INK_SACK - amount: 128 + amount: 32 durability: 2 dye3: material: INK_SACK - amount: 128 + amount: 32 durability: 3 dye4: material: INK_SACK - amount: 128 + amount: 32 durability: 4 dye5: material: INK_SACK - amount: 128 + amount: 32 durability: 5 dye6: material: INK_SACK - amount: 128 + amount: 32 durability: 6 dye7: material: INK_SACK - amount: 128 + amount: 32 durability: 7 dye8: material: INK_SACK - amount: 128 + amount: 32 durability: 8 dye9: material: INK_SACK - amount: 128 + amount: 32 durability: 9 dye10: material: INK_SACK - amount: 128 + amount: 32 durability: 10 dye11: material: INK_SACK - amount: 128 + amount: 32 durability: 11 dye12: material: INK_SACK - amount: 128 + amount: 32 durability: 12 dye13: material: INK_SACK - amount: 128 + amount: 32 durability: 13 dye14: material: INK_SACK - amount: 128 + amount: 32 durability: 14 dye15: material: INK_SACK - amount: 128 + amount: 32 durability: 15 factory: Glass Dying Factory Upgrade_to_Gold_Equipment_Forge: @@ -4915,7 +4915,7 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 128 + amount: 32 wood: material: WOOD durability: -1 @@ -4929,7 +4929,7 @@ recipes: amount: 12 anvil: material: ANVIL - amount: 64 + amount: 5 factory: Iron Equipment Forge Upgrade_to_Iron_Forge_Advanced: production_time: 3600s @@ -4939,14 +4939,14 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 512 + amount: 128 char: material: COAL durability: 1 amount: 1024 anvil: material: ANVIL - amount: 384 + amount: 10 lava: material: LAVA_BUCKET amount: 24 @@ -4959,7 +4959,7 @@ recipes: input: iron block: material: IRON_BLOCK - amount: 192 + amount: 32 char: material: COAL durability: 1 @@ -4991,11 +4991,14 @@ recipes: name: Upgrade to Laboratory fuel_consumption_intervall: 20s input: - cauldron: + redstone: material: REDSTONE - amount: 256 - glass bottle: + amount: 192 + cauldron: material: CAULDRON_ITEM + amount: 16 + slime balls: + material: SLIME_BALL amount: 32 factory: Laboratory Upgrade_to_Netherbrick_Smelter: @@ -5023,13 +5026,13 @@ recipes: input: iron ingot: material: IRON_BLOCK - amount: 96 + amount: 48 coal: material: COAL_BLOCK - amount: 192 + amount: 128 redstone: material: REDSTONE_BLOCK - amount: 48 + amount: 32 factory: Ore Smelter Upgrade_to_Ore_Forge: production_time: 4h @@ -5039,13 +5042,13 @@ recipes: input: iron ingot: material: IRON_BLOCK - amount: 384 + amount: 192 gold ingot: material: GOLD_BLOCK - amount: 192 + amount: 128 coal: material: COAL_BLOCK - amount: 512 + amount: 256 factory: Ore Forge Upgrade_to_Organic_Block_Factory: production_time: 1800s @@ -5084,7 +5087,7 @@ recipes: input: iron: material: IRON_BLOCK - amount: 128 + amount: 64 redstone: material: REDSTONE_BLOCK amount: 32 @@ -5097,7 +5100,7 @@ recipes: amount: 512 anvil: material: ANVIL - amount: 128 + amount: 10 lava: material: LAVA_BUCKET amount: 16 @@ -5115,16 +5118,16 @@ recipes: input: redstone dust: material: REDSTONE_BLOCK - amount: 384 + amount: 128 quartz: material: QUARTZ - amount: 1024 + amount: 768 glass: material: GLASS amount: 512 gold: material: GOLD_BLOCK - amount: 64 + amount: 32 factory: Redstone Electronics Upgrade_to_Redstone_Factory_Basic: production_time: 900s @@ -5134,7 +5137,14 @@ recipes: input: redstone dust: material: REDSTONE - amount: 128 + amount: 384 + stone: + material: STONE + amount: 256 + wood: + material: WOOD + amount: 512 + durability: -1 factory: Redstone Techniques Upgrade_to_Redstone_Mechanics_Factory: production_time: 1800s @@ -5144,16 +5154,16 @@ recipes: input: redstone dust: material: REDSTONE_BLOCK - amount: 384 + amount: 128 quartz: material: QUARTZ - amount: 128 + amount: 256 stone: material: STONE amount: 1024 string: material: STRING - amount: 512 + amount: 256 glowstone: material: GLOWSTONE amount: 512 @@ -5215,16 +5225,19 @@ recipes: amount: 1024 rabbit: material: RABBIT - amount: 256 + amount: 192 bowl: material: BOWL amount: 128 fire: material: FLINT_AND_STEEL - amount: 8 + amount: 4 water: material: WATER_BUCKET amount: 8 + beetroot: + material: BEETROOT + amount: 320 factory: Soup kitchen Upgrade_to_Stone_Smelter: production_time: 10m @@ -5282,6 +5295,70 @@ recipes: wool: material: WOOL amount: 256 + dye0: + material: INK_SACK + amount: 32 + durability: 0 + dye1: + material: INK_SACK + amount: 32 + durability: 1 + dye2: + material: INK_SACK + amount: 32 + durability: 2 + dye3: + material: INK_SACK + amount: 32 + durability: 3 + dye4: + material: INK_SACK + amount: 32 + durability: 4 + dye5: + material: INK_SACK + amount: 32 + durability: 5 + dye6: + material: INK_SACK + amount: 32 + durability: 6 + dye7: + material: INK_SACK + amount: 32 + durability: 7 + dye8: + material: INK_SACK + amount: 32 + durability: 8 + dye9: + material: INK_SACK + amount: 32 + durability: 9 + dye10: + material: INK_SACK + amount: 32 + durability: 10 + dye11: + material: INK_SACK + amount: 32 + durability: 11 + dye12: + material: INK_SACK + amount: 32 + durability: 12 + dye13: + material: INK_SACK + amount: 32 + durability: 13 + dye14: + material: INK_SACK + amount: 32 + durability: 14 + dye15: + material: INK_SACK + amount: 32 + durability: 15 factory: Wool Processing Upgrade_to_Fancy_Stone_Smelter: name: Upgrade to Fancy Stone Smelter @@ -6719,7 +6796,7 @@ recipes: input: ironblocks: material: IRON_BLOCK - amount: 384 + amount: 128 aether: material: GOLD_NUGGET amount: 500 @@ -6730,7 +6807,7 @@ recipes: enchant: DURABILITY xp: material: EMERALD_BLOCK - amount: 22 + amount: 44 Upgrade_to_Grandmaster_Transmuter: production_time: 4h type: UPGRADE @@ -6740,7 +6817,7 @@ recipes: input: ironblocks: material: DIAMOND_BLOCK - amount: 32 + amount: 16 aether: material: GOLD_NUGGET amount: 78 @@ -10176,7 +10253,8 @@ recipes: level: 5 ub: enchant: DURABILITY - level: 5 + level: 4 + durability: 1500 godbook1: chance: 0.00120909 power5book: @@ -10383,7 +10461,7 @@ recipes: chance: 0.0037038 item: material: COAL - amount: 32 + amount: 16 durability: 1 lore: - Compacted Item @@ -10391,7 +10469,7 @@ recipes: chance: 0.0037012 item: material: COAL_ORE - amount: 5 + amount: 2 lore: - Cave Concentrate mid1: @@ -10644,7 +10722,8 @@ recipes: level: 5 ub: enchant: DURABILITY - level: 5 + level: 4 + durability: 1500 godbook1: chance: 0.00120909 power5book: @@ -10851,7 +10930,7 @@ recipes: chance: 0.0037038 item: material: COAL - amount: 32 + amount: 16 durability: 1 lore: - Compacted Item @@ -10859,7 +10938,7 @@ recipes: chance: 0.0037012 item: material: COAL_ORE - amount: 5 + amount: 2 lore: - Cave Concentrate mid1: From 83c2a02ccdb1aa4aa5f5c09f378c37d1cd0fb148 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 26 Aug 2016 05:36:33 +0200 Subject: [PATCH 435/459] No longer force close inventories in gui --- pom.xml | 2 +- .../com/github/igotyou/FactoryMod/utility/MenuBuilder.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 6c2130eb..4cac30cc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.13 + 2.2.14 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index f823d522..b0ae3a1f 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -72,7 +72,6 @@ public MenuBuilder(String defaultFactory) { } public void openFactoryBrowser(Player p, String startingFac) { - ClickableInventory.forceCloseInventory(p); IFactoryEgg egg; if (startingFac == null) { egg = defaultMenu; @@ -158,7 +157,6 @@ public void clicked(Player arg0) { } private void openRecipeBrowser(Player p, String facName) { - ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); List recipes = egg.getRecipes(); int size = (recipes.size() / 9) + 2; @@ -203,7 +201,6 @@ public void clicked(Player arg0) { } private void openSetupBrowser(Player p, String facName) { - ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager.getEgg(facName); FurnCraftChestEgg parEgg = (FurnCraftChestEgg) manager .getEgg(parentFactories.get(facName)); @@ -327,7 +324,6 @@ public void clicked(Player arg0) { } private void openUpgradeBrowser(Player p, String facName) { - ClickableInventory.forceCloseInventory(p); FurnCraftChestEgg egg = (FurnCraftChestEgg) manager .getEgg(factoryViewed.get(p.getUniqueId())); List upgrades = new LinkedList(); @@ -380,7 +376,6 @@ public void clicked(Player arg0) { } private void openDetailedRecipeBrowser(Player p, String recipeName) { - ClickableInventory.forceCloseInventory(p); if (recipeName == null) { FactoryMod .getPlugin() @@ -570,7 +565,6 @@ public void clicked(Player arg0) { } public void showSorterFace(Player p, Sorter s, BlockFace face) { - ClickableInventory.forceCloseInventory(p); ClickableInventory ci = new ClickableInventory(54, "Items for this side"); viewed.put(p.getUniqueId(), s); From 32aa68ea9ae24dfe57ff1c8a8ee2a11b0502f6a4 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 26 Aug 2016 07:13:58 +0200 Subject: [PATCH 436/459] Fix minor issue --- .../github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index c4bd7f54..946a7b30 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -128,13 +128,13 @@ public Factory revive(List blocks, int health, fpm, fccs, updateTime, name, currRecipes); fccim.setFactory(fccf); phrm.setFactory(fccf); - for (IRecipe recipe : recipes) { + for (IRecipe recipe : currRecipes) { if (recipe.getName().equals(selectedRecipe)) { fccf.setRecipe(recipe); } } - if (fccf.getCurrentRecipe() == null && recipes.size() != 0) { - fccf.setRecipe(recipes.get(0)); + if (fccf.getCurrentRecipe() == null && currRecipes.size() != 0) { + fccf.setRecipe(currRecipes.get(0)); } if (productionTimer != 0) { fccf.attemptToActivate(null, true); From 01652fcb508c0019fd6988d1bb1cba4929034d05 Mon Sep 17 00:00:00 2001 From: biggestnerd Date: Fri, 26 Aug 2016 22:04:15 -0500 Subject: [PATCH 437/459] Added alternate upgrade to wood processor (#287) * Added alternate upgrade to wood processor Currently because there's log and log2 you can't use dark oak or acacia to upgrade to a wood processor. Seeing as dark oak is the primary wood type in certain shards I think this is needed pending a change (possibly in CivModCore) to allow the log material with wildcard durability to allow for log2 * fixed log_2 --- src/main/resources/configCivcraft.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 8ae83554..eda0569c 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -45,6 +45,7 @@ factories: - Upgrade_to_Blacksmith - Upgrade_to_Laboratory - Upgrade_to_Wood_Processor + - Upgrade_to_Wood_Processor_2 - Upgrade_to_Basic_Forge - Upgrade_to_Basic_Fortification @@ -5286,6 +5287,16 @@ recipes: durability: -1 amount: 512 factory: Wood Processor + Upgrade_to_Wood_Processor_2: + production_time: 10m + type: UPGRADE + name: Upgrade to Wood Processor with Dark Oak or Acacia + fuel_consumption_interval: 20s + input: + planks: + material: LOG_2 + durability: -1 + amount: 512 Upgrade_to_Wool_Processing: production_time: 1800s type: UPGRADE From 4f908fd299bfeb6da90d75865c3f7650eca3eb89 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sun, 28 Aug 2016 06:48:14 +0200 Subject: [PATCH 438/459] Add inheritation for recipes --- pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 371 ++++++++++++++---- .../github/igotyou/FactoryMod/FactoryMod.java | 3 +- .../igotyou/FactoryMod/FactoryModManager.java | 12 +- .../listeners/CompactItemListener.java | 47 +-- .../FactoryMod/recipes/AOERepairRecipe.java | 4 + .../FactoryMod/recipes/CompactingRecipe.java | 13 + .../recipes/DecompactingRecipe.java | 9 + .../DeterministicEnchantingRecipe.java | 16 + .../recipes/DummyParsingRecipe.java | 42 ++ .../recipes/FactoryMaterialReturnRecipe.java | 5 + .../igotyou/FactoryMod/recipes/IRecipe.java | 10 +- .../FactoryMod/recipes/LoreEnchantRecipe.java | 17 + .../FactoryMod/recipes/ProductionRecipe.java | 5 + .../FactoryMod/recipes/PylonRecipe.java | 8 + .../recipes/RandomEnchantingRecipe.java | 5 + .../recipes/RandomOutputRecipe.java | 9 + .../FactoryMod/recipes/RepairRecipe.java | 9 + .../FactoryMod/recipes/Upgraderecipe.java | 5 + src/main/resources/plugin.yml | 2 +- 20 files changed, 481 insertions(+), 113 deletions(-) create mode 100644 src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java diff --git a/pom.xml b/pom.xml index 4cac30cc..21eb28ac 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.14 + 2.2.15 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java index 0faed7dc..2c3f231e 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java @@ -1,11 +1,13 @@ package com.github.igotyou.FactoryMod; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import java.util.TreeMap; import org.bukkit.Material; @@ -28,6 +30,7 @@ import com.github.igotyou.FactoryMod.recipes.CompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DecompactingRecipe; import com.github.igotyou.FactoryMod.recipes.DeterministicEnchantingRecipe; +import com.github.igotyou.FactoryMod.recipes.DummyParsingRecipe; import com.github.igotyou.FactoryMod.recipes.FactoryMaterialReturnRecipe; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; @@ -91,6 +94,10 @@ public FactoryModManager parse() { .registerEvents(new NetherPortalListener(), plugin); } useYamlIdentifers = config.getBoolean("use_recipe_yamlidentifiers", false); + if (!useYamlIdentifers) { + plugin.warning("You have usage of yaml identifiers turned off, names will be used instead to identify factories and recipes. This behavior" + + "is not recommended and not compatible with config inheritation"); + } defaultUpdateTime = (int) parseTime(config.getString( "default_update_time", "5")); defaultHealth = config.getInt("default_health", 10000); @@ -152,14 +159,68 @@ public void run() { */ private void parseRecipes(ConfigurationSection config) { recipes = new HashMap(); + List recipeKeys = new LinkedList(); for (String key : config.getKeys(false)) { - if (config.getConfigurationSection(key) == null) { + ConfigurationSection current = config.getConfigurationSection(key); + if (current == null) { plugin.warning("Found invalid section that should not exist at " + config.getCurrentPath() + key); continue; } - IRecipe recipe = parseRecipe(config.getConfigurationSection(key)); + recipeKeys.add(key); + } + while (!recipeKeys.isEmpty()) { + String currentIdent = recipeKeys.get(0); + ConfigurationSection current = config.getConfigurationSection(currentIdent); + if (useYamlIdentifers) { + //no support for inheritation when not using yaml identifiers + boolean foundParent = false; + while(!foundParent) { + //keep track of already parsed sections, so we dont get stuck forever in cyclic dependencies + List children = new LinkedList(); + children.add(currentIdent); + if (current.isString("inherit")) { + //parent is defined for this recipe + String parent = current.getString("inherit"); + if (recipes.containsKey(parent)) { + //we already parsed the parent, so parsing this recipe is fine + foundParent = true; + } + else{ + if (!recipeKeys.contains(parent)) { + //specified parent doesnt exist + plugin.warning("The recipe " + currentIdent + " specified " + parent + " as parent, but this recipe could not be found"); + current = null; + foundParent = true; + } + else { + + //specified parent exists, but wasnt parsed yet, so we do it first + if (children.contains(parent)) { + //cyclic dependency + plugin.warning("The recipe " + currentIdent + " specified a cyclic dependency with parent " + parent + " it was skipped"); + current = null; + foundParent = true; + break; + } + currentIdent = parent; + current = config.getConfigurationSection(parent); + } + } + } + else { + //no parent is a parent as well + foundParent = true; + } + } + } + recipeKeys.remove(currentIdent); + if (current == null) { + plugin.warning(String.format("Recipe %s unable to be added.", currentIdent)); + continue; + } + IRecipe recipe = parseRecipe(current); if (recipe == null) { - plugin.warning(String.format("Recipe %s unable to be added.", key)); + plugin.warning(String.format("Recipe %s unable to be added.", currentIdent)); } else { if (recipes.containsKey(recipe.getIdentifier())) { plugin.warning("Recipe identifier " + recipe.getIdentifier() + " was found twice in the config. One instance was skipped"); @@ -430,11 +491,16 @@ public void enableFactoryDecay(ConfigurationSection config) { */ private IRecipe parseRecipe(ConfigurationSection config) { IRecipe result; - String name = config.getString("name"); + IRecipe parentRecipe = null; + if (config.isString("inherit") && useYamlIdentifers) { + parentRecipe = recipes.get(config.get("inherit")); + } + String name = config.getString("name", (parentRecipe != null) ? parentRecipe.getName() : null); if (name == null) { plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); return null; } + //we dont inherit identifier, because that would make no sense String identifier = config.getString("identifier"); if (identifier == null) { if (useYamlIdentifers) { @@ -445,66 +511,129 @@ private IRecipe parseRecipe(ConfigurationSection config) { } } String prodTime = config.getString("production_time"); - if (prodTime == null) { + if (prodTime == null && parentRecipe == null) { plugin.warning("No production time specied for recipe " + name + ". Skipping it"); return null; } - int productionTime = (int) parseTime(prodTime); - String type = config.getString("type"); + int productionTime; + if (parentRecipe == null) { + productionTime = (int) parseTime(prodTime); + } + else { + productionTime = parentRecipe.getProductionTime(); + } + String type = config.getString("type", (parentRecipe != null) ? parentRecipe.getTypeIdentifier() : null); if (type == null) { - plugin.warning("No name specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); + plugin.warning("No type specified for recipe at " + config.getCurrentPath() +". Skipping the recipe."); return null; } + ConfigurationSection inputSection = config.getConfigurationSection("input"); + ItemMap input; + if (inputSection == null) { + //no input specified, check parent + if (!(parentRecipe instanceof InputRecipe)) { + //default to empty input + input = new ItemMap(); + } + else { + input = ((InputRecipe) parentRecipe).getInput(); + } + } + else { + input = parseItemMap(inputSection); + } switch (type) { case "PRODUCTION": - ItemMap input = parseItemMap(config - .getConfigurationSection("input")); - ItemMap output = parseItemMap(config - .getConfigurationSection("output")); + ConfigurationSection outputSection = config.getConfigurationSection("output"); + ItemMap output; + if (outputSection == null) { + if (!(parentRecipe instanceof ProductionRecipe)) { + output = new ItemMap(); + } + else { + output = ((ProductionRecipe) parentRecipe).getOutput(); + } + } + else { + output = parseItemMap(outputSection); + } result = new ProductionRecipe(identifier, name, productionTime, input, output); break; case "COMPACT": - ItemMap extraMats = parseItemMap(config - .getConfigurationSection("input")); - String compactedLore = config.getString("compact_lore"); - manager.setCompactLore(compactedLore); + String compactedLore = config.getString("compact_lore", + (parentRecipe instanceof CompactingRecipe) ? ((CompactingRecipe)parentRecipe).getCompactedLore() : null); + if (compactedLore == null) { + plugin.warning("No special lore specified for compaction recipe " + name + " it was skipped"); + result = null; + break; + } + manager.addCompactLore(compactedLore); List excluded = new LinkedList(); - for (String mat : config.getStringList("excluded_materials")) { - try { - excluded.add(Material.valueOf(mat)); - } catch (IllegalArgumentException iae) { - plugin.warning(mat + " is not a valid material to exclude: " + config.getCurrentPath()); + if (config.isList("excluded_materials")) { + for (String mat : config.getStringList("excluded_materials")) { + try { + excluded.add(Material.valueOf(mat)); + } catch (IllegalArgumentException iae) { + plugin.warning(mat + " is not a valid material to exclude: " + config.getCurrentPath()); + } + } + } + else { + if (parentRecipe instanceof CompactingRecipe) { + //copy so they are not using same instance + for(Material m : ((CompactingRecipe) parentRecipe).getExcludedMaterials()) { + excluded.add(m); + } } + //otherwise just leave list empty, as nothing is specified, which is fine } - result = new CompactingRecipe(identifier, extraMats, excluded, name, + result = new CompactingRecipe(identifier, input, excluded, name, productionTime, compactedLore); break; case "DECOMPACT": - ItemMap extraMate = parseItemMap(config - .getConfigurationSection("input")); - String decompactedLore = config.getString("compact_lore"); - result = new DecompactingRecipe(identifier, extraMate, name, productionTime, - decompactedLore); + String decompactedLore = config.getString("compact_lore", + (parentRecipe instanceof DecompactingRecipe) ? ((DecompactingRecipe)parentRecipe).getCompactedLore() : null); + if (decompactedLore == null) { + plugin.warning("No special lore specified for decompaction recipe " + name + " it was skipped"); + result = null; + break; + } + manager.addCompactLore(decompactedLore); + result = new DecompactingRecipe(identifier, input, name, productionTime, decompactedLore); break; case "REPAIR": - ItemMap rep = parseItemMap(config.getConfigurationSection("input")); - int health = config.getInt("health_gained"); - result = new RepairRecipe(identifier, name, productionTime, rep, health); + int health = config.getInt("health_gained", + (parentRecipe instanceof RepairRecipe) ? ((RepairRecipe)parentRecipe).getHealth() : 0); + if (health == 0) { + plugin.warning("Health gained from repair recipe " + name + " is set to or was defaulted to 0, this might not be what was intended"); + } + result = new RepairRecipe(identifier, name, productionTime, input, health); break; case "UPGRADE": - ItemMap upgradeCost = parseItemMap(config - .getConfigurationSection("input")); String upgradeName = config.getString("factory"); - IFactoryEgg egg = upgradeEggs.get(upgradeName); + IFactoryEgg egg; + if (upgradeName == null) { + if (parentRecipe instanceof Upgraderecipe) { + egg = ((Upgraderecipe) parentRecipe).getEgg(); + } + else { + egg = null; + } + } + else { + egg = upgradeEggs.get(upgradeName); + } if (egg == null) { - plugin.severe("Could not find factory " + upgradeName + plugin.warning("Could not find factory " + upgradeName + " for upgrade recipe " + name); result = null; } else { - result = new Upgraderecipe(identifier, name, productionTime, upgradeCost, egg); + result = new Upgraderecipe(identifier, name, productionTime, input, egg); } break; case "AOEREPAIR": + //This is untested and should not be used for now + plugin.warning("This recipe is not tested or even completly developed, use it with great care and don't expect it to work"); ItemMap tessence = parseItemMap( config.getConfigurationSection("essence")); if (tessence.getTotalUniqueItemAmount() > 0){ @@ -520,67 +649,145 @@ private IRecipe parseRecipe(ConfigurationSection config) { } break; case "PYLON": - ItemMap in = parseItemMap(config - .getConfigurationSection("input")); - ItemMap out = parseItemMap(config - .getConfigurationSection("output")); - int weight = config.getInt("weight"); - result = new PylonRecipe(identifier, name, productionTime, in, out, weight); + ConfigurationSection outputSec = config.getConfigurationSection("output"); + ItemMap outputMap; + if (outputSec == null) { + if (!(parentRecipe instanceof PylonRecipe)) { + outputMap = new ItemMap(); + } + else { + outputMap = ((PylonRecipe) parentRecipe).getOutput().clone(); + } + } + else { + outputMap = parseItemMap(outputSec); + } + if (outputMap.getTotalItemAmount() == 0) { + plugin.warning("Pylon recipe " + name + " has an empty output specified"); + } + int weight = config.getInt("weight", + (parentRecipe instanceof PylonRecipe) ? ((PylonRecipe)parentRecipe).getWeight() : 20); + result = new PylonRecipe(identifier, name, productionTime, input, outputMap, weight); break; case "ENCHANT": - ItemMap inp = parseItemMap(config - .getConfigurationSection("input")); - Enchantment enchant = Enchantment.getByName(config.getString("enchant")); - int level = config.getInt("level", 1); - ItemMap tool = parseItemMap(config.getConfigurationSection("enchant_item")); - result = new DeterministicEnchantingRecipe(identifier, name, productionTime, inp, tool, enchant, level); + Enchantment enchant = Enchantment.getByName(config.getString("enchant", + (parentRecipe instanceof DeterministicEnchantingRecipe) ? ((DeterministicEnchantingRecipe)parentRecipe).getEnchant().getName() : null)); + if (enchant == null) { + plugin.warning("No enchant specified for deterministic enchanting recipe " + name + ". It was skipped."); + result = null; + break; + } + int level = config.getInt("level", + (parentRecipe instanceof DeterministicEnchantingRecipe) ? ((DeterministicEnchantingRecipe)parentRecipe).getLevel() : 1); + ConfigurationSection toolSection = config.getConfigurationSection("enchant_item"); + ItemMap tool; + if (toolSection == null) { + if (!(parentRecipe instanceof DeterministicEnchantingRecipe)) { + tool = new ItemMap(); + } + else { + tool = ((DeterministicEnchantingRecipe) parentRecipe).getTool().clone(); + } + } + else { + tool = parseItemMap(toolSection); + } + if (tool.getTotalItemAmount() == 0) { + plugin.warning("Deterministic enchanting recipe " + name + " had no tool to enchant specified, it was skipped"); + result = null; + break; + } + result = new DeterministicEnchantingRecipe(identifier, name, productionTime, input, tool, enchant, level); break; case "RANDOM": - ItemMap inpu = parseItemMap(config.getConfigurationSection("input")); - ConfigurationSection outputSec = config.getConfigurationSection("outputs"); - if (outputSec == null) { - plugin.severe("No outputs specified for recipe " + name); - return null; - } + ConfigurationSection outputSect = config.getConfigurationSection("outputs"); Map outputs = new HashMap(); - double totalChance = 0.0; - String displayMap = outputSec.getString("display"); ItemMap displayThis = null; - for(String key : outputSec.getKeys(false)) { - ConfigurationSection keySec = outputSec.getConfigurationSection(key); - if (keySec != null) { - double chance = keySec.getDouble("chance"); - totalChance += chance; - ItemMap im = parseItemMap(keySec); - outputs.put(im,chance); - if (key.equals(displayMap)) { - displayThis = im; - plugin.debug("Displaying " + displayMap + " as recipe label"); + if (outputSect == null) { + if (parentRecipe instanceof RandomOutputRecipe) { + //clone it + for(Entry entry : ((RandomOutputRecipe) parentRecipe).getOutputs().entrySet()) { + outputs.put(entry.getKey().clone(), entry.getValue()); } + displayThis = ((RandomOutputRecipe) parentRecipe).getDisplayMap(); + } + else { + plugin.severe("No outputs specified for random recipe " + name + " it was skipped"); + result = null; + break; } } - if (Math.abs(totalChance - 1.0) > 0.001) { - plugin.warning("Sum of output chances for recipe " + name + " is not 1.0. Total sum is: " + totalChance); + else { + double totalChance = 0.0; + String displayMap = outputSect.getString("display"); + for(String key : outputSect.getKeys(false)) { + ConfigurationSection keySec = outputSect.getConfigurationSection(key); + if (keySec != null) { + double chance = keySec.getDouble("chance"); + totalChance += chance; + ItemMap im = parseItemMap(keySec); + outputs.put(im,chance); + if (key.equals(displayMap)) { + displayThis = im; + plugin.debug("Displaying " + displayMap + " as recipe label"); + } + } + } + if (Math.abs(totalChance - 1.0) > 0.0001) { + plugin.warning("Sum of output chances for recipe " + name + " is not 1.0. Total sum is: " + totalChance); + } } - result = new RandomOutputRecipe(identifier, name, productionTime, inpu, outputs, displayThis); + result = new RandomOutputRecipe(identifier, name, productionTime, input, outputs, displayThis); break; case "COSTRETURN": - ItemMap costIn = parseItemMap(config - .getConfigurationSection("input")); - double factor = config.getDouble("factor", 1.0); - result = new FactoryMaterialReturnRecipe(identifier, name, productionTime, costIn, factor); + double factor = config.getDouble("factor", + (parentRecipe instanceof FactoryMaterialReturnRecipe) ? ((FactoryMaterialReturnRecipe)parentRecipe).getFactor() : 1.0); + result = new FactoryMaterialReturnRecipe(identifier, name, productionTime, input, factor); break; case "LOREENCHANT": - ItemMap loreCostIn = parseItemMap(config.getConfigurationSection("input")); - ItemMap loreTool = parseItemMap(config.getConfigurationSection("loredItem")); - List appliedLore = config.getStringList("appliedLore"); - List overwrittenLore = config.getStringList("overwrittenLore"); - if (appliedLore == null || appliedLore.size() == 0) { - plugin.warning("No result lore specified for lore enchant recipe at " + config.getCurrentPath() + ". It was skipped"); + ConfigurationSection toolSec = config.getConfigurationSection("loredItem"); + ItemMap toolMap; + if (toolSec == null) { + if (!(parentRecipe instanceof LoreEnchantRecipe)) { + toolMap = new ItemMap(); + } + else { + toolMap = ((LoreEnchantRecipe) parentRecipe).getTool().clone(); + } + } + else { + toolMap = parseItemMap(toolSec); + } + if (toolMap.getTotalItemAmount() == 0) { + plugin.warning("Lore enchanting recipe " + name + " had no tool to enchant specified, it was skipped"); result = null; break; } - result = new LoreEnchantRecipe(identifier, name, productionTime, loreCostIn, loreTool, appliedLore, overwrittenLore); + List appliedLore = config.getStringList("appliedLore"); + if (appliedLore == null || appliedLore.size() == 0) { + if (parentRecipe instanceof LoreEnchantRecipe) { + appliedLore = ((LoreEnchantRecipe) parentRecipe).getAppliedLore(); + } + else { + plugin.warning("No lore to apply found for lore enchanting recipe " + name + ". It was skipped"); + result = null; + break; + } + } + List overwrittenLore = config.getStringList("overwrittenLore"); + if (overwrittenLore == null || overwrittenLore.size() == 0) { + if (parentRecipe instanceof LoreEnchantRecipe) { + overwrittenLore = ((LoreEnchantRecipe) parentRecipe).getOverwrittenLore(); + } + else { + //having no lore to be overwritten is completly fine + overwrittenLore = new LinkedList(); + } + } + result = new LoreEnchantRecipe(identifier, name, productionTime, input, toolMap, appliedLore, overwrittenLore); + break; + case "DUMMY": + result = new DummyParsingRecipe(identifier, name, productionTime, null); break; default: plugin.severe("Could not identify type " + config.getString("type") @@ -619,12 +826,16 @@ public void assignRecipesToFactories() { List recipeList = new LinkedList(); for (String recipeName : entry.getValue()) { IRecipe rec = recipes.get(recipeName); + if (rec instanceof DummyParsingRecipe) { + plugin.warning("You can't add dummy recipes to factories! Maybe you are the dummy here?"); + continue; + } if (rec != null) { recipeList.add(rec); usedRecipes.add(rec); } else { - plugin.severe("Could not find specified recipe " + recipeName + plugin.warning("Could not find specified recipe " + recipeName + " for factory " + entry.getKey().getName()); } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java index ef2844d4..64503185 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java @@ -57,8 +57,7 @@ private void registerListeners() { plugin.getServer() .getPluginManager() .registerEvents( - new CompactItemListener(manager.getCompactLore()), - plugin); + new CompactItemListener(), plugin); } public static MenuBuilder getMenuBuilder() { diff --git a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java index bf021ae1..4b57332f 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -54,7 +55,7 @@ public class FactoryModManager { private boolean logInventories; private int redstonePowerOn; private int redstoneRecipeChange; - private String compactLore; + private Set compactLore; public FactoryModManager(FactoryMod plugin, Material factoryInteractionMaterial, boolean citadelEnabled, @@ -91,6 +92,7 @@ public FactoryModManager(FactoryMod plugin, factories = new HashSet(); totalSetupCosts = new HashMap(); recipes = new HashMap(); + compactLore = new HashSet(); // Normal furnace, craftingtable, chest factories possibleCenterBlocks.add(Material.WORKBENCH); @@ -115,8 +117,8 @@ public FactoryModManager(FactoryMod plugin, * @param lore * Lore used for compacting items */ - public void setCompactLore(String lore) { - compactLore = lore; + public void addCompactLore(String lore) { + compactLore.add(lore); } public boolean logInventories() { @@ -126,8 +128,8 @@ public boolean logInventories() { /** * @return Lore given to compacted items */ - public String getCompactLore() { - return compactLore; + public boolean isCompactLore(String lore) { + return compactLore.contains(lore); } /** diff --git a/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java index be34a21a..458bc744 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java @@ -8,31 +8,22 @@ import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.github.igotyou.FactoryMod.FactoryMod; /** * Used to handle events related to items with compacted lore * */ public class CompactItemListener implements Listener { - private String compactLore; - - public CompactItemListener(String compactLore) { - this.compactLore = compactLore; - } /** * Prevents players from placing compacted blocks */ @EventHandler public void blockPlaceEvent(BlockPlaceEvent e) { - if (!e.getItemInHand().hasItemMeta()) { - return; - } - if (!e.getItemInHand().getItemMeta().hasLore()) { - return; - } - if (e.getItemInHand().getItemMeta().getLore().get(0) - .equals(compactLore)) { + if (isCompacted(e.getItemInHand())) { e.setCancelled(true); Player p = e.getPlayer(); if (p != null) { @@ -49,16 +40,7 @@ public void blockPlaceEvent(BlockPlaceEvent e) { public void craftingEvent(CraftItemEvent e) { CraftingInventory ci = e.getInventory(); for (ItemStack is : ci.getMatrix()) { - if (is == null) { - continue; - } - if (!is.hasItemMeta()) { - continue; - } - if (!is.getItemMeta().hasLore()) { - continue; - } - if (is.getItemMeta().getLore().get(0).equals(compactLore)) { + if (isCompacted(is)) { e.setCancelled(true); HumanEntity h = e.getWhoClicked(); if (h instanceof Player && h != null) { @@ -69,5 +51,24 @@ public void craftingEvent(CraftItemEvent e) { } } } + + private boolean isCompacted(ItemStack is) { + if (is == null) { + return false; + } + if (!is.hasItemMeta()) { + return false; + } + ItemMeta im = is.getItemMeta(); + if (!im.hasLore()) { + return false; + } + for(String lore : im.getLore()) { + if (FactoryMod.getManager().isCompactLore(lore)) { + return true; + } + } + return false; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index bd5d8d6f..818d0a8c 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -171,4 +171,8 @@ public void applyEffect(Inventory i, Factory f) { } } + public String getTypeIdentifier() { + return "AOEREPAIR"; + } + } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index fac2cd06..2dddad93 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -181,4 +181,17 @@ private boolean compactable(ItemStack is, ItemMap im) { } return false; } + + @Override + public String getTypeIdentifier() { + return "COMPACT"; + } + + public String getCompactedLore() { + return compactedLore; + } + + public List getExcludedMaterials() { + return excludedMaterials; + } } \ No newline at end of file diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index e2428eaa..472b3e31 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -147,4 +147,13 @@ private void removeCompactLore(ItemStack is) { im.setLore(lore); is.setItemMeta(im); } + + @Override + public String getTypeIdentifier() { + return "DECOMPACT"; + } + + public String getCompactedLore() { + return compactedLore; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index 304a1a8c..2ae36ce2 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -107,4 +107,20 @@ public void applyEffect(Inventory i, Factory f) { logAfterRecipeRun(i, f); } + @Override + public String getTypeIdentifier() { + return "ENCHANT"; + } + + public int getLevel() { + return level; + } + + public Enchantment getEnchant() { + return enchant; + } + + public ItemMap getTool() { + return tool; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java new file mode 100644 index 00000000..05aa16d7 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java @@ -0,0 +1,42 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.List; + +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.Factory; + +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +public class DummyParsingRecipe extends InputRecipe { + + public DummyParsingRecipe(String identifier, String name, int productionTime, ItemMap input) { + super(identifier, name, productionTime, input); + } + + @Override + public void applyEffect(Inventory i, Factory f) { + } + + @Override + public List getInputRepresentation(Inventory i) { + return null; + } + + @Override + public List getOutputRepresentation(Inventory i) { + return null; + } + + @Override + public ItemStack getRecipeRepresentation() { + return null; + } + + @Override + public String getTypeIdentifier() { + return "DUMMY"; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java index 3c1cad80..89fd00c9 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -102,4 +102,9 @@ public void run() { public double getFactor() { return factor; } + + @Override + public String getTypeIdentifier() { + return "COSTRETURN"; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java index e6b964c9..eb2ff8f0 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -16,7 +16,7 @@ public interface IRecipe { * to display the recipe to a player */ public String getName(); - + /** * @return A unique identifier for this recipe */ @@ -46,4 +46,12 @@ public interface IRecipe { * Factory which is run */ public void applyEffect(Inventory i, Factory f); + + /** + * Each implementation of this class has to specify a unique identifier, + * which is used to identify instances of this recipe in the config + * + * @return Unique identifier for the implementation + */ + public String getTypeIdentifier(); } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java index b0587ceb..f863e004 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -121,4 +121,21 @@ private boolean hasStackRequiredLore(ItemStack is) { List lore = im.getLore(); return lore.containsAll(overwritenLore); } + + @Override + public String getTypeIdentifier() { + return "LOREENCHANT"; + } + + public List getAppliedLore() { + return appliedLore; + } + + public List getOverwrittenLore() { + return overwritenLore; + } + + public ItemMap getTool() { + return tool; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index a5157e10..464bd223 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -85,4 +85,9 @@ public ItemStack getRecipeRepresentation() { ISUtils.setName(res, getName()); return res; } + + @Override + public String getTypeIdentifier() { + return "PRODUCTION"; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index 82a15252..caf18d6d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -132,4 +132,12 @@ public static void removeWeight(int weight) { currentGlobalWeight -= weight; } + @Override + public String getTypeIdentifier() { + return "PYLON"; + } + + public ItemMap getOutput() { + return output; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index 31ce853d..2d86f436 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -117,5 +117,10 @@ public void applyEffect(Inventory i, Factory f) { } logAfterRecipeRun(i, f); } + + @Override + public String getTypeIdentifier() { + return "RANDOMENCHANT"; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java index 660fa343..d8b3bd8a 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -95,5 +95,14 @@ public List getOutputRepresentation(Inventory i) { } return items; } + + @Override + public String getTypeIdentifier() { + return "RANDOM"; + } + + public ItemMap getDisplayMap() { + return lowestChanceMap; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 098dae28..917c1f0e 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -63,4 +63,13 @@ public ItemStack getRecipeRepresentation() { ISUtils.setName(res, getName()); return res; } + + @Override + public String getTypeIdentifier() { + return "REPAIR"; + } + + public int getHealth() { + return healthPerRun; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index deb83805..97ccac7d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -109,5 +109,10 @@ public List getOutputRepresentation(Inventory i) { public IFactoryEgg getEgg() { return egg; } + + @Override + public String getTypeIdentifier() { + return "UPGRADE"; + } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 240593de..6de4d045 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ${project.name} main: com.github.igotyou.FactoryMod.FactoryMod -author: igotyou +author: Maxopoly, igotyou version: ${project.version} depend: [CivModCore] softdepend: [CivMenu, NameLayer, Citadel] From bfa1c02b62f05e14bda7355f6b96b433bd2df6f1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 31 Aug 2016 04:21:18 +0200 Subject: [PATCH 439/459] Add Leaf shears --- src/main/resources/configCivcraft.yml | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index eda0569c..3983e385 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -1066,6 +1066,7 @@ factories: - Enchant_Axe_Efficiency_II - Enchant_Shovel_Efficiency_I - Enchant_Shovel_Efficiency_II + - Enchant_Leaf_Burner_I - Upgrade_to_Rapid_Forge - Repair_Factory rapidforge: @@ -1084,6 +1085,8 @@ factories: - Enchant_Shovel_Efficiency_II - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV + - Enchant_Leaf_Burner_I + - Enchant_Leaf_Burner_II - Upgrade_to_Sonic_Forge - Repair_Advanced_Factory sonicforge: @@ -1105,6 +1108,8 @@ factories: - Enchant_Shovel_Efficiency_III - Enchant_Shovel_Efficiency_IV - Enchant_Shovel_Efficiency_V + - Enchant_Leaf_Burner_I + - Enchant_Leaf_Burner_II - Repair_Expert_Factory #Unbreaking rockforge: @@ -10193,6 +10198,37 @@ recipes: enchant_item: armor: material: DIAMOND_SWORD + + Enchant_Leaf_Burner_I: + type: LOREENCHANT + name: Enchant Shear with Leaf Burner + production_time: 15s + loredItem: + tool: + material: SHEAR + appliedLore: + - Leaf Burner + input: + emeralds: + material: EMERALD + amount: 40 + + Enchant_Leaf_Burner_II: + type: LOREENCHANT + name: Enchant Shear with Leaf Burner II + production_time: 15s + loredItem: + tool: + material: SHEAR + appliedLore: + - Leaf Burner II + overwrittenLore: + - Leaf Burner + input: + emeralds: + material: EMERALD + amount: 80 + #Fossils Break_Fossil_Basic: type: RANDOM From bf7076fe45ec3be6c57e9a54eed745cc35589eb3 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 31 Aug 2016 04:32:37 +0200 Subject: [PATCH 440/459] Make compatible with latest CivModCore and minor config fix --- pom.xml | 2 +- .../igotyou/FactoryMod/utility/MenuBuilder.java | 15 ++++++--------- src/main/resources/configCivcraft.yml | 8 +++----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 21eb28ac..cbe364df 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ vg.civcraft.mc.civmodcore CivModCore - 1.4.3 + 1.4.47 provided diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index b0ae3a1f..b99dda0e 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -17,7 +17,6 @@ import vg.civcraft.mc.civmodcore.inventorygui.Clickable; import vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory; import vg.civcraft.mc.civmodcore.inventorygui.DecorationStack; -import vg.civcraft.mc.civmodcore.inventorygui.ScheduledInventoryOpen; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; @@ -151,9 +150,8 @@ public void clicked(Player arg0) { } }; browser.setSlot(upgradeClickable, 16); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), browser, p); + browser.showInventory(p); } - } private void openRecipeBrowser(Player p, String facName) { @@ -196,8 +194,7 @@ public void clicked(Player arg0) { } }; recipeInventory.setSlot(backClickable, size - 5); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), - recipeInventory, p); + recipeInventory.showInventory(p); } private void openSetupBrowser(Player p, String facName) { @@ -320,7 +317,7 @@ public void clicked(Player arg0) { } }; ci.setSlot(backClickable, 18); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); + ci.showInventory(p); } private void openUpgradeBrowser(Player p, String facName) { @@ -372,7 +369,7 @@ public void clicked(Player arg0) { } }; ci.setSlot(backClickable, 17); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); + ci.showInventory(p); } private void openDetailedRecipeBrowser(Player p, String recipeName) { @@ -511,7 +508,7 @@ public void clicked(Player arg0) { } ISUtils.addLore(fuelStack, ChatColor.LIGHT_PURPLE + "Total duration of " + rec.getProductionTime() / 20 + " seconds"); ci.setSlot(new DecorationStack(fuelStack), 30); - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); + ci.showInventory(p); } public void showPipeMaterials(Player p, Pipe pipe) { @@ -561,7 +558,7 @@ public void clicked(Player arg0) { }; ci.setSlot(nextClick, 49); } - ScheduledInventoryOpen.schedule(FactoryMod.getPlugin(), ci, p); + ci.showInventory(p); } public void showSorterFace(Player p, Sorter s, BlockFace face) { diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 3983e385..edc5e56e 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -10198,28 +10198,26 @@ recipes: enchant_item: armor: material: DIAMOND_SWORD - Enchant_Leaf_Burner_I: type: LOREENCHANT name: Enchant Shear with Leaf Burner production_time: 15s loredItem: tool: - material: SHEAR + material: SHEARS appliedLore: - Leaf Burner input: emeralds: material: EMERALD amount: 40 - Enchant_Leaf_Burner_II: type: LOREENCHANT name: Enchant Shear with Leaf Burner II production_time: 15s loredItem: tool: - material: SHEAR + material: SHEARS appliedLore: - Leaf Burner II overwrittenLore: @@ -10228,7 +10226,7 @@ recipes: emeralds: material: EMERALD amount: 80 - + #Fossils Break_Fossil_Basic: type: RANDOM From 6f57f13f215e5ae77b4a92cdb2779b95c72a1f8b Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 31 Aug 2016 04:47:37 +0200 Subject: [PATCH 441/459] Final fixes to lore enchant recipe --- .../FactoryMod/recipes/LoreEnchantRecipe.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java index f863e004..717086c7 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -3,6 +3,7 @@ import java.util.LinkedList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -91,12 +92,18 @@ public void applyEffect(Inventory i, Factory f) { if (input.removeSafelyFrom(i)) { ItemStack toolio = tool.getItemStackRepresentation().get(0); for (ItemStack is : i.getContents()) { - if (is != null && toolio.getType() == is.getType() && hasStackRequiredLore(toolio)) { + if (is != null && toolio.getType() == is.getType() && hasStackRequiredLore(is)) { ItemMeta im = is.getItemMeta(); + if (im == null) { + im = Bukkit.getItemFactory().getItemMeta(is.getType()); + } List currentLore = im.getLore(); if (overwritenLore.size() != 0) { currentLore.removeAll(overwritenLore); } + if (currentLore == null) { + currentLore = new LinkedList(); + } currentLore.addAll(appliedLore); im.setLore(currentLore); is.setItemMeta(im); @@ -108,17 +115,26 @@ public void applyEffect(Inventory i, Factory f) { } private boolean hasStackRequiredLore(ItemStack is) { - if (overwritenLore.size() == 0) { - return true; + if (is == null) { + return false; } - if (!is.hasItemMeta()) { + if (!is.hasItemMeta() && overwritenLore.size() != 0) { return false; } ItemMeta im = is.getItemMeta(); - if (!im.hasLore()) { + if (!im.hasLore() && overwritenLore.size() != 0) { return false; } List lore = im.getLore(); + if (im.hasLore()) { + //check whether lore to apply preexists + if (lore.containsAll(appliedLore)) { + return false; + } + } + if (overwritenLore.size() == 0) { + return true; + } return lore.containsAll(overwritenLore); } From d44160a975fd68753eaf11000080c39c1594b5f1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 7 Sep 2016 07:16:57 +0200 Subject: [PATCH 442/459] Catch inconsistency in random recipe --- pom.xml | 2 +- .../FactoryMod/recipes/RandomOutputRecipe.java | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cbe364df..2fd842f2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.15 + 2.2.16 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java index d8b3bd8a..fceae86d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -10,6 +10,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.factories.Factory; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; @@ -48,7 +49,22 @@ public RandomOutputRecipe(String identifier, String name, int productionTime, It public void applyEffect(Inventory i, Factory f) { logBeforeRecipeRun(i, f); ItemMap toRemove = input.clone(); - ItemMap toAdd = getRandomOutput().clone(); + ItemMap toAdd = null; + int counter = 0; + while(counter < 20) { + toAdd = getRandomOutput(); + if (toAdd != null) { + toAdd = toAdd.clone(); + break; + } + else { + counter++; + } + } + if (toAdd == null) { + FactoryMod.getPlugin().warning("Unable to find a random item to output. Recipe execution was cancelled," + f.getLogData()); + return; + } if (toRemove.isContainedIn(i)) { if (toRemove.removeSafelyFrom(i)) { for(ItemStack is: toAdd.getItemStackRepresentation()) { From e7e079d1cbfcb53b131269965cff5d64b4d842b0 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 8 Sep 2016 20:43:30 +0200 Subject: [PATCH 443/459] Add option to reduce reinforcement damage --- pom.xml | 2 +- .../igotyou/FactoryMod/ConfigParser.java | 3 +- .../github/igotyou/FactoryMod/FactoryMod.java | 4 ++ .../FactoryMod/eggs/FurnCraftChestEgg.java | 13 +++++-- .../factories/FurnCraftChestFactory.java | 10 ++++- .../FactoryMod/listeners/CitadelListener.java | 38 +++++++++++++++++++ .../FactoryMod/recipes/Upgraderecipe.java | 2 +- 7 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/github/igotyou/FactoryMod/listeners/CitadelListener.java diff --git a/pom.xml b/pom.xml index 2fd842f2..6e94a837 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.16 + 2.2.17 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java index 2c3f231e..6e79f495 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java @@ -470,8 +470,9 @@ public IFactoryEgg parseFCCFactory(ConfigurationSection config) { else { healthPerDamageIntervall = defaultDamagePerBreakPeriod; } + double citadelBreakReduction = config.getDouble("citadelBreakReduction", 1.0); FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, null, fuel, - fuelIntervall, returnRate, health, gracePeriod, healthPerDamageIntervall); + fuelIntervall, returnRate, health, gracePeriod, healthPerDamageIntervall, citadelBreakReduction); recipeLists.put(egg, config.getStringList("recipes")); return egg; } diff --git a/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java index 64503185..98c05d1d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java @@ -3,6 +3,7 @@ import org.bukkit.entity.Player; import com.github.igotyou.FactoryMod.commands.FactoryModCommandHandler; +import com.github.igotyou.FactoryMod.listeners.CitadelListener; import com.github.igotyou.FactoryMod.listeners.CompactItemListener; import com.github.igotyou.FactoryMod.listeners.FactoryModListener; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; @@ -58,6 +59,9 @@ private void registerListeners() { .getPluginManager() .registerEvents( new CompactItemListener(), plugin); + if (manager.isCitadelEnabled()) { + plugin.getServer().getPluginManager().registerEvents(new CitadelListener(), plugin); + } } public static MenuBuilder getMenuBuilder() { diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index 946a7b30..a8405238 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -27,10 +27,11 @@ public class FurnCraftChestEgg implements IFactoryEgg { private long breakGracePeriod; private int healthPerDamagePeriod; private double returnRateOnDestruction; + private double citadelBreakReduction; public FurnCraftChestEgg(String name, int updateTime, List recipes, ItemStack fuel, - int fuelConsumptionIntervall, double returnRateOnDestruction, int maximumHealth, long breakGracePeriod, int healthPerDamagePeriod) { + int fuelConsumptionIntervall, double returnRateOnDestruction, int maximumHealth, long breakGracePeriod, int healthPerDamagePeriod, double citadelBreakReduction) { this.name = name; this.updateTime = updateTime; this.recipes = recipes; @@ -40,6 +41,7 @@ public FurnCraftChestEgg(String name, int updateTime, this.fuelConsumptionIntervall = fuelConsumptionIntervall; this.returnRateOnDestruction = returnRateOnDestruction; this.maximumHealth = maximumHealth; + this.citadelBreakReduction = citadelBreakReduction; } public Factory hatch(MultiBlockStructure mbs, Player p) { @@ -49,7 +51,7 @@ public Factory hatch(MultiBlockStructure mbs, Player p) { FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, healthPerDamagePeriod, breakGracePeriod); FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, - fpm, fccs, updateTime, name, recipes); + fpm, fccs, updateTime, name, recipes, citadelBreakReduction); fccim.setFactory(fccf); phrm.setFactory(fccf); if (recipes.size() != 0) { @@ -125,7 +127,7 @@ public Factory revive(List blocks, int health, } } FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, - fpm, fccs, updateTime, name, currRecipes); + fpm, fccs, updateTime, name, currRecipes, citadelBreakReduction); fccim.setFactory(fccf); phrm.setFactory(fccf); for (IRecipe recipe : currRecipes) { @@ -148,5 +150,8 @@ public Factory revive(List blocks, int health, public Class getMultiBlockStructure() { return FurnCraftChestStructure.class; } - + + public double getCitadelBreakReduction() { + return citadelBreakReduction; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 42ce3871..519096c1 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -51,12 +51,13 @@ public class FurnCraftChestFactory extends Factory { protected IRecipe currentRecipe; protected Map runCount; private UUID activator; + private double citadelBreakReduction; private static HashSet pylonFactories; public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, - String name, List recipes) { + String name, List recipes, double citadelBreakReduction) { super(im, rm, ipm, mbs, updateTime, name); this.active = false; this.recipes = recipes; @@ -440,13 +441,14 @@ public static void removePylon(Factory f) { } public void upgrade(String name, List recipes, ItemStack fuel, - int fuelConsumptionIntervall, int updateTime, int maximumHealth, int damageAmountPerDecayIntervall, long gracePeriod) { + int fuelConsumptionIntervall, int updateTime, int maximumHealth, int damageAmountPerDecayIntervall, long gracePeriod, double citadelBreakReduction) { LoggingUtils.log("Upgrading " + getLogData() + " to " + name); pylonFactories.remove(this); deactivate(); this.name = name; this.recipes = recipes; this.updateTime = updateTime; + this.citadelBreakReduction = citadelBreakReduction; this.pm = new FurnacePowerManager(getFurnace(), fuel, fuelConsumptionIntervall); this.rm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, damageAmountPerDecayIntervall, gracePeriod); @@ -466,4 +468,8 @@ public void upgrade(String name, List recipes, ItemStack fuel, } } } + + public double getCitadelBreakReduction() { + return citadelBreakReduction; + } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/listeners/CitadelListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/CitadelListener.java new file mode 100644 index 00000000..4aa79dde --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/CitadelListener.java @@ -0,0 +1,38 @@ +package com.github.igotyou.FactoryMod.listeners; + +import java.util.Random; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +import vg.civcraft.mc.citadel.events.ReinforcementDamageEvent; + +public class CitadelListener implements Listener { + + private FactoryModManager manager; + private Random rng; + + public CitadelListener() { + this.manager = FactoryMod.getManager(); + this.rng = new Random(); + } + + @EventHandler + public void reinDamage(ReinforcementDamageEvent e) { + Factory f = manager.getFactoryAt(e.getBlock()); + if (!(f instanceof FurnCraftChestFactory)) { + return; + } + FurnCraftChestFactory fccf = (FurnCraftChestFactory) f; + if (fccf.getMultiBlockStructure().getCenter().equals(e.getBlock().getLocation())) { + if (rng.nextDouble() > fccf.getCitadelBreakReduction()) { + e.setCancelled(true); + } + } + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index 97ccac7d..aacd8fc9 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -37,7 +37,7 @@ public void applyEffect(Inventory i, Factory f) { ((FurnCraftChestFactory) f).upgrade(e.getName(), e.getRecipes(), e.getFuel(), e.getFuelConsumptionIntervall(), e.getUpdateTime(), e.getMaximumHealth(), - e.getDamagePerDamagingPeriod(), e.getBreakGracePeriod()); + e.getDamagePerDamagingPeriod(), e.getBreakGracePeriod(), e.getCitadelBreakReduction()); } } logAfterRecipeRun(i, f); From f1e4d37ead155514ca5323d0800faa2648b3ab8e Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 8 Sep 2016 22:01:04 +0200 Subject: [PATCH 444/459] Apply RRC-2C --- src/main/resources/configCivcraft.yml | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index edc5e56e..ee9b3f13 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -11175,7 +11175,7 @@ recipes: input: stone: material: STONE - amount: 96 + amount: 64 granite: material: STONE amount: 64 @@ -11197,7 +11197,7 @@ recipes: input: stone: material: STONE - amount: 96 + amount: 64 granite: material: STONE amount: 64 @@ -11219,7 +11219,7 @@ recipes: input: stone: material: STONE - amount: 96 + amount: 64 granite: material: STONE amount: 64 @@ -11241,13 +11241,13 @@ recipes: input: inksack: material: INK_SACK - amount: 8 + amount: 4 bone: material: BONE - amount: 12 + amount: 6 string: material: STRING - amount: 16 + amount: 8 output: basicHunter: material: BONE @@ -11262,10 +11262,10 @@ recipes: input: inksack: material: SPIDER_EYE - amount: 16 + amount: 8 bone: material: ROTTEN_FLESH - amount: 32 + amount: 16 output: basicHunter: material: BONE @@ -11280,13 +11280,13 @@ recipes: input: inksack: material: ENDER_PEARL - amount: 8 + amount: 4 bone: material: ROTTEN_FLESH - amount: 16 + amount: 8 string: material: STRING - amount: 16 + amount: 8 output: basicHunter: material: BONE @@ -11341,13 +11341,13 @@ recipes: name: Hunter Component lore: - Basic Reinforcement Ingredient - amount: 6 + amount: 2 flint: material: FLINT - amount: 24 + amount: 8 iron: material: IRON_INGOT - amount: 32 + amount: 8 output: decentMiner: material: QUARTZ @@ -11365,13 +11365,13 @@ recipes: name: Hunter Component lore: - Basic Reinforcement Ingredient - amount: 6 + amount: 2 redstone: material: REDSTONE - amount: 16 + amount: 8 gold: material: GOLD_INGOT - amount: 24 + amount: 8 output: decentMiner: material: QUARTZ @@ -11389,13 +11389,13 @@ recipes: name: Miner Component lore: - Basic Reinforcement Ingredient - amount: 6 + amount: 2 slime: material: SLIME_BALL - amount: 24 + amount: 8 blazeRod: material: BLAZE_ROD - amount: 16 + amount: 8 output: decentHunter: material: SULPHUR @@ -11413,13 +11413,13 @@ recipes: name: Miner Component lore: - Basic Reinforcement Ingredient - amount: 6 + amount: 2 magmaCream: material: MAGMA_CREAM - amount: 24 + amount: 8 gunpowder: material: SULPHUR - amount: 24 + amount: 6 output: decentHunter: material: SULPHUR @@ -11461,13 +11461,13 @@ recipes: name: Miner Component lore: - Decent Reinforcement Ingredient - amount: 6 + amount: 2 ghastTear: material: GHAST_TEAR - amount: 12 + amount: 6 witherskull: material: SKULL_ITEM - durability: 1 + durability: 2 output: strongHunter: material: GHAST_TEAR @@ -11486,14 +11486,14 @@ recipes: name: Hunter Component lore: - Decent Reinforcement Ingredient - amount: 6 + amount: 2 diamond: material: DIAMOND - amount: 1 + amount: 4 lapis: material: INK_SACK durability: 4 - amount: 10 + amount: 8 output: strongMiner: material: PRISMARINE @@ -11559,13 +11559,13 @@ recipes: name: Miner Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 strongHunter: material: GHAST_TEAR name: Hunter Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 xp: material: EMERALD_BLOCK amount: 18 @@ -11586,13 +11586,13 @@ recipes: name: Miner Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 strongHunter: material: GHAST_TEAR name: Hunter Component lore: - Strong Reinforcement Ingredient - amount: 4 + amount: 3 xp: material: EMERALD_BLOCK amount: 12 From ec94331740dcb90ed4c5b55121399a4f759b6eec Mon Sep 17 00:00:00 2001 From: BlackXnt Date: Thu, 8 Sep 2016 23:47:57 +0300 Subject: [PATCH 445/459] Add citadelBreakReduction to all factories (#288) --- src/main/resources/configCivcraft.yml | 85 ++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index ee9b3f13..57c6dd7c 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -20,6 +20,7 @@ factories: basiccontraption: type: FCC name: Basic Contraption + citadelBreakReduction: 0.4 setupcost: planks: material: WOOD @@ -54,6 +55,7 @@ factories: basicFortification: type: FCCUPGRADE name: Basic Fortifications + citadelBreakReduction: 0.2 recipes: - Produce_basic_andesite_Miner_Component - Produce_basic_diorite_Miner_Component @@ -74,6 +76,7 @@ factories: #Basic Contraption --> Basic Fortification --> Intermediate Fortification intermediateFortification: type: FCCUPGRADE + citadelBreakReduction: 0.05 name: Intermediate Fortifications recipes: - Produce_basic_andesite_Miner_Component @@ -100,6 +103,7 @@ factories: advancedFortification: type: FCCUPGRADE name: Advanced Fortifications + citadelBreakReduction: 0.025 recipes: - Produce_basic_andesite_Miner_Component - Produce_basic_diorite_Miner_Component @@ -127,6 +131,7 @@ factories: #Basic Contraption --> Stone Smelter type: FCCUPGRADE name: Stone Smelter + citadelBreakReduction: 0.4 recipes: - Smelt_Stone_Advanced - Smelt_Coal_Ore_Basic @@ -142,6 +147,7 @@ factories: #Basic Contraption --> Stone Smelter --> Ore Smelter type: FCCUPGRADE name: Ore Smelter + citadelBreakReduction: 0.1 recipes: - Smelt_Coal_Ore_Advanced - Smelt_Iron_Ore_Basic @@ -155,6 +161,7 @@ factories: #Basic Contraption --> Stone Smelter --> Ore Smelter --> Ore Forge type: FCCUPGRADE name: Ore Forge + citadelBreakReduction: 0.05 recipes: - Smelt_Coal_Ore_Expert - Smelt_Iron_Ore_Advanced @@ -166,6 +173,7 @@ factories: #Basic Contraption --> Stone Smelter --> Ore Smelter --> Gem Extractor type: FCCUPGRADE name: Gem Extractor + citadelBreakReduction: 0.05 recipes: - Extract_Diamonds - Extract_Emeralds @@ -180,6 +188,7 @@ factories: #Basic Contraption --> Stone Smelter --> Sand Smelter type: FCCUPGRADE name: Sand Smelter + citadelBreakReduction: 0.2 recipes: - Smelt_Glass_Advanced - Smelt_Glass_Panes_Basic @@ -194,6 +203,7 @@ factories: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Dying Factory type: FCCUPGRADE name: Glass Dying Factory + citadelBreakReduction: 0.1 recipes: - Dye_Glass_White - Dye_Glass_Orange @@ -233,6 +243,7 @@ factories: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Glass Blowing Workshop type: FCCUPGRADE name: Glass Blowing Workshop + citadelBreakReduction: 0.1 recipes: - Smelt_Glass_Expert - Smelt_Glass_Panes_Advanced @@ -243,6 +254,7 @@ factories: #Basic Contraption --> Stone Smelter --> Sand Smelter --> Sandstone Smelter type: FCCUPGRADE name: Sandstone Smelter + citadelBreakReduction: 0.1 recipes: - Smelt_Sandstone_Advanced - Smelt_Red_Sandstone_Advanced @@ -262,6 +274,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter type: FCCUPGRADE name: Brick Smelter + citadelBreakReduction: 0.2 recipes: - Smelt_Stone_Advanced - Craft_Stonebricks_Basic @@ -277,6 +290,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Fancy Stone Smelter type: FCCUPGRADE name: Fancy Stone Smelter + citadelBreakReduction: 0.1 recipes: - Smelt_Stone_Expert - Craft_Polished_Andesite @@ -287,6 +301,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Stonebrick Smelter type: FCCUPGRADE name: Stonebrick Smelter + citadelBreakReduction: 0.1 recipes: - Craft_Stonebricks_Advanced - Craft_Stonebrick_Stairs @@ -299,6 +314,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Netherbrick Smelter type: FCCUPGRADE name: Netherbrick Smelter + citadelBreakReduction: 0.1 recipes: - Smelt_Netherbrick_Advanced - Craft_Netherbrick_Fence @@ -310,6 +326,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Aquatic Brick Smelter type: FCCUPGRADE name: Aquatic Brick Smelter + citadelBreakReduction: 0.1 recipes: - Smelt_Prismarine - Smelt_Dark_Prismarine @@ -321,6 +338,7 @@ factories: #Basic Contraption --> Stone Smelter --> Brick Smelter --> Quartz Factory type: FCCUPGRADE name: Quartz Factory + citadelBreakReduction: 0.1 recipes: - Craft_Quartz_Slabs - Craft_Quartz_Blocks @@ -334,6 +352,7 @@ factories: #Basic Contraption --> Stone Smelter --> Kiln type: FCCUPGRADE name: Kiln + citadelBreakReduction: 0.1 recipes: - Smelt_Clay_Bricks - Harden_Clay_Basic @@ -344,6 +363,7 @@ factories: woodprocessor: type: FCCUPGRADE name: Wood Processor + citadelBreakReduction: 0.4 recipes: - Burn_Charcoal_from_Logs_Advanced - Burn_Charcoal_from_Logs2_Advanced @@ -356,6 +376,7 @@ factories: carpentry: type: FCCUPGRADE name: Carpentry + citadelBreakReduction: 0.2 recipes: - Craft_Boat - Cut_any_type_of_Plank_Advanced @@ -368,6 +389,7 @@ factories: finewoodworking: type: FCCUPGRADE name: Fine Woodworking + citadelBreakReduction: 0.2 recipes: - Craft_any_type_of_fence - Craft_any_type_of_fence_gate @@ -377,6 +399,7 @@ factories: coalburner: type: FCCUPGRADE name: Coal Burner + citadelBreakReduction: 0.2 recipes: - Burn_Charcoal_from_Logs_Expert - Burn_Charcoal_from_Logs2_Expert @@ -385,6 +408,7 @@ factories: farmsteadfactory: type: FCCUPGRADE name: Farmstead Factory + citadelBreakReduction: 0.4 recipes: - Bake_Bread_Advanced - Grill_Steak_Basic @@ -400,6 +424,7 @@ factories: bakery: type: FCCUPGRADE name: Bakery + citadelBreakReduction: 0.1 recipes: - Bake_Potatoes - Bake_Bread_Expert @@ -411,6 +436,7 @@ factories: grill: type: FCCUPGRADE name: Grill + citadelBreakReduction: 0.1 recipes: - Grill_Steak_Advanced - Grill_Pork @@ -423,6 +449,7 @@ factories: stewmaker: type: FCCUPGRADE name: Soup kitchen + citadelBreakReduction: 0.1 recipes: - Make_Rabbit_Stew - Make_Mushroom_Stew @@ -432,6 +459,7 @@ factories: animalhusbandryfactorybasic: type: FCCUPGRADE name: Animal Husbandry Factory + citadelBreakReduction: 0.1 recipes: - Craft_Saddles_Basic - Create_Nametags @@ -440,6 +468,7 @@ factories: woolprocessor: type: FCCUPGRADE name: Wool Processing + citadelBreakReduction: 0.2 recipes: - Dye_Wool_Orange - Dye_Wool_Magenta @@ -460,6 +489,7 @@ factories: biolab: type: FCCUPGRADE name: Bio Lab + citadelBreakReduction: 0.2 recipes: - Create_Poppy_Advanced - Mutate_Tall_Grass_Basic @@ -473,6 +503,7 @@ factories: grassgardening: type: FCCUPGRADE name: Grass Gardening + citadelBreakReduction: 0.1 recipes: - Mutate_Tall_Grass_Advanced - Mutate_Large_Fern @@ -485,12 +516,14 @@ factories: flowergardening: type: FCCUPGRADE name: Flower Gardening + citadelBreakReduction: 0.1 recipes: - Grow_random_flower - Repair_Basic_Factory treemutator: type: FCCUPGRADE name: Tree Mutator + citadelBreakReduction: 0.1 recipes: - Mutate_random_sapling - Mutate_random_leaves @@ -499,6 +532,7 @@ factories: organicblockfactory: type: FCCUPGRADE name: Organic Block Factory + citadelBreakReduction: 0.1 recipes: - Create_Podzol_Advanced - Create_Coarse_Dirt @@ -507,6 +541,7 @@ factories: blacksmith: type: FCCUPGRADE name: Blacksmith + citadelBreakReduction: 0.4 recipes: - Forge_Stone_Sword - Forge_Stone_Pickaxe @@ -519,6 +554,7 @@ factories: ironforgebasic: type: FCCUPGRADE name: Iron Forge + citadelBreakReduction: 0.1 recipes: - Craft_Rail_Basic - Craft_Buckets_Basic @@ -529,6 +565,7 @@ factories: ironforgeadvanced: type: FCCUPGRADE name: Steel Forge + citadelBreakReduction: 0.05 recipes: - Craft_Shears - Craft_Anvils_Advanced @@ -540,6 +577,7 @@ factories: railfactory: type: FCCUPGRADE name: Rail Factory + citadelBreakReduction: 0.05 recipes: - Create_Rail_Advanced - Create_Powered_Rail @@ -549,6 +587,7 @@ factories: ironequipmentforge: type: FCCUPGRADE name: Iron Equipment Forge + citadelBreakReduction: 0.1 recipes: - Forge_Iron_Pickaxe - Forge_Iron_Shovel @@ -566,6 +605,7 @@ factories: goldequipmentforge: type: FCCUPGRADE name: Gold Equipment Forge + citadelBreakReduction: 0.1 recipes: - Forge_Gold_Pickaxe_Basic - Forge_Gold_Shovel_Basic @@ -577,6 +617,7 @@ factories: diamondequipmentforge: type: FCCUPGRADE name: Diamond Equipment Forge + citadelBreakReduction: 0.05 recipes: - Forge_Diamond_Pickaxe_Basic - Forge_Diamond_Shovel_Basic @@ -588,6 +629,7 @@ factories: goldarmourforge: type: FCCUPGRADE name: Gold Armour Forge + citadelBreakReduction: 0.1 recipes: - Forge_Gold_Helmet - Forge_Gold_Boots @@ -598,6 +640,7 @@ factories: goldtoolsforge: type: FCCUPGRADE name: Gold Tools Forge + citadelBreakReduction: 0.1 recipes: - Forge_Gold_Pickaxe - Forge_Gold_Shovel @@ -608,6 +651,7 @@ factories: diamondarmourforge: type: FCCUPGRADE name: Diamond Armour Forge + citadelBreakReduction: 0.025 recipes: - Forge_Diamond_Helmet - Forge_Diamond_Boots @@ -618,6 +662,7 @@ factories: diamondtoolsforge: type: FCCUPGRADE name: Diamond Tools Forge + citadelBreakReduction: 0.025 recipes: - Forge_Diamond_Pickaxe - Forge_Diamond_Shovel @@ -628,6 +673,7 @@ factories: laboratory: type: FCCUPGRADE name: Laboratory + citadelBreakReduction: 0.4 recipes: - Craft_Redstone_Repeater_Basic - Craft_Dispenser_Basic @@ -640,17 +686,20 @@ factories: bastionfactory: type: FCCUPGRADE name: Bastion Factory + citadelBreakReduction: 0.025 recipes: - Create_Bastion - Repair_Expert_Factory printingpress: type: FCCUPGRADE name: Printing Press + citadelBreakReduction: 0.1 recipes: - Repair_Factory compactorbasic: type: FCCUPGRADE name: Compactor Basic + citadelBreakReduction: 0.2 recipes: - Compact_Stack_Basic - De-compact_Stack_Basic @@ -660,6 +709,7 @@ factories: dedicatedcompactor: type: FCCUPGRADE name: Dedicated Compactor + citadelBreakReduction: 0.1 updatetime: 5t recipes: - Compact_Stack_Advanced @@ -667,12 +717,14 @@ factories: dedicateddecompactor: type: FCCUPGRADE name: Dedicated De-Compactor + citadelBreakReduction: 0.1 recipes: - De-compact_Stack_Advanced - Repair_Basic_Factory redstonefactorybasic: type: FCCUPGRADE name: Redstone Techniques + citadelBreakReduction: 0.1 recipes: - Craft_Redstone_Repeater_Advanced - Craft_Redstone_Torch_Basic @@ -684,6 +736,7 @@ factories: redstonecircularityfactory: type: FCCUPGRADE name: Redstone Electronics + citadelBreakReduction: 0.05 recipes: - Craft_Redstone_Repeater_Advanced - Craft_Redstone_Torch_Advanced @@ -695,6 +748,7 @@ factories: redstonemechanicsfactory: type: FCCUPGRADE name: Redstone Mechanics + citadelBreakReduction: 0.05 recipes: - Craft_Piston - Craft_Sticky_Piston @@ -707,6 +761,7 @@ factories: basicpylon: type: FCCUPGRADE name: Basic Pylon + citadelBreakReduction: 0.1 recipes: - Pylon_Basic - Upgrade_to_Advanced_Pylon @@ -714,6 +769,7 @@ factories: advancedPylon: type: FCCUPGRADE name: Advanced Pylon + citadelBreakReduction: 0.05 recipes: - Pylon_Advanced - Upgrade_to_Expert_Pylon @@ -721,12 +777,14 @@ factories: expertpylon: type: FCCUPGRADE name: Expert Pylon + citadelBreakReduction: 0.025 recipes: - Pylon_Expert - Repair_Expert_Pylon crystallizationfactory: type: FCCUPGRADE name: Crystallization Factory + citadelBreakReduction: 0.1 recipes: - Pack_Snow_To_Ice - Compress_Ice_To_Packed_Ice @@ -735,6 +793,7 @@ factories: basicforge: type: FCCUPGRADE name: Basic Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Efficiency_Pickaxe_Basic - Enchant_Efficiency_Axe_Basic @@ -757,6 +816,7 @@ factories: emberforge: type: FCCUPGRADE name: Ember Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Helmet_FireP_I - Enchant_Helmet_FireP_II @@ -776,6 +836,7 @@ factories: magmaforge: type: FCCUPGRADE name: Magma Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Helmet_FireP_I - Enchant_Helmet_FireP_II @@ -809,6 +870,7 @@ factories: riverforge: type: FCCUPGRADE name: River Forge + citadelBreakReduction: 0.1 recipes: - Enchant_DepthStrider_I - Enchant_Respiration_I @@ -819,6 +881,7 @@ factories: oceanforge: type: FCCUPGRADE name: Ocean Forge + citadelBreakReduction: 0.05 recipes: - Enchant_DepthStrider_I - Enchant_DepthStrider_II @@ -834,6 +897,7 @@ factories: magicforge: type: FCCUPGRADE name: Magic Forge + citadelBreakReduction: 0.1 recipes: - Enchant_FeatherFalling_I - Enchant_FeatherFalling_II @@ -845,6 +909,7 @@ factories: arcaneforge: type: FCCUPGRADE name: Arcane Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Infinity_I - Enchant_Pickaxe_SilkTouch_I @@ -864,6 +929,7 @@ factories: mithrilforge: type: FCCUPGRADE name: Mithril Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Helmet_Protection_I - Enchant_Chestplate_Protection_I @@ -879,6 +945,7 @@ factories: titaniumforge: type: FCCUPGRADE name: Titanium Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Helmet_Protection_I - Enchant_Helmet_Protection_II @@ -911,6 +978,7 @@ factories: Meteorforge: type: FCCUPGRADE name: Meteor Forge + citadelBreakReduction: 0.025 recipes: - Enchant_Helmet_Protection_I - Enchant_Helmet_Protection_II @@ -952,6 +1020,7 @@ factories: archerforge: type: FCCUPGRADE name: Archer Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Power_I - Enchant_Power_II @@ -964,6 +1033,7 @@ factories: marksmanforge: type: FCCUPGRADE name: Marksman Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Power_I - Enchant_Power_II @@ -987,6 +1057,7 @@ factories: sniperforge: type: FCCUPGRADE name: Sniper Forge + citadelBreakReduction: 0.025 recipes: - Enchant_Power_I - Enchant_Power_II @@ -1016,6 +1087,7 @@ factories: daggerforge: type: FCCUPGRADE name: Dagger Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Sharpness_I - Enchant_Sharpness_II @@ -1026,6 +1098,7 @@ factories: swordforge: type: FCCUPGRADE name: Sword Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Sharpness_I - Enchant_Sharpness_II @@ -1041,6 +1114,7 @@ factories: bladeforge: type: FCCUPGRADE name: Blade Forge + citadelBreakReduction: 0.025 recipes: - Enchant_Sharpness_I - Enchant_Sharpness_II @@ -1059,6 +1133,7 @@ factories: quickforge: type: FCCUPGRADE name: Quick Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Pickaxe_Efficiency_I - Enchant_Pickaxe_Efficiency_II @@ -1072,6 +1147,7 @@ factories: rapidforge: type: FCCUPGRADE name: Rapid Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Pickaxe_Efficiency_I - Enchant_Pickaxe_Efficiency_II @@ -1092,6 +1168,7 @@ factories: sonicforge: type: FCCUPGRADE name: Sonic Forge + citadelBreakReduction: 0.025 recipes: - Enchant_Pickaxe_Efficiency_I - Enchant_Pickaxe_Efficiency_II @@ -1115,6 +1192,7 @@ factories: rockforge: type: FCCUPGRADE name: Rock Forge + citadelBreakReduction: 0.1 recipes: - Enchant_Pickaxe_Unbreaking_I - Enchant_Axe_Unbreaking_I @@ -1131,6 +1209,7 @@ factories: metalforge: type: FCCUPGRADE name: Metal Forge + citadelBreakReduction: 0.05 recipes: - Enchant_Pickaxe_Unbreaking_I - Enchant_Pickaxe_Unbreaking_II @@ -1157,6 +1236,7 @@ factories: carbonforge: type: FCCUPGRADE name: Carbon Forge + citadelBreakReduction: 0.025 recipes: - Enchant_Pickaxe_Unbreaking_I - Enchant_Pickaxe_Unbreaking_II @@ -1194,6 +1274,7 @@ factories: apprenticetransmuter: type: FCCUPGRADE name: Apprentice Transmuter + citadelBreakReduction: 0.1 recipes: - Aspen_Enrichment - Cypress_Enrichment @@ -1203,6 +1284,7 @@ factories: adepttransmuter: type: FCCUPGRADE name: Adept Transmuter + citadelBreakReduction: 0.05 recipes: - Aspen_Enrichment - Cypress_Enrichment @@ -1215,6 +1297,7 @@ factories: grandmastertransmuter: type: FCCUPGRADE name: Grandmaster Transmuter + citadelBreakReduction: 0.025 recipes: - Aspen_Enrichment - Cypress_Enrichment @@ -11674,4 +11757,4 @@ recipes: dirt: material: DIRT -renames: +renames: \ No newline at end of file From 985a0513e39137e5fc531e3d448627b39fcfdfab Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 9 Sep 2016 04:36:18 +0200 Subject: [PATCH 446/459] Fix skulls in strong hunter component --- src/main/resources/configCivcraft.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 57c6dd7c..3eb72560 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -11550,7 +11550,8 @@ recipes: amount: 6 witherskull: material: SKULL_ITEM - durability: 2 + durability: 1 + amount: 2 output: strongHunter: material: GHAST_TEAR @@ -11757,4 +11758,4 @@ recipes: dirt: material: DIRT -renames: \ No newline at end of file +renames: From 4a204717ef5f9e2c0abc7cef707917d3acb2f498 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Fri, 9 Sep 2016 06:12:00 +0200 Subject: [PATCH 447/459] Properly sort factory blocks when loading and make citadel thing work --- .../factories/FurnCraftChestFactory.java | 1 + .../structures/FurnCraftChestStructure.java | 14 ++-- .../FactoryMod/utility/FileHandler.java | 68 +++++++++++++++---- 3 files changed, 63 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 519096c1..85f3ade6 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -62,6 +62,7 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, this.active = false; this.recipes = recipes; this.runCount = new HashMap(); + this.citadelBreakReduction = citadelBreakReduction; for (IRecipe rec : recipes) { runCount.put(rec, 0); } diff --git a/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java index fede08cc..4144a80a 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -78,6 +78,12 @@ public FurnCraftChestStructure(Block center) { complete = false; } } + + public FurnCraftChestStructure(List blocks) { + craftingTable = blocks.get(0); + furnace = blocks.get(1); + chest = blocks.get(2); + } public void recheckComplete() { complete = craftingTable != null @@ -89,12 +95,6 @@ public void recheckComplete() { && chest.getBlock().getType() == Material.CHEST; } - public FurnCraftChestStructure(List blocks) { - craftingTable = blocks.get(0); - furnace = blocks.get(1); - chest = blocks.get(2); - } - public boolean isComplete() { return complete; } @@ -140,7 +140,7 @@ public List getAllBlocks() { } public Location getCenter() { - return chest; + return craftingTable; } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java index ff41064b..4b1aaf62 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -2,10 +2,12 @@ import java.io.File; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.UUID; import org.bukkit.Bukkit; @@ -40,6 +42,8 @@ public class FileHandler { private File backup; private Map factoryRenames; + + private static int saveFileVersion = 2; public FileHandler(FactoryModManager manager, Map factoryRenames) { plugin = FactoryMod.getPlugin(); @@ -63,15 +67,13 @@ public void save(Collection factories) { saveFile.createNewFile(); YamlConfiguration config = YamlConfiguration .loadConfiguration(saveFile); + config.set("version", saveFileVersion); for (Factory f : factories) { String current = serializeLocation(f.getMultiBlockStructure() .getCenter()); config.set(current + ".name", f.getName()); - config.getConfigurationSection(current).createSection("blocks"); - for (Location b : f.getMultiBlockStructure().getAllBlocks()) { - configureLocation(config.getConfigurationSection(current) - .getConfigurationSection("blocks"), b); - } + ConfigurationSection blockSection = config.getConfigurationSection(current).createSection("blocks"); + configureLocation(blockSection, f.getMultiBlockStructure().getAllBlocks()); if (f instanceof FurnCraftChestFactory) { FurnCraftChestFactory fccf = (FurnCraftChestFactory) f; config.set(current + ".type", "FCC"); @@ -132,12 +134,15 @@ public void save(Collection factories) { } } - private void configureLocation(ConfigurationSection config, Location loc) { - String identifier = serializeLocation(loc); - config.set(identifier + ".world", loc.getWorld().getName()); - config.set(identifier + ".x", loc.getBlockX()); - config.set(identifier + ".y", loc.getBlockY()); - config.set(identifier + ".z", loc.getBlockZ()); + private void configureLocation(ConfigurationSection config, List locations) { + int count = 0; + for(Location loc : locations) { + String identifier = "a" + count++ + serializeLocation(loc); + config.set(identifier + ".world", loc.getWorld().getName()); + config.set(identifier + ".x", loc.getBlockX()); + config.set(identifier + ".y", loc.getBlockY()); + config.set(identifier + ".z", loc.getBlockZ()); + } } private String serializeLocation(Location loc) { @@ -163,14 +168,19 @@ private void loadFromFile(File f, Map eggs) { int counter = 0; YamlConfiguration config = YamlConfiguration .loadConfiguration(saveFile); + int loadedVersion = config.getInt("version", 1); for (String key : config.getKeys(false)) { ConfigurationSection current = config.getConfigurationSection(key); + if (current == null) { + continue; + } String type = current.getString("type"); String name = current.getString("name"); int runtime = current.getInt("runtime"); List blocks = new LinkedList(); - for (String blockKey : current.getConfigurationSection("blocks") - .getKeys(false)) { + Set blockKeys = current.getConfigurationSection("blocks").getKeys(false); + Collections.sort(new LinkedList (blockKeys)); + for (String blockKey : blockKeys) { ConfigurationSection currSec = current.getConfigurationSection( "blocks").getConfigurationSection(blockKey); String worldName = currSec.getString("world"); @@ -182,6 +192,38 @@ private void loadFromFile(File f, Map eggs) { } switch (type) { case "FCC": + if (loadedVersion == 1) { + //need to sort the locations properly, because they werent previously + List sortedList = new LinkedList(); + int totalX = 0; + int totalY = 0; + int totalZ = 0; + for(Location loc : blocks) { + totalX += loc.getBlockX(); + totalY += loc.getBlockY(); + totalZ += loc.getBlockZ(); + } + Location center = new Location(blocks.get(0).getWorld(), totalX / 3, totalY / 3, totalZ / 3); + if (!blocks.contains(center)) { + plugin.warning("Failed to convert location for factory at " + blocks.get(0).toString() + "; calculated center: " + center.toString()); + } + else { + blocks.remove(center); + sortedList.add(center); + //we cant guarantee that this will work, it might very well fail for partially broken factories, but it's the best thing I got + if (blocks.get(0).getBlock().getType() == Material.CHEST) { + sortedList.add(blocks.get(1)); + sortedList.add(blocks.get(0)); + } + else { + sortedList.add(blocks.get(0)); + sortedList.add(blocks.get(1)); + } + blocks = sortedList; + } + + + } FurnCraftChestEgg egg = (FurnCraftChestEgg) eggs.get(name); if (egg == null) { String replaceName = factoryRenames.get(name); From 68e5bbfe1cf30e90a762873c7af9b474568d3461 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 20 Sep 2016 00:39:08 +0200 Subject: [PATCH 448/459] Add recipe scaling and upgrades --- pom.xml | 1 + .../igotyou/FactoryMod/ConfigParser.java | 74 ++++++++++- .../commands/FactoryModCommandHandler.java | 2 + .../commands/RunAmountSetterCommand.java | 63 ++++++++++ .../FactoryMod/eggs/FurnCraftChestEgg.java | 2 +- .../factories/FurnCraftChestFactory.java | 39 +++++- .../FurnCraftChestInteractionManager.java | 25 +++- .../FactoryMod/recipes/AOERepairRecipe.java | 6 +- .../FactoryMod/recipes/CompactingRecipe.java | 12 +- .../recipes/DecompactingRecipe.java | 12 +- .../DeterministicEnchantingRecipe.java | 12 +- .../recipes/DummyParsingRecipe.java | 8 +- .../recipes/FactoryMaterialReturnRecipe.java | 15 ++- .../igotyou/FactoryMod/recipes/IRecipe.java | 4 +- .../FactoryMod/recipes/InputRecipe.java | 45 ++++--- .../FactoryMod/recipes/LoreEnchantRecipe.java | 12 +- .../FactoryMod/recipes/ProductionRecipe.java | 94 ++++++++++---- .../FactoryMod/recipes/PylonRecipe.java | 7 +- .../recipes/RandomEnchantingRecipe.java | 11 +- .../recipes/RandomOutputRecipe.java | 14 +-- .../recipes/RecipeScalingUpgradeRecipe.java | 115 ++++++++++++++++++ .../FactoryMod/recipes/RepairRecipe.java | 17 +-- .../FactoryMod/recipes/Upgraderecipe.java | 16 +-- .../scaling/ProductionRecipeModifier.java | 92 ++++++++++++++ .../FactoryMod/utility/FileHandler.java | 13 ++ .../FactoryMod/utility/MenuBuilder.java | 10 +- src/main/resources/plugin.yml | 2 + 27 files changed, 592 insertions(+), 131 deletions(-) create mode 100644 src/main/java/com/github/igotyou/FactoryMod/commands/commands/RunAmountSetterCommand.java create mode 100644 src/main/java/com/github/igotyou/FactoryMod/recipes/RecipeScalingUpgradeRecipe.java create mode 100644 src/main/java/com/github/igotyou/FactoryMod/recipes/scaling/ProductionRecipeModifier.java diff --git a/pom.xml b/pom.xml index 6e94a837..560098c9 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,7 @@ https://github.com/Civcraft/FactoryMod + UTF-8 1.8 1.8 diff --git a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java index 6e79f495..ea46922d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java @@ -1,13 +1,11 @@ package com.github.igotyou.FactoryMod; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Set; import java.util.TreeMap; import org.bukkit.Material; @@ -38,8 +36,10 @@ import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.PylonRecipe; import com.github.igotyou.FactoryMod.recipes.RandomOutputRecipe; +import com.github.igotyou.FactoryMod.recipes.RecipeScalingUpgradeRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; +import com.github.igotyou.FactoryMod.recipes.scaling.ProductionRecipeModifier; import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.PipeStructure; @@ -55,6 +55,7 @@ public class ConfigParser { private double defaultReturnRate; private HashMap upgradeEggs; private HashMap> recipeLists; + private HashMap recipeScalingUpgradeMapping; private String defaultMenuFactory; private long defaultBreakGracePeriod; private int defaultDamagePerBreakPeriod; @@ -136,8 +137,10 @@ public void run() { logInventories, factoryRenames); upgradeEggs = new HashMap(); recipeLists = new HashMap>(); + recipeScalingUpgradeMapping = new HashMap(); parseFactories(config.getConfigurationSection("factories")); parseRecipes(config.getConfigurationSection("recipes")); + assignRecipeScalingRecipes(); assignRecipesToFactories(); enableFactoryDecay(config); manager.calculateTotalSetupCosts(); @@ -558,7 +561,11 @@ private IRecipe parseRecipe(ConfigurationSection config) { else { output = parseItemMap(outputSection); } - result = new ProductionRecipe(identifier, name, productionTime, input, output); + ProductionRecipeModifier modi = parseProductionRecipeModifier(config.getConfigurationSection("modi")); + if (modi == null && parentRecipe instanceof ProductionRecipe) { + modi = ((ProductionRecipe) parentRecipe).getModifier().clone(); + } + result = new ProductionRecipe(identifier, name, productionTime, input, output, modi); break; case "COMPACT": String compactedLore = config.getString("compact_lore", @@ -787,6 +794,18 @@ private IRecipe parseRecipe(ConfigurationSection config) { } result = new LoreEnchantRecipe(identifier, name, productionTime, input, toolMap, appliedLore, overwrittenLore); break; + case "RECIPEMODIFIERUPGRADE": + int rank = config.getInt("rank"); + String toUpgrade = config.getString("recipeUpgraded"); + if (toUpgrade == null) { + plugin.warning("No recipe to upgrade specified at " + config.getCurrentPath()); + return null; + } + String followUpRecipe = config.getString("followUpRecipe"); + result = new RecipeScalingUpgradeRecipe(identifier, name, productionTime, input, null, rank, null); + String [] data = {toUpgrade, followUpRecipe}; + recipeScalingUpgradeMapping.put((RecipeScalingUpgradeRecipe) result, data); + break; case "DUMMY": result = new DummyParsingRecipe(identifier, name, productionTime, null); break; @@ -850,6 +869,55 @@ public void assignRecipesToFactories() { } } + private ProductionRecipeModifier parseProductionRecipeModifier(ConfigurationSection config) { + ProductionRecipeModifier modi = new ProductionRecipeModifier(); + if (config == null) { + return null; + } + for(String key : config.getKeys(false)) { + ConfigurationSection current = config.getConfigurationSection(key); + if (current == null) { + plugin.warning("Found invalid config value at " + config.getCurrentPath() + " " + key + ". Only identifiers for recipe modifiers allowed at this level"); + continue; + } + int minimumRunAmount = current.getInt("minimumRunAmount"); + int maximumRunAmount = current.getInt("maximumRunAmount"); + double minimumMultiplier = current.getDouble("baseMultiplier"); + double maximumMultiplier = current.getDouble("maximumMultiplier"); + int rank = current.getInt("rank"); + modi.addConfig(minimumRunAmount, maximumRunAmount, minimumMultiplier, maximumMultiplier, rank); + } + return modi; + } + + private void assignRecipeScalingRecipes() { + for(Entry entry : recipeScalingUpgradeMapping.entrySet()) { + IRecipe prod = recipes.get(entry.getValue() [0]); + if (prod == null) { + plugin.warning("The recipe " + entry.getValue() [0] + ", which the recipe " + entry.getKey().getName() + " is supposed to upgrade doesnt exist"); + continue; + } + if (!(prod instanceof ProductionRecipe)) { + plugin.warning("The recipe " + entry.getKey().getName() + " has a non production recipe specified as recipe to upgrade, this doesnt work"); + continue; + } + entry.getKey().setUpgradedRecipe((ProductionRecipe) prod); + String followUp = entry.getValue() [1]; + if (followUp != null) { + IRecipe followRecipe = recipes.get(followUp); + if (followRecipe == null) { + plugin.warning("The recipe " + entry.getValue() [0] + ", which the recipe " + entry.getKey().getName() + " is supposed to use as follow up recipe doesnt exist"); + continue; + } + if (!(followRecipe instanceof RecipeScalingUpgradeRecipe)) { + plugin.warning("The recipe " + entry.getKey().getName() + " has a non recipe scaling upgrade recipe specified as recipe to follow up with, this doesnt work"); + continue; + } + entry.getKey().setFollowUpRecipe((RecipeScalingUpgradeRecipe) followRecipe); + } + } + } + public String getDefaultMenuFactory() { return defaultMenuFactory; } diff --git a/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java b/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java index 4cdd7f73..77921c8c 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java @@ -8,6 +8,7 @@ import com.github.igotyou.FactoryMod.FactoryMod; import com.github.igotyou.FactoryMod.commands.commands.Create; import com.github.igotyou.FactoryMod.commands.commands.Menu; +import com.github.igotyou.FactoryMod.commands.commands.RunAmountSetterCommand; import vg.civcraft.mc.civmodcore.command.CommandHandler; @@ -15,6 +16,7 @@ public class FactoryModCommandHandler extends CommandHandler{ public void registerCommands() { addCommands(new Menu("fm")); addCommands(new Create("fmc")); + addCommands(new RunAmountSetterCommand("fmsrc")); } public static List tabCompleteFactory(CommandSender arg0, String [] arg1) { diff --git a/src/main/java/com/github/igotyou/FactoryMod/commands/commands/RunAmountSetterCommand.java b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/RunAmountSetterCommand.java new file mode 100644 index 00000000..f307cfc6 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/RunAmountSetterCommand.java @@ -0,0 +1,63 @@ +package com.github.igotyou.FactoryMod.commands.commands; + +import java.util.List; +import java.util.Set; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.FactoryMod; +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +import vg.civcraft.mc.civmodcore.command.PlayerCommand; + +public class RunAmountSetterCommand extends PlayerCommand { + + public RunAmountSetterCommand(String name) { + super(name); + setIdentifier("fmsrc"); + setDescription("Sets the amount of runs for the currently selected recipe in the factory you are looking at"); + setUsage("/fmsrc "); + setArguments(0, 1); + } + + @Override + public boolean execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage(ChatColor.MAGIC + + "How the hell is this supposed to work"); + return true; + } + Player p = (Player) sender; + int newAmount; + try { + newAmount = Integer.parseInt(args[0]); + } + catch(NumberFormatException e) { + p.sendMessage(ChatColor.RED + args [0] + " is not a number"); + return true; + } + FactoryModManager manager = FactoryMod.getManager(); + for(Block b : p.getLineOfSight((Set )null, 15)) { + Factory f = manager.getFactoryAt(b); + if (f instanceof FurnCraftChestFactory) { + FurnCraftChestFactory fccf = (FurnCraftChestFactory) f; + fccf.setRunCount(fccf.getCurrentRecipe(), newAmount); + p.sendMessage(ChatColor.GREEN + "Set runcount for recipe " + fccf.getCurrentRecipe().getName() + " in " + fccf.getName() + " to "+ newAmount); + } + } + return true; + } + + @Override + public List tabComplete(CommandSender arg0, String[] arg1) { + return null; + } + + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java index a8405238..d4bf70f2 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -107,7 +107,7 @@ public Factory revive(List blocks, int health, fuel, fuelConsumptionIntervall); FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(health, maximumHealth, breakTime, healthPerDamagePeriod, breakGracePeriod); - List currRecipes = new ArrayList (recipes); + List currRecipes = new ArrayList (); for(String recName : recipeStrings) { boolean found = false; for(IRecipe exRec : currRecipes) { diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 85f3ade6..97d9e070 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -32,6 +32,7 @@ import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; import com.github.igotyou.FactoryMod.recipes.PylonRecipe; +import com.github.igotyou.FactoryMod.recipes.RecipeScalingUpgradeRecipe; import com.github.igotyou.FactoryMod.recipes.RepairRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.repairManager.IRepairManager; @@ -50,6 +51,7 @@ public class FurnCraftChestFactory extends Factory { protected List recipes; protected IRecipe currentRecipe; protected Map runCount; + protected Map recipeLevel; private UUID activator; private double citadelBreakReduction; @@ -60,11 +62,11 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, String name, List recipes, double citadelBreakReduction) { super(im, rm, ipm, mbs, updateTime, name); this.active = false; - this.recipes = recipes; this.runCount = new HashMap(); + this.recipeLevel = new HashMap(); this.citadelBreakReduction = citadelBreakReduction; for (IRecipe rec : recipes) { - runCount.put(rec, 0); + addRecipe(rec); } if (pylonFactories == null) { pylonFactories = new HashSet(); @@ -244,6 +246,12 @@ public void setRunCount(IRecipe r, Integer count) { runCount.put(r, count); } } + + public void setRecipeLevel(IRecipe r, Integer level) { + if (recipes.contains(r)) { + recipeLevel.put(r, level); + } + } /** * @return UUID of the person who activated the factory or null if the @@ -321,12 +329,13 @@ else if (currentProductionTimer >= currentRecipe + currentRecipe.getName() + " for " + getLogData() + " was cancelled over the event"); + deactivate(); return; } sendActivatorMessage(ChatColor.GOLD + currentRecipe.getName() + " in " + name + " completed"); - if (currentRecipe instanceof Upgraderecipe) { + if (currentRecipe instanceof Upgraderecipe || currentRecipe instanceof RecipeScalingUpgradeRecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of // other stuff, this is needed @@ -409,6 +418,10 @@ public void setRecipe(IRecipe pr) { public int getRunCount(IRecipe r) { return runCount.get(r); } + + public int getRecipeLevel(IRecipe r) { + return recipeLevel.get(r); + } private void sendActivatorMessage(String msg) { if (activator != null) { @@ -418,6 +431,26 @@ private void sendActivatorMessage(String msg) { } } } + + /** + * Adds the given recipe to this factory + * @param rec Recipe to add + */ + public void addRecipe(IRecipe rec) { + recipes.add(rec); + runCount.put(rec, 0); + recipeLevel.put(rec, 1); + } + + /** + * Removes the given recipe from this factory + * @param rec Recipe to remove + */ + public void removeRecipe(IRecipe rec) { + recipes.remove(rec); + runCount.remove(rec); + recipeLevel.remove(rec); + } /** * Sets the internal production timer diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 5ee7f4a1..21ace7ec 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -1,5 +1,6 @@ package com.github.igotyou.FactoryMod.interactionManager; +import java.text.DecimalFormat; import java.util.HashMap; import java.util.List; @@ -26,20 +27,24 @@ import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; public class FurnCraftChestInteractionManager implements IInteractionManager { + private FurnCraftChestFactory fccf; private HashMap recipes = new HashMap(); + private DecimalFormat decimalFormatting; public FurnCraftChestInteractionManager(FurnCraftChestFactory fccf) { - this.fccf = fccf; + this(); + this.fccf = fccf; } public FurnCraftChestInteractionManager() { - + this.decimalFormatting = new DecimalFormat("#.#####"); } public void setFactory(FurnCraftChestFactory fccf) { @@ -111,7 +116,7 @@ public void leftClick(Player p, Block b, BlockFace bf) { .getCurrentRecipe().getName()); int index = 4; List inp = ((InputRecipe) fccf.getCurrentRecipe()) - .getInputRepresentation(fccf.getInventory()); + .getInputRepresentation(fccf.getInventory(), fccf); if (inp.size() > 18) { inp = new ItemMap(inp).getLoredItemCountRepresentation(); } @@ -141,7 +146,7 @@ public void clicked(Player arg0) { } index = 49; List outp = ((InputRecipe) fccf.getCurrentRecipe()) - .getOutputRepresentation(fccf.getInventory()); + .getOutputRepresentation(fccf.getInventory(), fccf); if (outp.size() > 18) { outp = new ItemMap(outp).getLoredItemCountRepresentation(); } @@ -220,11 +225,19 @@ public void clicked(Player arg0) { for (IRecipe rec : fccf.getRecipes()) { InputRecipe recipe = (InputRecipe) (rec); ItemStack recStack = recipe.getRecipeRepresentation(); + int runcount = fccf.getRunCount(recipe); ISUtils.addLore( recStack, - ChatColor.GOLD + "Ran " - + String.valueOf(fccf.getRunCount(recipe)) + ChatColor.AQUA + "Ran " + + String.valueOf(runcount) + " times"); + if (recipe instanceof ProductionRecipe) { + ProductionRecipe prod = (ProductionRecipe) recipe; + if (prod.getModifier() != null) { + ISUtils.addLore(recStack, ChatColor.BOLD + " " + ChatColor.GOLD + String.valueOf(fccf.getRecipeLevel(recipe)) + " ★"); + ISUtils.addLore(recStack, ChatColor.GREEN + "Current output multiplier: " + decimalFormatting.format(prod.getModifier().getFactor(fccf.getRecipeLevel(recipe), runcount))); + } + } Clickable c = new Clickable(recStack) { @Override diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java index 818d0a8c..dcc5ea87 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -38,7 +38,7 @@ public ItemStack getRecipeRepresentation() { return essence; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { Chest c = (Chest) i.getHolder(); Location loc = c.getLocation(); List facs = getNearbyFactoriesSortedByDistance(loc); @@ -96,7 +96,7 @@ private List getNearbyFactoriesSortedByDistance( return list; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { Chest c = (Chest) i.getHolder(); Location loc = c.getLocation(); List facs = getNearbyFactoriesSortedByDistance(loc); @@ -131,7 +131,7 @@ public List getOutputRepresentation(Inventory i) { return bla; } - public void applyEffect(Inventory i, Factory f) { + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { Chest c = (Chest) i.getHolder(); Location loc = c.getLocation(); List facs = getNearbyFactoriesSortedByDistance(loc); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java index 2dddad93..847d4b64 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -12,7 +12,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.FactoryMod; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; /** * Used to compact items, which means whole or multiple stacks of an item are reduced to a single lored item, which is stackable to the same stacksize @@ -55,8 +55,8 @@ public String getName() { return name; } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); if (input.isContainedIn(i)) { ItemMap im = new ItemMap(i); //technically we could just directly work with the ItemMap here to iterate over the items so we dont check identical items multiple times, @@ -73,11 +73,11 @@ public void applyEffect(Inventory i, Factory f) { } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List result = new LinkedList(); if (i == null) { result.add(new ItemStack(Material.STONE, 64)); @@ -98,7 +98,7 @@ public List getInputRepresentation(Inventory i) { return result; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List result = new LinkedList(); if (i == null) { ItemStack is = new ItemStack(Material.STONE, 64); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java index 472b3e31..d9189d6d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -11,7 +11,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; /** * Used to decompact itemstacks, which means a single item with compacted lore @@ -42,8 +42,8 @@ public boolean enoughMaterialAvailable(Inventory i) { return false; } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); if (input.isContainedIn(i)) { for (ItemStack is : i.getContents()) { if (is != null) { @@ -68,10 +68,10 @@ public void applyEffect(Inventory i, Factory f) { } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List result = new LinkedList(); if (i == null) { ItemStack is = new ItemStack(Material.STONE, 64); @@ -101,7 +101,7 @@ public ItemStack getRecipeRepresentation() { return res; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List result = new LinkedList(); if (i == null) { result.add(new ItemStack(Material.STONE, 64)); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java index 2ae36ce2..08ea91e7 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -12,7 +12,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; public class DeterministicEnchantingRecipe extends InputRecipe { private Enchantment enchant; @@ -52,7 +52,7 @@ public ItemStack getRecipeRepresentation() { return is; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { ItemStack is = tool.getItemStackRepresentation().get(0); ItemMeta im = is.getItemMeta(); im.removeEnchant(enchant); @@ -73,7 +73,7 @@ public List getOutputRepresentation(Inventory i) { return stacks; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { List bla = input.getItemStackRepresentation(); bla.add(tool.getItemStackRepresentation().get(0)); @@ -87,8 +87,8 @@ public List getInputRepresentation(Inventory i) { return returns; } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); if (input.removeSafelyFrom(i)) { ItemStack toolio = tool.getItemStackRepresentation().get(0); for (ItemStack is : i.getContents()) { @@ -104,7 +104,7 @@ public void applyEffect(Inventory i, Factory f) { } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } @Override diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java index 05aa16d7..d774fc4a 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DummyParsingRecipe.java @@ -5,7 +5,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -16,16 +16,16 @@ public DummyParsingRecipe(String identifier, String name, int productionTime, It } @Override - public void applyEffect(Inventory i, Factory f) { + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { } @Override - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { return null; } @Override - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { return null; } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java index 89fd00c9..09f6044f 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -17,7 +17,6 @@ import org.bukkit.inventory.meta.ItemMeta; import com.github.igotyou.FactoryMod.FactoryMod; -import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; @@ -33,14 +32,14 @@ public FactoryMaterialReturnRecipe(String identifier, String name, int productio this.factor = factor; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } return createLoredStacksForInfo(i); } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { ItemStack is = new ItemStack(Material.PAPER); ISUtils.setName(is, "Total setupcost"); @@ -67,19 +66,19 @@ public ItemStack getRecipeRepresentation() { return is; } - public void applyEffect(Inventory i, final Factory f) { - FactoryMod.getManager().removeFactory(f); - for (Block b : f.getMultiBlockStructure().getRelevantBlocks()) { + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + FactoryMod.getManager().removeFactory(fccf); + for (Block b : fccf.getMultiBlockStructure().getRelevantBlocks()) { b.setType(Material.AIR); } Bukkit.getScheduler().runTaskLater(FactoryMod.getPlugin(), new Runnable() { @Override public void run() { - Location dropLoc = f.getMultiBlockStructure() + Location dropLoc = fccf.getMultiBlockStructure() .getCenter(); for (Entry items : FactoryMod - .getManager().getTotalSetupCost(f) + .getManager().getTotalSetupCost(fccf) .getEntrySet()) { int returnAmount = (int) (items.getValue() * factor); ItemMap im = new ItemMap(); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java index eb2ff8f0..43b97530 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -2,7 +2,7 @@ import org.bukkit.inventory.Inventory; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; /** * Encapsulates a specific functionality for a FurnCraftChest factory. Each @@ -45,7 +45,7 @@ public interface IRecipe { * @param f * Factory which is run */ - public void applyEffect(Inventory i, Factory f); + public void applyEffect(Inventory i, FurnCraftChestFactory f); /** * Each implementation of this class has to specify a unique identifier, diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java index 7394e096..aaea6e59 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.utility.LoggingUtils; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; @@ -35,43 +36,49 @@ public InputRecipe(String identifier, String name, int productionTime, ItemMap i /** * Used to get a representation of a recipes input materials, which is * displayed in an item gui to illustrate the recipe and to give additional - * information. If null is given instead of an inventory just general - * information should be returned, which doesnt depend on a specific + * information. If null is given instead of an inventory or factory, just + * general information should be returned, which doesnt depend on a specific * instance * * @param i * Inventory for which the recipe would be run, this is used to * add lore to the items, which tells how often the recipe could * be run + * @param fccf + * Factory for which the representation is meant. Needed for + * recipe run scaling * @return List of itemstacks which represent the input required to run this * recipe */ - public abstract List getInputRepresentation(Inventory i); + public abstract List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf); /** * Used to get a representation of a recipes output materials, which is * displayed in an item gui to illustrate the recipe and to give additional - * information. If null is given instead of an inventory just general - * information should be returned, which doesnt depend on a specific + * information. If null is given instead of an inventory or factory, just + * general information should be returned, which doesnt depend on a specific * instance * * @param i * Inventory for which the recipe would be run, this is used to * add lore to the items, which tells how often the recipe could * be run + * @param fccf + * Factory for which the representation is meant. Needed for + * recipe run scaling * @return List of itemstacks which represent the output returned when * running this recipe */ - public abstract List getOutputRepresentation(Inventory i); + public abstract List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf); public String getName() { return name; } - + public int getFuelConsumptionIntervall() { return fuel_consumption_intervall; } - + public void setFuelConsumptionIntervall(int intervall) { this.fuel_consumption_intervall = intervall; } @@ -87,7 +94,7 @@ public ItemMap getInput() { public boolean enoughMaterialAvailable(Inventory i) { return input.isContainedIn(i); } - + public String getIdentifier() { return identifier; } @@ -115,10 +122,7 @@ protected List createLoredStacksForInfo(Inventory i) { ItemMap possibleRuns = new ItemMap(); for (Entry entry : input.getEntrySet()) { if (inventoryMap.getAmount(entry.getKey()) != 0) { - possibleRuns.addItemAmount( - entry.getKey(), - inventoryMap.getAmount(entry.getKey()) - / entry.getValue()); + possibleRuns.addItemAmount(entry.getKey(), inventoryMap.getAmount(entry.getKey()) / entry.getValue()); } else { possibleRuns.addItemAmount(entry.getKey(), 0); @@ -126,21 +130,24 @@ protected List createLoredStacksForInfo(Inventory i) { } for (ItemStack is : input.getItemStackRepresentation()) { - ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns.getAmount(is)) + " runs"); + ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + String.valueOf(possibleRuns.getAmount(is)) + + " runs"); result.add(is); } return result; } protected void logBeforeRecipeRun(Inventory i, Factory f) { - LoggingUtils.logInventory(i, "Before executing recipe " + name - + " for " + f.getLogData()); + LoggingUtils.logInventory(i, "Before executing recipe " + name + " for " + f.getLogData()); } protected void logAfterRecipeRun(Inventory i, Factory f) { - LoggingUtils.logInventory(i, "After executing recipe " + name + " for " - + f.getLogData()); + LoggingUtils.logInventory(i, "After executing recipe " + name + " for " + f.getLogData()); + } + + @Override + public int hashCode() { + return identifier.hashCode(); } } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java index 717086c7..d254008a 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -12,7 +12,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; public class LoreEnchantRecipe extends InputRecipe { @@ -49,7 +49,7 @@ public ItemStack getRecipeRepresentation() { return is; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { ItemStack is = tool.getItemStackRepresentation().get(0); for (String s : appliedLore) { ISUtils.addLore(is, s); @@ -67,7 +67,7 @@ public List getOutputRepresentation(Inventory i) { return stacks; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { List bla = input.getItemStackRepresentation(); ItemStack is = tool.getItemStackRepresentation().get(0); @@ -87,8 +87,8 @@ public List getInputRepresentation(Inventory i) { return returns; } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); if (input.removeSafelyFrom(i)) { ItemStack toolio = tool.getItemStackRepresentation().get(0); for (ItemStack is : i.getContents()) { @@ -111,7 +111,7 @@ public void applyEffect(Inventory i, Factory f) { } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } private boolean hasStackRequiredLore(ItemStack is) { diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 464bd223..40d0d8f2 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -1,6 +1,9 @@ package com.github.igotyou.FactoryMod.recipes; +import java.text.DecimalFormat; import java.util.List; +import java.util.Map.Entry; +import java.util.Random; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -10,7 +13,8 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.recipes.scaling.ProductionRecipeModifier; /** * Consumes a set of materials from a container and outputs another set of @@ -18,64 +22,106 @@ * */ public class ProductionRecipe extends InputRecipe { + private ItemMap output; + private ProductionRecipeModifier modifier; + private Random rng; + private DecimalFormat decimalFormatting; - public ProductionRecipe(String identifier, String name, int productionTime, ItemMap inputs, - ItemMap output) { + public ProductionRecipe(String identifier, String name, int productionTime, ItemMap inputs, ItemMap output, + ProductionRecipeModifier modifier) { super(identifier, name, productionTime, inputs); this.output = output; + this.modifier = modifier; + this.rng = new Random(); + this.decimalFormatting = new DecimalFormat("#.#####"); } public ItemMap getOutput() { return output; } - public int getCurrentMultiplier(Inventory i) { - return input.getMultiplesContainedIn(i); + public ItemMap getAdjustedOutput(int rank, int runs) { + ItemMap im = output.clone(); + if (modifier != null) { + im.multiplyContent(modifier.getFactor(rank, runs)); + return im; + } + return im; + } + + public ItemMap getGuaranteedOutput(int rank, int runs) { + ItemMap adjusted = new ItemMap(); + double factor = modifier.getFactor(rank, runs); + for(Entry entry : output.getEntrySet()) { + adjusted.addItemAmount(entry.getKey(), (int) (Math.floor(entry.getValue() * factor))); + } + return adjusted; } - public ItemMap getCurrentOutput(Inventory i) { - ItemMap copy = output.clone(); - copy.multiplyContent(getCurrentMultiplier(i)); - return copy; + public int getCurrentMultiplier(Inventory i) { + return input.getMultiplesContainedIn(i); } - public List getOutputRepresentation(Inventory i) { - List stacks = output.getItemStackRepresentation(); - if (i == null) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + ItemMap currentOut = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + List stacks = currentOut.getItemStackRepresentation(); + if (i == null || fccf == null) { return stacks; } + double factor = modifier.getFactor(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + for(Entry entry : output.getEntrySet()) { + double additionalChance = (((double) entry.getValue()) * factor) - currentOut.getAmount(entry.getKey()); + if (Math.abs(additionalChance) > 0.00000001) { + ItemStack is = entry.getKey().clone(); + ISUtils.addLore(is, ChatColor.GOLD + decimalFormatting.format(additionalChance) + " chance for additional item"); + stacks.add(is); + } + } int possibleRuns = input.getMultiplesContainedIn(i); for (ItemStack is : stacks) { - ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " - + String.valueOf(possibleRuns) + " runs"); + ISUtils.addLore(is, ChatColor.GREEN + "Enough materials for " + String.valueOf(possibleRuns) + " runs"); } return stacks; } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } - public List getInputRepresentation(Inventory i) { + public List getGuaranteedOutput(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } return createLoredStacksForInfo(i); } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); ItemMap toRemove = input.clone(); - ItemMap toAdd = output.clone(); + ItemMap toAdd = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + double factor = modifier.getFactor(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + for(Entry entry : output.getEntrySet()) { + double additionalChance = (((double) entry.getValue()) * factor) - toAdd.getAmount(entry.getKey()); + if (rng.nextDouble() <= additionalChance) { + toAdd.addItemAmount(entry.getKey(), 1); + } + } if (toRemove.isContainedIn(i)) { if (toRemove.removeSafelyFrom(i)) { - for(ItemStack is: toAdd.getItemStackRepresentation()) { + for (ItemStack is : toAdd.getItemStackRepresentation()) { i.addItem(is); } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } public ItemStack getRecipeRepresentation() { - List out = output.getItemStackRepresentation(); + List out = getOutput().getItemStackRepresentation(); ItemStack res; if (out.size() == 0) { res = new ItemStack(Material.STONE); @@ -85,7 +131,11 @@ public ItemStack getRecipeRepresentation() { ISUtils.setName(res, getName()); return res; } - + + public ProductionRecipeModifier getModifier() { + return modifier; + } + @Override public String getTypeIdentifier() { return "PRODUCTION"; diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java index caf18d6d..26d7572b 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -13,7 +13,6 @@ import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; -import com.github.igotyou.FactoryMod.factories.Factory; import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; public class PylonRecipe extends InputRecipe { @@ -30,7 +29,7 @@ public PylonRecipe(String identifier, String name, int productionTime, ItemMap i this.weight = weight; } - public void applyEffect(Inventory i, Factory f) { + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { if (!input.isContainedIn(i)) { return; } @@ -53,7 +52,7 @@ public static int getGlobalLimit() { return globalLimit; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { ItemMap currOut = getCurrentOutput(); List res = new LinkedList(); for (ItemStack is : currOut.getItemStackRepresentation()) { @@ -67,7 +66,7 @@ public List getOutputRepresentation(Inventory i) { return res; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java index 2d86f436..0da2368d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -15,6 +15,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.NiceNames; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; public class RandomEnchantingRecipe extends InputRecipe { private List enchants; @@ -52,7 +53,7 @@ public ItemStack getRecipeRepresentation() { return is; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { List bla = input.getItemStackRepresentation(); bla.add(new ItemStack(tool)); @@ -66,7 +67,7 @@ public List getInputRepresentation(Inventory i) { return returns; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { ItemStack is = new ItemStack(tool); for (RandomEnchant re : enchants) { is.addEnchantment(re.enchant, re.level); @@ -94,8 +95,8 @@ public List getOutputRepresentation(Inventory i) { return stacks; } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); for (ItemStack is : input.getItemStackRepresentation()) { i.removeItem(is); } @@ -115,7 +116,7 @@ public void applyEffect(Inventory i, Factory f) { break; } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } @Override diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java index fceae86d..e4d07b55 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack; import com.github.igotyou.FactoryMod.FactoryMod; -import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; @@ -46,8 +46,8 @@ public RandomOutputRecipe(String identifier, String name, int productionTime, It } } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); ItemMap toRemove = input.clone(); ItemMap toAdd = null; int counter = 0; @@ -62,7 +62,7 @@ public void applyEffect(Inventory i, Factory f) { } } if (toAdd == null) { - FactoryMod.getPlugin().warning("Unable to find a random item to output. Recipe execution was cancelled," + f.getLogData()); + FactoryMod.getPlugin().warning("Unable to find a random item to output. Recipe execution was cancelled," + fccf.getLogData()); return; } if (toRemove.isContainedIn(i)) { @@ -72,7 +72,7 @@ public void applyEffect(Inventory i, Factory f) { } } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } public Map getOutputs() { @@ -97,14 +97,14 @@ public ItemStack getRecipeRepresentation() { return is; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } return createLoredStacksForInfo(i); } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List items = lowestChanceMap.getItemStackRepresentation(); for (ItemStack is : items) { ISUtils.addLore(is, ChatColor.LIGHT_PURPLE + "Randomized output"); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RecipeScalingUpgradeRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RecipeScalingUpgradeRecipe.java new file mode 100644 index 00000000..92cdeea8 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RecipeScalingUpgradeRecipe.java @@ -0,0 +1,115 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; + +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +public class RecipeScalingUpgradeRecipe extends InputRecipe { + + private ProductionRecipe toUpgrade; + private int newRank; + private RecipeScalingUpgradeRecipe followUpRecipe; + + public RecipeScalingUpgradeRecipe(String identifier, String name, int productionTime, ItemMap input, + ProductionRecipe toUpgrade, int newRank, RecipeScalingUpgradeRecipe followUpRecipe) { + super(identifier, name, productionTime, input); + this.toUpgrade = toUpgrade; + this.newRank = newRank; + this.followUpRecipe = followUpRecipe; + } + + @Override + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + if (toUpgrade == null || !fccf.getRecipes().contains(toUpgrade)) { + return; + } + ItemMap toRemove = input.clone(); + if (toRemove.isContainedIn(i)) { + if (toRemove.removeSafelyFrom(i)) { + if (newRank == 1) { + fccf.addRecipe(toUpgrade); + } + else { + fccf.setRecipeLevel(toUpgrade, newRank); + } + // no longer needed + fccf.removeRecipe(this); + if (followUpRecipe != null) { + fccf.addRecipe(followUpRecipe); + fccf.setRecipe(toUpgrade); + } + } + } + logAfterRecipeRun(i, fccf); + } + + public void setUpgradedRecipe(ProductionRecipe rec) { + this.toUpgrade = rec; + } + + public void setFollowUpRecipe(RecipeScalingUpgradeRecipe rec) { + this.followUpRecipe = rec; + } + + @Override + public String getTypeIdentifier() { + return "RECIPEMODIFIERUPGRADE"; + } + + @Override + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + @Override + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + ItemStack is = getRecipeRepresentation(); + List result = new LinkedList(); + result.add(is); + return result; + } + + @Override + public ItemStack getRecipeRepresentation() { + ItemStack is = new ItemStack(Material.PAPER); + if (toUpgrade == null) { + ISUtils.addLore(is, ChatColor.RED + "ERROR ERROR ERROR ERROR"); + return is; + } + if (newRank == 1) { + ISUtils.addLore(is, ChatColor.GOLD + "Unlock " + toUpgrade.getName()); + } + else { + ISUtils.addLore(is, ChatColor.GOLD + "Upgrade " + toUpgrade.getName() + " to rank " + newRank); + } + ISUtils.addLore(is, ChatColor.GOLD + "Up to " + toUpgrade.getModifier().getMaximumMultiplierForRank(newRank) + + " output multiplier"); + return is; + } + + public IRecipe getToUpgrade() { + return toUpgrade; + } + + public int getNewRank() { + return newRank; + } + + public IRecipe getFollowUpRecipe() { + return followUpRecipe; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java index 917c1f0e..ea3249be 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -11,6 +11,7 @@ import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; import com.github.igotyou.FactoryMod.repairManager.PercentageHealthRepairManager; import com.github.igotyou.FactoryMod.utility.LoggingUtils; @@ -28,7 +29,7 @@ public RepairRecipe(String identifier, String name, int productionTime, ItemMap this.healthPerRun = healthPerRun; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List result = new LinkedList(); ItemStack furn = new ItemStack(Material.FURNACE); ISUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); @@ -36,26 +37,26 @@ public List getOutputRepresentation(Inventory i) { return result; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } return createLoredStacksForInfo(i); } - public void applyEffect(Inventory i, Factory f) { - logBeforeRecipeRun(i, f); + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); if (enoughMaterialAvailable(i)) { if (input.removeSafelyFrom(i)) { - ((PercentageHealthRepairManager) (f.getRepairManager())) + ((PercentageHealthRepairManager) (fccf.getRepairManager())) .repair(healthPerRun); - LoggingUtils.log(((PercentageHealthRepairManager) (f + LoggingUtils.log(((PercentageHealthRepairManager) (fccf .getRepairManager())).getHealth() + " for " - + f.getLogData() + " after repairing"); + + fccf.getLogData() + " after repairing"); } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } public ItemStack getRecipeRepresentation() { diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java index aacd8fc9..f0791fa5 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -29,22 +29,22 @@ public Upgraderecipe(String identifier, String name, int productionTime, ItemMap this.egg = egg; } - public void applyEffect(Inventory i, Factory f) { - logAfterRecipeRun(i, f); - if (input.isContainedIn(i) && f instanceof FurnCraftChestFactory) { + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logAfterRecipeRun(i, fccf); + if (input.isContainedIn(i)) { if (input.removeSafelyFrom(i)) { FurnCraftChestEgg e = (FurnCraftChestEgg) egg; - ((FurnCraftChestFactory) f).upgrade(e.getName(), + fccf.upgrade(e.getName(), e.getRecipes(), e.getFuel(), e.getFuelConsumptionIntervall(), e.getUpdateTime(), e.getMaximumHealth(), e.getDamagePerDamagingPeriod(), e.getBreakGracePeriod(), e.getCitadelBreakReduction()); } } - logAfterRecipeRun(i, f); + logAfterRecipeRun(i, fccf); } public ItemStack getRecipeRepresentation() { - ItemStack res = ((InputRecipe)((FurnCraftChestEgg)egg).getRecipes().get(0)).getOutputRepresentation(null).get(0); + ItemStack res = ((InputRecipe)((FurnCraftChestEgg)egg).getRecipes().get(0)).getOutputRepresentation(null, null).get(0); res.setAmount(1); ItemMeta im = res.getItemMeta(); im.addEnchant(Enchantment.DAMAGE_ALL, 1, true); @@ -54,7 +54,7 @@ public ItemStack getRecipeRepresentation() { return res; } - public List getInputRepresentation(Inventory i) { + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { if (i == null) { return input.getItemStackRepresentation(); } @@ -84,7 +84,7 @@ public List getInputRepresentation(Inventory i) { return result; } - public List getOutputRepresentation(Inventory i) { + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { List res = new LinkedList(); ItemStack cr = new ItemStack(Material.WORKBENCH); ISUtils.setName(cr, egg.getName()); diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/scaling/ProductionRecipeModifier.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/scaling/ProductionRecipeModifier.java new file mode 100644 index 00000000..7ada528e --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/scaling/ProductionRecipeModifier.java @@ -0,0 +1,92 @@ +package com.github.igotyou.FactoryMod.recipes.scaling; + +import java.util.TreeMap; + +public class ProductionRecipeModifier { + + private TreeMap configs; + + public ProductionRecipeModifier() { + this.configs = new TreeMap(); + } + + public double getFactor(int rank, int runAmount) { + ProductionRecipeModifierConfig config = configs.get(rank); + if (config == null) { + //no entry exists, so don't change + return 1.0; + } + return config.getModifier(runAmount); + } + + public void addConfig(int minimumRuns, int maximumRuns, double baseIncrease, double maximumIncrease, int rank) { + configs.put(rank, new ProductionRecipeModifierConfig(minimumRuns, maximumRuns, baseIncrease, maximumIncrease, rank)); + } + + + public ProductionRecipeModifier clone() { + ProductionRecipeModifier modi = new ProductionRecipeModifier(); + for(ProductionRecipeModifierConfig config : this.configs.values()) { + modi.addConfig(config.getMinimumRuns(), config.getMaximumRuns(), config.getBaseIncrease(), config.getMaximumIncrease(), config.getRank()); + } + return modi; + } + + public double getMaximumMultiplierForRank(int rank) { + ProductionRecipeModifierConfig config = configs.get(rank); + if (config == null) { + //no entry exists, so don't change + return 1.0; + } + return config.getMaximumIncrease(); + } + + private class ProductionRecipeModifierConfig { + + private int minimumRuns; + private int maximumRuns; + private double baseIncrease; + private double maximumIncrease; + private int rank; + + public ProductionRecipeModifierConfig(int minimumRuns, int maximumRuns, double baseIncrease, + double maximumIncrease, int rank) { + this.minimumRuns = minimumRuns; + this.maximumIncrease = maximumIncrease; + this.maximumRuns = maximumRuns; + this.baseIncrease = baseIncrease; + this.rank = rank; + } + + public int getMinimumRuns() { + return minimumRuns; + } + + public int getMaximumRuns() { + return maximumRuns; + } + + public double getBaseIncrease() { + return baseIncrease; + } + + public double getMaximumIncrease() { + return maximumIncrease; + } + + public int getRank() { + return rank; + } + + public double getModifier(int runs) { + if (runs > maximumRuns) { + return maximumIncrease; + } + if (runs < minimumRuns) { + return baseIncrease; + } + return (((double) (runs - minimumRuns)) / ((double) (maximumRuns - minimumRuns)) * (maximumIncrease - baseIncrease)) + + baseIncrease; + } + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java index 4b1aaf62..942418fc 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -99,6 +99,7 @@ public void save(Collection factories) { } for(IRecipe i : ((FurnCraftChestFactory) f).getRecipes()) { config.set(current + ".runcounts." + i.getName(), fccf.getRunCount(i)); + config.set(current + ".recipeLevels." + i.getName(), fccf.getRecipeLevel(i)); } } else if (f instanceof Pipe) { Pipe p = (Pipe) f; @@ -270,6 +271,18 @@ private void loadFromFile(File f, Map eggs) { } } } + ConfigurationSection recipeLevels = current.getConfigurationSection("recipeLevels"); + if(recipeLevels != null) { + for(String countKey : recipeLevels.getKeys(false)) { + int runs = recipeLevels.getInt(countKey); + for(IRecipe r : fac.getRecipes()) { + if (r.getName().equals(countKey)) { + fac.setRecipeLevel(r, runs); + break; + } + } + } + } manager.addFactory(fac); counter++; break; diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java index b99dda0e..35ec081b 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -30,6 +30,7 @@ import com.github.igotyou.FactoryMod.factories.Sorter; import com.github.igotyou.FactoryMod.recipes.IRecipe; import com.github.igotyou.FactoryMod.recipes.InputRecipe; +import com.github.igotyou.FactoryMod.recipes.ProductionRecipe; import com.github.igotyou.FactoryMod.recipes.Upgraderecipe; import com.github.igotyou.FactoryMod.structures.FurnCraftChestStructure; @@ -172,8 +173,9 @@ private void openRecipeBrowser(Player p, String facName) { if (recipes.get(i) == null) { continue; } - Clickable c = new Clickable( - ((InputRecipe) recipes.get(i)).getRecipeRepresentation()) { + InputRecipe rec = ((InputRecipe) recipes.get(i)); + ItemStack is = rec.getRecipeRepresentation(); + Clickable c = new Clickable(is) { @Override public void clicked(Player arg0) { openDetailedRecipeBrowser(arg0, @@ -410,7 +412,7 @@ private void openDetailedRecipeBrowser(Player p, String recipeName) { DecorationStack inputClickable = new DecorationStack(inputStack); ci.setSlot(inputClickable, 4); int index = 13; - List ins = rec.getInputRepresentation(null); + List ins = rec.getInputRepresentation(null, null); if (ins.size() > 18) { ins = new ItemMap(ins).getLoredItemCountRepresentation(); } @@ -450,7 +452,7 @@ public void clicked(Player arg0) { ci.setSlot(outputClickable, 31); index = 40; - List out = rec.getOutputRepresentation(null); + List out = rec.getOutputRepresentation(null, null); if (out.size() > 18) { out = new ItemMap(out).getLoredItemCountRepresentation(); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 6de4d045..f562a1a5 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -9,6 +9,8 @@ commands: permission: fm.public fmc: permission: fm.op + fmsrc: + permission: fm.op permissions: fm.public: default: true From 2bbe117b9cdda8e374b6a47bbf60c4786efa66da Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 24 Sep 2016 19:58:03 +0200 Subject: [PATCH 449/459] Add auto select --- .../factories/FurnCraftChestFactory.java | 261 ++++++++++-------- .../FurnCraftChestInteractionManager.java | 17 +- .../FactoryMod/utility/FileHandler.java | 3 + 3 files changed, 165 insertions(+), 116 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 97d9e070..2c12be47 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -54,17 +54,19 @@ public class FurnCraftChestFactory extends Factory { protected Map recipeLevel; private UUID activator; private double citadelBreakReduction; + private boolean autoSelect; private static HashSet pylonFactories; - public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, - IPowerManager ipm, FurnCraftChestStructure mbs, int updateTime, - String name, List recipes, double citadelBreakReduction) { + public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, IPowerManager ipm, + FurnCraftChestStructure mbs, int updateTime, String name, List recipes, + double citadelBreakReduction) { super(im, rm, ipm, mbs, updateTime, name); this.active = false; this.runCount = new HashMap(); this.recipeLevel = new HashMap(); this.citadelBreakReduction = citadelBreakReduction; + this.autoSelect = false; for (IRecipe rec : recipes) { addRecipe(rec); } @@ -96,98 +98,120 @@ public Inventory getInventory() { * should be */ public FurnaceInventory getFurnaceInventory() { - if (!(getFurnace().getType() == Material.FURNACE || getFurnace() - .getType() == Material.BURNING_FURNACE)) { + if (!(getFurnace().getType() == Material.FURNACE || getFurnace().getType() == Material.BURNING_FURNACE)) { return null; } Furnace furnaceBlock = (Furnace) (getFurnace().getState()); return furnaceBlock.getInventory(); } + /** + * Sets autoselect mode for this factory + * + * @param mode + * Whether autoselect should be set to true or false + */ + public void setAutoSelect(boolean mode) { + this.autoSelect = mode; + } + + /** + * @return Whether the factory is in auto select mode + */ + public boolean isAutoSelect() { + return autoSelect; + } + /** * Attempts to turn the factory on and does all the checks needed to ensure * that the factory is allowed to turn on */ public void attemptToActivate(Player p, boolean onStartUp) { - LoggingUtils.log((p != null ? p.getName() : "Redstone") - + " is attempting to activate " + getLogData()); + LoggingUtils.log((p != null ? p.getName() : "Redstone") + " is attempting to activate " + getLogData()); mbs.recheckComplete(); - + //dont activate twice if (active) { return; } - if (mbs.isComplete()) { - if (hasInputMaterials()) { - if (pm.powerAvailable()) { - if (rm.inDisrepair() - && !(currentRecipe instanceof RepairRecipe)) { - if (p != null) { - p.sendMessage(ChatColor.RED - + "This factory is in disrepair, you have to repair it before using it"); - } - return; - } - if (currentRecipe instanceof RepairRecipe - && rm.atFullHealth()) { - if (p != null) { - p.sendMessage("This factory is already at full health!"); - } - return; - } - if (!onStartUp && currentRecipe instanceof Upgraderecipe - && FactoryMod.getManager().isCitadelEnabled()) { - // only allow permitted members to upgrade the factory - ReinforcementManager rm = Citadel - .getReinforcementManager(); - PlayerReinforcement rein = (PlayerReinforcement) rm - .getReinforcement(mbs.getCenter()); - if (rein != null) { - if (p == null) { - return; - } - if (!NameAPI.getGroupManager().hasAccess(rein.getGroup().getName(), - p.getUniqueId(), PermissionType.getPermission("UPGRADE_FACTORY"))) { - p.sendMessage(ChatColor.RED + "You dont have permission to upgrade this factory"); - return; - } - } - } - FactoryActivateEvent fae = new FactoryActivateEvent(this, p); - Bukkit.getPluginManager().callEvent(fae); - if (fae.isCancelled()) { - return; - } + //ensure factory is physically complete + if (!mbs.isComplete()) { + rm.breakIt(); + return; + } + //ensure enough materials for the recipe are available + if (!hasInputMaterials()) { + if (!isAutoSelect()) { + if (p != null) { + p.sendMessage(ChatColor.RED + "Not enough materials available"); + } + return; + } else { + //handle autoselect + IRecipe autoSelected = getAutoSelectRecipe(); + if (autoSelected == null) { if (p != null) { - int consumptionIntervall = ((InputRecipe) currentRecipe) - .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) - .getFuelConsumptionIntervall() : pm - .getPowerConsumptionIntervall(); - if (((FurnacePowerManager) pm).getFuelAmountAvailable() < (currentRecipe - .getProductionTime() / consumptionIntervall)) { - p.sendMessage(ChatColor.RED - + "You don't have enough fuel, the factory will run out of it before completing"); - } - p.sendMessage(ChatColor.GREEN + "Activated " + name - + " with recipe: " - + currentRecipe.getName()); - activator = p.getUniqueId(); + p.sendMessage(ChatColor.RED + "Not enough materials available to run any recipe"); } - activate(); + return; } else { if (p != null) { - p.sendMessage(ChatColor.RED - + "Failed to activate factory, there is no fuel in the furnace"); + p.sendMessage(ChatColor.GOLD + "Automatically select recipe " + autoSelected.getName()); } + setRecipe(autoSelected); } - } else { - if (p != null) { - p.sendMessage(ChatColor.RED - + "Not enough materials available"); + } + } + //ensure we have fuel + if (!pm.powerAvailable()) { + if (p != null) { + p.sendMessage(ChatColor.RED + "Failed to activate factory, there is no fuel in the furnace"); + } + return; + } + //ensure factory isnt in disrepair + if (rm.inDisrepair() && !(currentRecipe instanceof RepairRecipe)) { + if (p != null) { + p.sendMessage(ChatColor.RED + "This factory is in disrepair, you have to repair it before using it"); + } + return; + } + if (currentRecipe instanceof RepairRecipe && rm.atFullHealth()) { + if (p != null) { + p.sendMessage("This factory is already at full health!"); + } + return; + } + if (!onStartUp && currentRecipe instanceof Upgraderecipe && FactoryMod.getManager().isCitadelEnabled()) { + // only allow permitted members to upgrade the factory + ReinforcementManager rm = Citadel.getReinforcementManager(); + PlayerReinforcement rein = (PlayerReinforcement) rm.getReinforcement(mbs.getCenter()); + if (rein != null) { + if (p == null) { + return; + } + if (!NameAPI.getGroupManager().hasAccess(rein.getGroup().getName(), p.getUniqueId(), + PermissionType.getPermission("UPGRADE_FACTORY"))) { + p.sendMessage(ChatColor.RED + "You dont have permission to upgrade this factory"); + return; } } - } else { - rm.breakIt(); } + FactoryActivateEvent fae = new FactoryActivateEvent(this, p); + Bukkit.getPluginManager().callEvent(fae); + if (fae.isCancelled()) { + return; + } + if (p != null) { + int consumptionIntervall = ((InputRecipe) currentRecipe).getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() : pm.getPowerConsumptionIntervall(); + if (((FurnacePowerManager) pm).getFuelAmountAvailable() < (currentRecipe.getProductionTime() / consumptionIntervall)) { + p.sendMessage(ChatColor.RED + + "You don't have enough fuel, the factory will run out of it before completing"); + } + p.sendMessage(ChatColor.GREEN + "Activated " + name + " with recipe: " + currentRecipe.getName()); + activator = p.getUniqueId(); + } + activate(); } /** @@ -246,7 +270,7 @@ public void setRunCount(IRecipe r, Integer count) { runCount.put(r, count); } } - + public void setRecipeLevel(IRecipe r, Integer level) { if (recipes.contains(r)) { recipeLevel.put(r, level); @@ -286,10 +310,8 @@ public void run() { } // if the time since fuel was last consumed is equal to // how often fuel needs to be consumed - int consumptionIntervall = ((InputRecipe) currentRecipe) - .getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) - .getFuelConsumptionIntervall() : pm - .getPowerConsumptionIntervall(); + int consumptionIntervall = ((InputRecipe) currentRecipe).getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() : pm.getPowerConsumptionIntervall(); if (pm.getPowerCounter() >= consumptionIntervall - 1) { // remove one fuel. pm.consumePower(); @@ -308,33 +330,24 @@ public void run() { } // if there is no fuel Available turn off the factory else { - sendActivatorMessage(ChatColor.GOLD + name - + " deactivated, because it ran out of fuel"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of fuel"); deactivate(); } } // if the production timer has reached the recipes production // time remove input from chest, and add output material - else if (currentProductionTimer >= currentRecipe - .getProductionTime()) { - LoggingUtils.log("Executing recipe " - + currentRecipe.getName() + " for " - + getLogData()); - RecipeExecuteEvent ree = new RecipeExecuteEvent(this, - (InputRecipe) currentRecipe); + else if (currentProductionTimer >= currentRecipe.getProductionTime()) { + LoggingUtils.log("Executing recipe " + currentRecipe.getName() + " for " + getLogData()); + RecipeExecuteEvent ree = new RecipeExecuteEvent(this, (InputRecipe) currentRecipe); Bukkit.getPluginManager().callEvent(ree); if (ree.isCancelled()) { - LoggingUtils.log("Executing recipe " - + currentRecipe.getName() + " for " - + getLogData() + LoggingUtils.log("Executing recipe " + currentRecipe.getName() + " for " + getLogData() + " was cancelled over the event"); deactivate(); return; } - sendActivatorMessage(ChatColor.GOLD - + currentRecipe.getName() + " in " + name - + " completed"); + sendActivatorMessage(ChatColor.GOLD + currentRecipe.getName() + " in " + name + " completed"); if (currentRecipe instanceof Upgraderecipe || currentRecipe instanceof RecipeScalingUpgradeRecipe) { // this if else might look a bit weird, but because // upgrading changes the current recipe and a lot of @@ -344,19 +357,28 @@ else if (currentProductionTimer >= currentRecipe return; } else { currentRecipe.applyEffect(getInventory(), this); - runCount.put(currentRecipe, - runCount.get(currentRecipe) + 1); + runCount.put(currentRecipe, runCount.get(currentRecipe) + 1); } currentProductionTimer = 0; - if (currentRecipe instanceof RepairRecipe - && rm.atFullHealth()) { + if (currentRecipe instanceof RepairRecipe && rm.atFullHealth()) { // already at full health, dont try to repair further - sendActivatorMessage(ChatColor.GOLD + name - + " repaired to full health"); + sendActivatorMessage(ChatColor.GOLD + name + " repaired to full health"); deactivate(); return; } - if (hasInputMaterials() && pm.powerAvailable()) { + if (pm.powerAvailable()) { + //not enough materials, but if auto select is on, we might find another recipe to run + if (!hasInputMaterials() && isAutoSelect()) { + IRecipe nextOne = getAutoSelectRecipe(); + if (nextOne != null) { + sendActivatorMessage(ChatColor.GREEN + name + " automatically switched to recipe " + nextOne.getName() + " and began running it"); + currentRecipe = nextOne; + } + else { + deactivate(); + return; + } + } pm.setPowerCounter(0); scheduleUpdate(); // keep going @@ -365,14 +387,11 @@ else if (currentProductionTimer >= currentRecipe } } } else { - sendActivatorMessage(ChatColor.GOLD - + name - + " deactivated, because it ran out of required materials"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of required materials"); deactivate(); } } else { - sendActivatorMessage(ChatColor.GOLD + name - + " deactivated, because the factory was destroyed"); + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because the factory was destroyed"); deactivate(); } } @@ -418,7 +437,7 @@ public void setRecipe(IRecipe pr) { public int getRunCount(IRecipe r) { return runCount.get(r); } - + public int getRecipeLevel(IRecipe r) { return recipeLevel.get(r); } @@ -431,20 +450,24 @@ private void sendActivatorMessage(String msg) { } } } - + /** * Adds the given recipe to this factory - * @param rec Recipe to add + * + * @param rec + * Recipe to add */ public void addRecipe(IRecipe rec) { recipes.add(rec); runCount.put(rec, 0); recipeLevel.put(rec, 1); } - + /** * Removes the given recipe from this factory - * @param rec Recipe to remove + * + * @param rec + * Recipe to remove */ public void removeRecipe(IRecipe rec) { recipes.remove(rec); @@ -470,12 +493,22 @@ public boolean hasInputMaterials() { return currentRecipe.enoughMaterialAvailable(getInventory()); } + public IRecipe getAutoSelectRecipe() { + for (IRecipe rec : recipes) { + if (rec.enoughMaterialAvailable(getInventory())) { + return rec; + } + } + return null; + } + public static void removePylon(Factory f) { pylonFactories.remove(f); } - public void upgrade(String name, List recipes, ItemStack fuel, - int fuelConsumptionIntervall, int updateTime, int maximumHealth, int damageAmountPerDecayIntervall, long gracePeriod, double citadelBreakReduction) { + public void upgrade(String name, List recipes, ItemStack fuel, int fuelConsumptionIntervall, + int updateTime, int maximumHealth, int damageAmountPerDecayIntervall, long gracePeriod, + double citadelBreakReduction) { LoggingUtils.log("Upgrading " + getLogData() + " to " + name); pylonFactories.remove(this); deactivate(); @@ -483,9 +516,9 @@ public void upgrade(String name, List recipes, ItemStack fuel, this.recipes = recipes; this.updateTime = updateTime; this.citadelBreakReduction = citadelBreakReduction; - this.pm = new FurnacePowerManager(getFurnace(), fuel, - fuelConsumptionIntervall); - this.rm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, damageAmountPerDecayIntervall, gracePeriod); + this.pm = new FurnacePowerManager(getFurnace(), fuel, fuelConsumptionIntervall); + this.rm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, damageAmountPerDecayIntervall, + gracePeriod); if (recipes.size() != 0) { setRecipe(recipes.get(0)); } else { @@ -502,7 +535,7 @@ public void upgrade(String name, List recipes, ItemStack fuel, } } } - + public double getCitadelBreakReduction() { return citadelBreakReduction; } diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java index 21ace7ec..38d0223d 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -213,9 +213,9 @@ public void clicked(Player arg0) { if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) .getCraftingTable())) { // crafting table interaction int rows = (fccf.getRecipes().size() / 9) + 1; - if (fccf.getRecipes().size() > 53 || rows > 6) { + if (fccf.getRecipes().size() > 52 || rows > 6) { p.sendMessage(ChatColor.RED - + "This factory has more than 53 recipes and the GUI for it can't be opened. Either complain to " + + "This factory has more than 52 recipes and the GUI for it can't be opened. Either complain to " + "your admin to have them put less recipes in this factory or complain to /u/maxopoly to add " + "scrollviews to this"); return; @@ -258,6 +258,19 @@ public void clicked(Player p) { recipes.put(c, recipe); ci.addSlot(c); } + ItemStack autoSelectStack = new ItemStack(Material.REDSTONE_BLOCK); + ISUtils.setName(autoSelectStack, "Toggle auto select"); + ISUtils.addLore(autoSelectStack, ChatColor.GOLD + "Auto select will make the factory automatically select any " + + "recipe it can run whenever you activate it.", ChatColor.AQUA + "Click to turn it " + (fccf.isAutoSelect() ? "off" : "on")); + Clickable autoClick = new Clickable(autoSelectStack) { + + @Override + public void clicked(Player arg0) { + arg0.sendMessage(ChatColor.GREEN + "Turned auto select " + (fccf.isAutoSelect() ? "off" : "on") + " for " + fccf.getName()); + fccf.setAutoSelect(!fccf.isAutoSelect()); + } + }; + ci.setSlot(autoClick, (rows * 9) - 2); ItemStack menuStack = new ItemStack(Material.PAINTING); ISUtils.setName(menuStack, "Open menu"); ISUtils.addLore(menuStack, ChatColor.LIGHT_PURPLE diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java index 942418fc..c53619c9 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -86,6 +86,7 @@ public void save(Collection factories) { config.set(current + ".runtime", fccf.getRunningTime()); config.set(current + ".selectedRecipe", fccf .getCurrentRecipe().getName()); + config.set(current + ".autoSelect", fccf.isAutoSelect()); List recipeList = new LinkedList(); for(IRecipe rec : fccf.getRecipes()) { recipeList.add(rec.getIdentifier()); @@ -245,6 +246,7 @@ private void loadFromFile(File f, Map eggs) { long breakTime = current.getLong("breakTime", 0); String selectedRecipe = current.getString("selectedRecipe"); List recipes = current.getStringList("recipes"); + boolean autoSelect = current.getBoolean("autoSelect", false); if (recipes == null) { recipes = new LinkedList(); } @@ -283,6 +285,7 @@ private void loadFromFile(File f, Map eggs) { } } } + fac.setAutoSelect(autoSelect); manager.addFactory(fac); counter++; break; From fb1d2f2c6ed7d384d6f49487fd605c74dcaa0764 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 24 Sep 2016 20:00:50 +0200 Subject: [PATCH 450/459] Increment version1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 560098c9..787b605a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.17 + 2.2.18 FactoryMod https://github.com/Civcraft/FactoryMod From d89e7a926612261a7d497233a2a620a9814c5ff5 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Sat, 24 Sep 2016 20:13:07 +0200 Subject: [PATCH 451/459] Minor fixes to prevent plugin breaking NPEs --- .../factories/FurnCraftChestFactory.java | 4 +++- .../FactoryMod/recipes/ProductionRecipe.java | 21 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java index 2c12be47..00c448f9 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -1,5 +1,6 @@ package com.github.igotyou.FactoryMod.factories; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -65,6 +66,7 @@ public FurnCraftChestFactory(IInteractionManager im, IRepairManager rm, IPowerMa this.active = false; this.runCount = new HashMap(); this.recipeLevel = new HashMap(); + this.recipes = new ArrayList(); this.citadelBreakReduction = citadelBreakReduction; this.autoSelect = false; for (IRecipe rec : recipes) { @@ -155,7 +157,7 @@ public void attemptToActivate(Player p, boolean onStartUp) { return; } else { if (p != null) { - p.sendMessage(ChatColor.GOLD + "Automatically select recipe " + autoSelected.getName()); + p.sendMessage(ChatColor.GOLD + "Automatically selected recipe " + autoSelected.getName()); } setRecipe(autoSelected); } diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 40d0d8f2..64466c8e 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -51,6 +51,9 @@ public ItemMap getAdjustedOutput(int rank, int runs) { } public ItemMap getGuaranteedOutput(int rank, int runs) { + if (modifier == null) { + return output.clone(); + } ItemMap adjusted = new ItemMap(); double factor = modifier.getFactor(rank, runs); for(Entry entry : output.getEntrySet()) { @@ -102,12 +105,18 @@ public List getGuaranteedOutput(Inventory i, FurnCraftChestFactory fc public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { logBeforeRecipeRun(i, fccf); ItemMap toRemove = input.clone(); - ItemMap toAdd = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); - double factor = modifier.getFactor(fccf.getRecipeLevel(this), fccf.getRunCount(this)); - for(Entry entry : output.getEntrySet()) { - double additionalChance = (((double) entry.getValue()) * factor) - toAdd.getAmount(entry.getKey()); - if (rng.nextDouble() <= additionalChance) { - toAdd.addItemAmount(entry.getKey(), 1); + ItemMap toAdd; + if (getModifier() == null) { + toAdd = output.clone(); + } + else { + toAdd = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + double factor = modifier.getFactor(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + for(Entry entry : output.getEntrySet()) { + double additionalChance = (((double) entry.getValue()) * factor) - toAdd.getAmount(entry.getKey()); + if (rng.nextDouble() <= additionalChance) { + toAdd.addItemAmount(entry.getKey(), 1); + } } } if (toRemove.isContainedIn(i)) { From 4267080340e11c8f2b0abc2cfed33ac1c0e0b1ed Mon Sep 17 00:00:00 2001 From: FreyaFreed Date: Tue, 27 Sep 2016 17:44:03 +0200 Subject: [PATCH 452/459] Endgame EXP and pylon rebalancing (#291) * Pylon balancing Increase pylon runtime to a week * Ruby Enrichment balances Our town runs this recipe and we have a lot of data. The fish requirement is out of whack with the pufferfish in the Topaz recipe. Pufferfish are about half the chance of being caught of salmon. So it seems fair that salmon amounts are doubled, not quadroupled. Sapplings require really huge farms to get large amounts. It seems fair to halve sappling amounts on all recipes. For the rest this recipe seems fine. Vines cost iron to farm but this can be mitigated by unbreaking shears. * Topaz Rebalance I don't have as much data on this recipe. But eggs take a long time to get. Halving it seems fair. Since I halved the sapplings on all other recipes I did it here as well. But maybe 16 sapplings is too low? I don't really know how many saplings dark oak trees drop in comparison. * Amethys Balances This recipe is worthless IMO. No one is going to take this path. It requires 3 types of tree farms acacia, dark oak/oak for apples and jungle. On top of that it takes ink. I've reduced the amounts of hard to get items like apples and ink. But I don't think it's enough to make this viable. Either oak or ink needs to be changed to an easier to farm ingredient. Ink is already needed for bastions as well, so I suggest that part be changed. * Pylon rebalance Changed to run for 2 days without supervision. * Grandmaster recipes This should bring all the recipes more in line with eachother. The fish are based of the %chance to catch them, and each should take about the same amount of effort. Clownfish 3, salmon 5 and fish 15. * Changed clownfish to pufferfish in config --- src/main/resources/configCivcraft.yml | 37 +++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 3eb72560..57b5d375 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -5652,7 +5652,7 @@ recipes: name: Extract Aether type: PYLON production_time: 4h - fuel_consumption_intervall: 6m + fuel_consumption_intervall: 24m input: output: aether: @@ -5667,7 +5667,7 @@ recipes: Pylon_Advanced: name: Extract Aether type: PYLON - fuel_consumption_intervall: 6m + fuel_consumption_intervall: 24m production_time: 2h input: output: @@ -5683,7 +5683,7 @@ recipes: Pylon_Expert: name: Extract Aether type: PYLON - fuel_consumption_intervall: 6m + fuel_consumption_intervall: 24m production_time: 2h input: output: @@ -7140,7 +7140,7 @@ recipes: - Compacted Item junglesaplings: material: SAPLING - amount: 2 + amount: 1 durability: 3 lore: - Compacted Item @@ -7157,12 +7157,15 @@ recipes: # chicken: # material: RAW_CHICKEN # amount: 160 - inksacs: - material: INK_SACK - amount: 64 - apples: - material: APPLE - amount: 32 + vines: + material: VINE + amount: 6 + lore: + - Compacted Item + fish: + material: RAW_FISH + amount: 15 + durability: 1 aether: material: GOLD_NUGGET amount: 120 @@ -7194,7 +7197,7 @@ recipes: - Compacted Item darkoaksaplings: material: SAPLING - amount: 32 + amount: 16 durability: 5 cactus: material: CACTUS @@ -7210,13 +7213,13 @@ recipes: # beef: # material: RAW_BEEF # amount: 160 - clownfish: + pufferfish: material: RAW_FISH amount: 3 durability: 3 - eggs: - material: EGG - amount: 8 + vines: + material: VINE + amount: 6 lore: - Compacted Item aether: @@ -7250,7 +7253,7 @@ recipes: - Compacted Item oaksaplings: material: SAPLING - amount: 2 + amount: 1 durability: 0 lore: - Compacted Item @@ -7269,7 +7272,7 @@ recipes: # amount: 160 salmon: material: RAW_FISH - amount: 19 + amount: 5 durability: 1 vines: material: VINE From 51143bebd9a1e8e38cc4135d398c1050eeff3243 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Tue, 27 Sep 2016 21:32:55 +0200 Subject: [PATCH 453/459] Synchronize access to factory hashset to avoid concurrentmodification exceptions between factorygarbagecollector and save runnable --- pom.xml | 2 +- .../com/github/igotyou/FactoryMod/FactoryModManager.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 787b605a..f1dda310 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.18 + 2.2.19 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java index 4b57332f..38968421 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -506,7 +506,7 @@ public void addFactoryUpgradeEgg(IFactoryEgg egg) { public void saveFactories() { plugin.info("Attempting to save factory data"); - fileHandler.save(factories); + fileHandler.save(getAllFactories()); } public void loadFactories() { @@ -594,7 +594,9 @@ public int getRedstoneRecipeChange() { * @return All existing factory instances */ public HashSet getAllFactories() { - return factories; + synchronized (factories) { + return new HashSet(factories); + } } /** From 1bcc0fbffaf8ffd4860bea03bec6c426e3767dd9 Mon Sep 17 00:00:00 2001 From: waffle-stomper Date: Thu, 29 Sep 2016 01:48:33 +1000 Subject: [PATCH 454/459] Add simplified printing press (#290) --- src/main/resources/configCivcraft.yml | 49 ++++++++++++++++++++------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 57b5d375..5806428a 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -49,6 +49,7 @@ factories: - Upgrade_to_Wood_Processor_2 - Upgrade_to_Basic_Forge - Upgrade_to_Basic_Fortification + - Upgrade_to_Printing_Press #Reinforcement factories #Basic Contraption --> Basic Fortification @@ -680,7 +681,6 @@ factories: - Repair_Rudimentary_Factory - Upgrade_to_Bastion_Factory - Upgrade_to_Compactor_Basic - - Upgrade_to_Printing_Press - Upgrade_to_Basic_Pylon - Upgrade_to_Redstone_Factory_Basic bastionfactory: @@ -695,6 +695,8 @@ factories: name: Printing Press citadelBreakReduction: 0.1 recipes: + - Bind_Books + - Bind_Writable_Books - Repair_Factory compactorbasic: type: FCCUPGRADE @@ -1543,6 +1545,39 @@ recipes: pumpkin pie: material: PUMPKIN_PIE amount: 192 + Bind_Books: + type: PRODUCTION + name: Bind Books + production_time: 10s + input: + leather: + material: LEATHER + amount: 6 + paper: + material: PAPER + amount: 18 + output: + books: + material: BOOK + amount: 12 + Bind_Writable_Books: + type: PRODUCTION + name: Bind Writable Books + production_time: 30s + input: + ink: + material: INK_SACK + amount: 6 + feather: + material: FEATHER + amount: 6 + book: + material: BOOK + amount: 6 + output: + books: + material: BOOK_AND_QUILL + amount: 18 Burn_Charcoal_from_Coal: type: PRODUCTION name: Burn Charcoal from Coal @@ -3953,18 +3988,6 @@ recipes: material: DOUBLE_PLANT amount: 32 durability: 2 - Random_Printing_Press_Recipe: - type: PRODUCTION - name: Random Printing Press Recipe - production_time: 5s - input: - identifiername: - material: STONE - amount: 1 - output: - identifiername: - material: STONE - amount: 1 Smelt_Clay_Bricks: type: PRODUCTION name: Smelt Clay Bricks From ef1a70ada81cc8887a388cdc17eb7fb910863c9d Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 28 Sep 2016 18:22:31 +0200 Subject: [PATCH 455/459] Allow cross path upgrade for third tier rein components --- src/main/resources/configCivcraft.yml | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 5806428a..d9984c18 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -11585,6 +11585,32 @@ recipes: lore: - Strong Reinforcement Ingredient amount: 1 + + Produce_strong_Hunter_Component2: + type: PRODUCTION + production_time: 4s + name: Produce strong Hunter Component + input: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + amount: 2 + ghastTear: + material: GHAST_TEAR + amount: 6 + witherskull: + material: SKULL_ITEM + durability: 1 + amount: 2 + output: + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 1 Produce_strong_Miner_Component: type: PRODUCTION @@ -11611,6 +11637,32 @@ recipes: lore: - Strong Reinforcement Ingredient amount: 1 + + Produce_strong_Miner_Component2: + type: PRODUCTION + production_time: 4s + name: Produce strong Miner Component + input: + decentMiner: + material: QUARTZ + name: Miner Component + lore: + - Decent Reinforcement Ingredient + amount: 8 + diamond: + material: DIAMOND + amount: 4 + lapis: + material: INK_SACK + durability: 4 + amount: 8 + output: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 1 Produce_good_reinforcement: type: PRODUCTION From da89ff326085ed78737c691b192c1f96b2602539 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 28 Sep 2016 18:24:04 +0200 Subject: [PATCH 456/459] Half repair cost --- src/main/resources/configCivcraft.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index 5806428a..19a0b88f 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -1377,7 +1377,7 @@ recipes: enchants: dura: enchant: DURABILITY - amount: 35 + amount: 17 health_gained: 3334 # lvl 2 Repair_Basic_Factory: @@ -1392,7 +1392,7 @@ recipes: enchants: dura: enchant: DURABILITY - amount: 53 + amount: 26 health_gained: 3334 # lvl 3 Repair_Factory: @@ -1407,7 +1407,7 @@ recipes: enchants: dura: enchant: DURABILITY - amount: 70 + amount: 35 health_gained: 3334 # lvl 4 Repair_Advanced_Factory: @@ -1422,7 +1422,7 @@ recipes: enchants: dura: enchant: DURABILITY - amount: 140 + amount: 70 health_gained: 3334 # lvl 5 Repair_Expert_Factory: @@ -1437,7 +1437,7 @@ recipes: enchants: dura: enchant: DURABILITY - amount: 210 + amount: 105 health_gained: 3334 Bake_Bread_Advanced: type: PRODUCTION From 8fa612e649b435f5417827fd9b6875cc1c81f2a1 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Wed, 28 Sep 2016 18:27:06 +0200 Subject: [PATCH 457/459] Actually add recipes! --- src/main/resources/configCivcraft.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml index d9984c18..b94f6255 100644 --- a/src/main/resources/configCivcraft.yml +++ b/src/main/resources/configCivcraft.yml @@ -95,6 +95,8 @@ factories: - Produce_decent_reinforcement - Produce_strong_Hunter_Component - Produce_strong_Miner_Component + - Produce_strong_Hunter_Component2 + - Produce_strong_Miner_Component2 - Produce_good_reinforcement - Produce_Bracers - Upgrade_to_Advanced_Fortification @@ -121,6 +123,8 @@ factories: - Produce_decent_reinforcement - Produce_strong_Hunter_Component - Produce_strong_Miner_Component + - Produce_strong_Hunter_Component2 + - Produce_strong_Miner_Component2 - Produce_good_reinforcement - Produce_Bracers - Produce_best_reinforcement From 81d79226d73b6484c9564eafd15d225aea744ec3 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 10 Oct 2016 20:23:06 +0200 Subject: [PATCH 458/459] Ensure null fccf in output representation method for prod recipe is caught --- pom.xml | 2 +- .../github/igotyou/FactoryMod/recipes/ProductionRecipe.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f1dda310..af3fae36 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.igotyou FactoryMod jar - 2.2.19 + 2.2.20 FactoryMod https://github.com/Civcraft/FactoryMod diff --git a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java index 64466c8e..cf0b4710 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -67,11 +67,11 @@ public int getCurrentMultiplier(Inventory i) { } public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { - ItemMap currentOut = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); - List stacks = currentOut.getItemStackRepresentation(); if (i == null || fccf == null) { - return stacks; + return output.getItemStackRepresentation(); } + ItemMap currentOut = getGuaranteedOutput(fccf.getRecipeLevel(this), fccf.getRunCount(this)); + List stacks = currentOut.getItemStackRepresentation(); double factor = modifier.getFactor(fccf.getRecipeLevel(this), fccf.getRunCount(this)); for(Entry entry : output.getEntrySet()) { double additionalChance = (((double) entry.getValue()) * factor) - currentOut.getAmount(entry.getKey()); From 252cef24892ed18755ef4f0ceb5132816e5998df Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Mon, 10 Oct 2016 23:31:37 +0200 Subject: [PATCH 459/459] Make pipe length configurable --- .../com/github/igotyou/FactoryMod/ConfigParser.java | 3 ++- .../github/igotyou/FactoryMod/FactoryModManager.java | 7 +++++++ .../com/github/igotyou/FactoryMod/eggs/PipeEgg.java | 10 ++++++++-- .../igotyou/FactoryMod/structures/PipeStructure.java | 3 +-- src/main/resources/config.yml | 4 ++++ 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java index ea46922d..476c9a20 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java +++ b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java @@ -414,8 +414,9 @@ public PipeEgg parsePipe(ConfigurationSection config) { .getString("transfer_time_multiplier")); int transferAmount = config.getInt("transfer_amount"); byte color = (byte) config.getInt("glass_color"); + int maxLength = config.getInt("maximum_length"); return new PipeEgg(name, update, fuel, fuelIntervall, null, - transferTimeMultiplier, transferAmount, color, returnRate); + transferTimeMultiplier, transferAmount, color, returnRate, maxLength); } public IFactoryEgg parseFCCFactory(ConfigurationSection config) { diff --git a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java index 38968421..a77bfa89 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -250,6 +250,8 @@ public boolean factoryExistsAt(Location loc) { * Player attempting to create the factory */ public void attemptCreation(Block b, Player p) { + //this method should probably be taken apart and the individual logic should be exported in + //a class that fits each factory type if (!factoryExistsAt(b.getLocation())) { // Cycle through possible structures here if (b.getType() == Material.WORKBENCH) { @@ -325,6 +327,11 @@ public void attemptCreation(Block b, Player p) { + "You dont have the right color of glass for this pipe"); return; } + if (ps.getLength() > ((PipeEgg) egg).getMaximumLength()) { + p.sendMessage(ChatColor.RED + + "You cant make pipes of this type, which are that long"); + return; + } Factory f = egg.hatch(ps, p); if (f != null) { ((Dispenser) (ps.getStart().getState())) diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java index 43e6638d..d9fb8487 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -27,11 +27,12 @@ public class PipeEgg implements IFactoryEgg { private int transferTimeMultiplier; private int transferAmount; private byte color; - double returnRate; + private double returnRate; + private int maximumLength; public PipeEgg(String name, int updateTime, ItemStack fuel, int fuelConsumptionIntervall, List allowedMaterials, - int transferTimeMultiplier, int transferAmount, byte color, double returnRate) { + int transferTimeMultiplier, int transferAmount, byte color, double returnRate, int maximumLength) { this.name = name; this.fuel = fuel; this.updateTime = updateTime; @@ -41,6 +42,7 @@ public PipeEgg(String name, int updateTime, ItemStack fuel, this.allowedMaterials = allowedMaterials; this.color = color; this.returnRate = returnRate; + this.maximumLength = maximumLength; } public String getName() { @@ -78,6 +80,10 @@ public int getTransferTimeMultiplier() { public byte getColor() { return color; } + + public int getMaximumLength() { + return maximumLength; + } public Factory hatch(MultiBlockStructure mbs, Player p) { IInteractionManager im = new PipeInteractionManager(); diff --git a/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java index cef89f77..bb3c9f63 100644 --- a/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -21,7 +21,6 @@ public class PipeStructure extends MultiBlockStructure { private List glassPipe; private byte glassColor; private static Material pipeMaterial = Material.STAINED_GLASS; - private static int maximumLength = 128; private boolean complete; public PipeStructure(Block startBlock) { @@ -47,7 +46,7 @@ public PipeStructure(Block startBlock) { glassColor = currentBlock.getData(); glassPipe.add(currentBlock.getLocation()); int length = 1; - while (length <= maximumLength) { + while (length <= 512) { List blocks = MultiBlockStructure .getAdjacentBlocks(currentBlock); boolean foundEnd = false; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c8b1165d..9e303809 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -330,6 +330,7 @@ saving_intervall: 15m # transfer_time_multiplier: 1s # transferamount: 16 # glass_color: 1 +# maximum_length: 32 #type for all pipes must be PIPE and name a unique identifer, standard stuff @@ -352,6 +353,9 @@ saving_intervall: 15m #glass_color is the durability value of the glass this pipe is supposed to have. For a full list see: #http://minecraft.gamepedia.com/Stained_Glass#Block_data +#maximum_length defines how long this type of pipe may be at maximum. Length only counts the glass part here and this value +#may not be bigger than 512. Be aware that allowing many very long pipes might cause performance problems + #3. Sorter