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/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 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/enchantments.csv b/Config Scripts/enchantments.csv deleted file mode 100644 index 13c5bb14..00000000 --- a/Config Scripts/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/Config Scripts/materials.csv b/Config Scripts/materials.csv deleted file mode 100644 index cc8adc5d..00000000 --- a/Config Scripts/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/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/FactoryMod_NetherBackend_9.3.14.jar b/FactoryMod_NetherBackend_9.3.14.jar deleted file mode 100644 index eef58607..00000000 Binary files a/FactoryMod_NetherBackend_9.3.14.jar and /dev/null differ diff --git a/config.yml b/config.yml deleted file mode 100644 index 1ba37ca3..00000000 --- a/config.yml +++ /dev/null @@ -1,7545 +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) -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: false - 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: - 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 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 -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: 26 - repair_inputs: - Baked Potato: - material: BAKED_POTATO - amount: 2 - Cookie: - material: COOKIE - amount: 4 - Bread: - material: BREAD - 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: 600 - durability: 1 - recipes: - - Smelt_Oak_Wood - - Smelt_Spruce_Wood - - Smelt_Birch_Wood - - Smelt_Jungle_Wood - - Burn_Acacia_Wood - - Burn_Dark_Oak_Wood - - Smelt_Coal - repair_multiple: 60 - repair_inputs: - Charcoal: - material: COAL - durability: 1 - 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 - Diamond_Cauldron: - name: Diamond Cauldron - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Diamond: - material: DIAMOND - amount: 50 - recipes: - - Diamond_XP_Bottle_0 - - Diamond_XP_Bottle_1 - - Diamond_XP_Bottle_2 - - Diamond_XP_Bottle_3 - repair_multiple: 5 - repair_inputs: - Diamond: - material: DIAMOND - 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 - 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_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 - 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 - - 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: 200 - 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 - 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 - repair_multiple: 10 - repair_inputs: - Paper: - material: PAPER - amount: 4 - Chest: - material: CHEST - amount: 1 - Leather: - material: LEATHER - amount: 1 - Fancy_Ore_Smelter: - name: Fancy Ore Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Lapis Lazuli: - material: INK_SACK - amount: 1536 - durability: 4 - Redstone: - material: REDSTONE - amount: 1152 - Netherquartz: - material: QUARTZ - amount: 576 - recipes: - - Smelt_Lapis_Lazuli_Ore - - Smelt_Redstone_Ore - - Smelt_Netherquartz_Ore - - Bastion_Walls - repair_multiple: 26 - repair_inputs: - Lapis Lazuli: - material: INK_SACK - amount: 6 - durability: 4 - Redstone: - material: REDSTONE - amount: 5 - Netherquartz: - material: QUARTZ - amount: 2 - Smelter: - name: Ore Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Coal: - material: COAL - amount: 512 - Iron Ingot: - material: IRON_INGOT - amount: 384 - Gold Ingot: - material: GOLD_INGOT - amount: 192 - Diamond: - material: DIAMOND - amount: 96 - recipes: - - Smelt_Coal_Ore - - Smelt_Iron_Ore - - Smelt_Gold_Ore - - Smelt_Diamond_Ore - - Bastion_Base - repair_multiple: 10 - repair_inputs: - Coal: - material: COAL - amount: 6 - Iron Ingot: - material: IRON_INGOT - amount: 4 - Gold Ingot: - material: GOLD_INGOT - amount: 2 - Diamond: - material: DIAMOND - Stone_Brick_Smelter: - name: Fancy Stone Brick Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 512 - Lapis Lazuli: - material: INK_SACK - amount: 256 - durability: 4 - recipes: - - Smelt_Cracked_Stone_Brick - - Smelt_Mossy_Stone_Brick - - Smelt_Chiseled_Stone_Brick - - Bastion_Flooring - repair_multiple: 26 - repair_inputs: - Stone Brick: - material: SMOOTH_BRICK - amount: 2 - Lapis Lazuli: - material: INK_SACK - durability: 4 - Stone_Smelter: - name: Stone Smelter - fuel: - Charcoal: - material: COAL - durability: 1 - inputs: - Stone: - material: STONE - amount: 2048 - recipes: - - Smelt_Stone - repair_multiple: 205 - repair_inputs: - Stone: - material: STONE - 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_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_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_Bottle_0 - - Wood_XP_Bottle_1 - - Wood_XP_Bottle_2 - - Wood_XP_Bottle_3 - - Wood_XP_Bottle_4 - - Wood_XP_Bottle_5 - 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 -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: - 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 - inputs: - Potato: - material: POTATO_ITEM - amount: 192 - outputs: - 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: 1280 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 5 - 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: 1 - inputs: - Diamond Ore: - material: DIAMOND_ORE - amount: 16 - outputs: - Diamond: - material: DIAMOND - amount: 48 - Diamond_XP_Bottle_0: - name: Brew XP Bottles - 1 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 128 - Carrot: - material: CARROT_ITEM - amount: 96 - 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: 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 - 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_1: - name: Brew XP Bottles - 2 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 14 - Carrot: - material: CARROT_ITEM - amount: 256 - Nether Wart: - material: NETHER_STALK - amount: 256 - Baked Potato: - material: BAKED_POTATO - amount: 256 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 14 - 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 - 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: - 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 - 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: 128 - 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 - 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 - 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: 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 - Wheat: - material: WHEAT - amount: 128 - Cocoa: - material: INK_SACK - amount: 16 - durability: 3 - 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 - durability: 1 - Cooked Fish: - material: COOKED_FISH - amount: 16 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 - Diamond_XP_Bottle_3: - name: Brew XP Bottles - 4 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 128 - Nether Wart: - material: NETHER_STALK - amount: 64 - Pumpkin: - material: PUMPKIN - amount: 128 - Sugar Cane: - material: SUGAR_CANE - amount: 128 - 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 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 128 - 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_ITEM - amount: 1024 - 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 Bricks - production_time: 32 - inputs: - Clay: - material: CLAY_BALL - amount: 512 - outputs: - Bricks: - material: CLAY_BRICK - amount: 1024 - Bake_pots: - name: Bake Flowerpots - production_time: 5 - inputs: - Clay: - material: CLAY_BALL - amount: 64 - outputs: - Flower Pots: - material: FLOWER_POT_ITEM - amount: 64 - 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_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: 6 - inputs: - Lapis Ore: - material: LAPIS_ORE - amount: 32 - outputs: - Lapis Lazuli: - material: INK_SACK - amount: 512 - durability: 4 - Smelt_Redstone_Ore: - name: Smelt Redstone Ore - production_time: 16 - inputs: - Redstone Ore: - material: REDSTONE_ORE - amount: 128 - outputs: - Redstone: - material: REDSTONE - amount: 1024 - Smelt_Netherquartz_Ore: - name: Smelt Netherquartz ore - production_time: 6 - inputs: - Netherquartz ore: - material: QUARTZ_ORE - amount: 64 - outputs: - Quartz: - material: QUARTZ - amount: 192 - 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 Torches: - 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 - Smelt_Gold_Ore: - name: Smelt Gold Ore - production_time: 3 - inputs: - Gold Ore: - material: GOLD_ORE - amount: 32 - outputs: - Gold Ingot: - material: GOLD_INGOT - amount: 224 - 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_0: - name: Brew XP Bottles - 1 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 24 - Carrot: - material: CARROT_ITEM - amount: 256 - Cactus: - material: CACTUS - amount: 256 - Bread: - material: BREAD - amount: 256 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 24 - Iron_XP_Bottle_3: - name: Brew XP Bottles - 4 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 42 - Nether Wart: - material: NETHER_STALK - 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 - amount: 64 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 42 - Iron_XP_Bottle_2: - name: Brew XP Bottles - 3 - inputs: - Glass Bottle: - material: GLASS_BOTTLE - amount: 42 - 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: 64 - Cooked Beef: - material: COOKED_BEEF - amount: 32 - outputs: - Exp Bottle: - material: EXP_BOTTLE - amount: 42 - 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 - 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: - 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 - 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: 224 - 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 - 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 - 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 Fences - production_time: 16 - inputs: - Chest: - material: CHEST - amount: 12 - outputs: - 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: 54 - outputs: - Iron Door: - material: IRON_DOOR - amount: 18 - 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: 64 - 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: 64 - 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: 64 - 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: 64 - 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: 64 - 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 - 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 Ball: - material: CLAY_BALL - amount: 32 - 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_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 - 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 - 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: 265 - Ender Pearl: - material: ENDER_PEARL - amount: 265 - outputs: - Eye of Ender: - material: EYE_OF_ENDER - amount: 256 diff --git a/license.txt b/license.txt index 3bc088a6..e83d6ca5 100644 --- a/license.txt +++ b/license.txt @@ -1,27 +1,27 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - (1) Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - (2) Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - (3)The name of the author may not be used to - endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3)The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/plugin.yml b/plugin.yml deleted file mode 100644 index ac5e00d4..00000000 --- a/plugin.yml +++ /dev/null @@ -1,4 +0,0 @@ -name: FactoryMod -main: com.github.igotyou.FactoryMod.FactoryModPlugin -author: igotyou -version: 1.2 diff --git a/pom.xml b/pom.xml index b35753c9..af3fae36 100644 --- a/pom.xml +++ b/pom.xml @@ -1,53 +1,76 @@ - - 4.0.0 - com.github.igotyou - FactoryMod - jar - 1.0-SNAPSHOT - FactoryMod - https://github.com/ttk2/FactoryMod - - - 1.7 - 1.7 - - - - ${basedir}/src - - - - ${basedir} - - *.yml - license.txt - - - - + 4.0.0 + com.github.igotyou + FactoryMod + jar + 2.2.20 + FactoryMod + https://github.com/Civcraft/FactoryMod - - - org.bukkit - bukkit - 1.7.2-R0.3 - provided - - - com.untamedears - Citadel - [2.5,) - provided - - - - - - bukkit-repo - http://repo.bukkit.org/content/groups/public/ - - + + UTF-8 + 1.8 + 1.8 + + + + + + ${basedir} + + LICENSE.txt + + + + src/main/resources + true + + + + + + + org.spigotmc + spigot-api + 1.10-R0.1-SNAPSHOT + provided + + + vg.civcraft.mc.namelayer + NameLayer + 2.7 + provided + + + vg.civcraft.mc.citadel + Citadel + 3.5.0 + provided + + + vg.civcraft.mc.civmodcore + CivModCore + 1.4.47 + provided + + + vg.civcraft.mc + CivMenu + 1.3 + provided + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + Jenkins-repo + http://build.civcraft.co:8080/plugin/repository/everything/ + + diff --git a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java b/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java deleted file mode 100644 index b43331f3..00000000 --- a/src/com/github/igotyou/FactoryMod/FactoryModPlugin.java +++ /dev/null @@ -1,465 +0,0 @@ -package com.github.igotyou.FactoryMod; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -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.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 com.github.igotyou.FactoryMod.FactoryObject.FactoryType; -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.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.utility.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; - -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; - - -public class FactoryModPlugin extends JavaPlugin -{ - - FactoryModManager manager; - public static HashMap productionProperties; - public static HashMap productionRecipes; - public PrintingPressProperties printingPressProperties; - public NetherFactoryProperties netherFactoryProperties; - - 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 int PRODUCER_UPDATE_CYCLE; - public static boolean PRODUCTION_ENEABLED; - public static int SAVE_CYCLE; - public static Material CENTRAL_BLOCK_MATERIAL; - public static boolean RETURN_BUILD_MATERIALS; - public static boolean CITADEL_ENABLED; - public static Material FACTORY_INTERACTION_MATERIAL; - 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; - public static boolean DISABLE_EXPERIENCE; - public static long DISREPAIR_PERIOD; - public static long REPAIR_PERIOD; - public static boolean REDSTONE_START_ENABLED; - public static boolean LEVER_OUTPUT_ENABLED; - - public void onEnable() - { - //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, manager.getProductionManager()), this); - getServer().getPluginManager().registerEvents(new NoteStackListener(this), this); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - public void initConfig() - { - productionProperties = new HashMap(); - productionRecipes = new HashMap(); - FileConfiguration config = getConfig(); - if(getConfig().getDefaults().getBoolean("copy_defaults", true)) - { - saveResource("config.yml",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()) - { - ItemStack recipeItemStack = new ItemStack(Material.getMaterial(disabledRecipes.next())); - List tempList = getServer().getRecipesFor(recipeItemStack); - for (int itterator = 0; itterator < tempList.size(); itterator ++) - { - removeRecipe(tempList.get(itterator)); - g++; - } - - } - //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 - HashMap outputRecipes=new HashMap(); - Iterator recipeTitles=configProdRecipes.getKeys(false).iterator(); - while (recipeTitles.hasNext()) - { - //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(" ","_"); - //Display name of the recipe, Deafult of "Default Name" - String recipeName = configSection.getString("name","Default Name"); - //Production time of the recipe, default of 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 - ArrayList currentOutputRecipes=new ArrayList(); - currentOutputRecipes.addAll(configSection.getStringList("output_recipes")); - outputRecipes.put(recipe,currentOutputRecipes); - } - //Once ProductionRecipe objects have been created correctly insert different pointers - Iterator recipeIterator=outputRecipes.keySet().iterator(); - while (recipeIterator.hasNext()) - { - ProductionRecipe recipe=recipeIterator.next(); - Iterator outputIterator=outputRecipes.get(recipe).iterator(); - while(outputIterator.hasNext()) - { - recipe.addOutputRecipe(productionRecipes.get(outputIterator.next())); - } - } - - - //Import factories from config.yml - ConfigurationSection configProdFactories=config.getConfigurationSection("production_factories"); - Iterator factoryTitles=configProdFactories.getKeys(false).iterator(); - while(factoryTitles.hasNext()) - { - String title=factoryTitles.next(); - 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(new NamedItemStack(Material.getMaterial("COAL"),1,(short)1,"Charcoal")); - } - 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()) - { - factoryRecipes.add(productionRecipes.get(ouputRecipeIterator.next())); - } - 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); - } - - private List getEnchantments(ConfigurationSection configEnchantments) - { - List enchantments=new ArrayList(); - if(configEnchantments!=null) - { - Iterator names=configEnchantments.getKeys(false).iterator(); - while (names.hasNext()) - { - String name=names.next(); - 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 = new ArrayList(); - if(configurationSection!=null) - { - Iterator names=configurationSection.getKeys(false).iterator(); - while (names.hasNext()) - { - String name=names.next(); - 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 = new ArrayList(); - 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()) - { - Recipe recipe = itterator.next(); - if (recipe.getResult().getType() == removalRecipe.getResult().getType()) - { - itterator.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 PrintingPressProperties getPrintingPressProperties() { - return printingPressProperties; - } - - public NetherFactoryProperties getNetherFactoryProperties() { - return netherFactoryProperties; - } -} diff --git a/src/com/github/igotyou/FactoryMod/FactoryObject.java b/src/com/github/igotyou/FactoryMod/FactoryObject.java deleted file mode 100644 index 30b72d21..00000000 --- a/src/com/github/igotyou/FactoryMod/FactoryObject.java +++ /dev/null @@ -1,213 +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.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; - } -} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java deleted file mode 100644 index 1f651a3f..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/BaseFactory.java +++ /dev/null @@ -1,515 +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.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.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; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; - -public abstract class BaseFactory extends FactoryObject implements Factory { - 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 - - public BaseFactory(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 BaseFactory(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 BaseFactory(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 BaseFactory(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()); - } - } - - /** - * 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 checkHasMaterials() { - return getAllInputs().allIn(getInventory()); - } - - /** - * Turns the factory on - */ - 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.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 - 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(); - needAll.addAll(getAllInputs().getDifference(getInventory())); - if(!needAll.isEmpty()) - { - response.add(new InteractionResponse(InteractionResult.FAILURE,"You need all of the following: "+needAll.toString()+".")); - } - 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 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 - getInputs().removeFrom(getInventory()); - } - - public void produceOutputs() { - //Adds outputs to chest with appropriate enchantments - getOutputs().putIn(getInventory(),getEnchantments()); - } - - 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 - } - - protected void fuelConsumed() { - // Hook for subtypes - } - - public List getEnchantments() { - return new ArrayList(); - } - - 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 - */ - 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() - { - return getFuel().allIn(getPowerSourceInventory()); - } - - /** - * Called by the block listener when the player(or a entity) destroys the fatory - * Drops the build materials if the config says it shouls - */ - public void destroy(Location destroyLocation) - { - 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/NetherFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java deleted file mode 100644 index 9980f0f4..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/NetherFactory.java +++ /dev/null @@ -1,605 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import static com.untamedears.citadel.Utility.getReinforcement; -import static com.untamedears.citadel.Utility.isReinforced; - -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -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.NamedItemStack; -import com.untamedears.citadel.entity.PlayerReinforcement; - -import java.util.ArrayList; -import java.util.List; - -public class NetherFactory extends BaseFactory -{ - - private NetherFactoryProperties netherFactoryProperties;//the properties of the production factory - private Location netherTeleportPlatform; - private Location overworldTeleportPlatform; - private NetherOperationMode mode; - private NetherFactoryManager netherManager; - public NetherOperationMode getMode() { - return mode; - } - - /** - * Constructor called when creating portal - */ - public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, - NetherFactoryProperties netherFactoryProperties, NetherFactoryManager netherManager) - { - 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; - } - - /** - * Constructor - */ - public NetherFactory (Location factoryLocation, Location factoryInventoryLocation, Location factoryPowerSource, Location nTeleportPlatform, Location oTeleportPlatform, - boolean active, double currentMaintenance, - long timeDisrepair, NetherOperationMode mode, NetherFactoryProperties netherFactoryProperties, - NetherFactoryManager netherManager) - { - 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 - 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(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 && !isReinforced(factoryLocation))) || - (((PlayerReinforcement) getReinforcement(factoryLocation)).isAccessible(player))) - { - if (mode == NetherOperationMode.TELEPORT) - { - if (active) - { - 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); - player.teleport(destination); - 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 (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 turned off!")); - } - } - else - { - responses.add(new InteractionResponse(InteractionResult.FAILURE, "Can't teleport, factory is not in teleport mode.")); - } - return responses; - } - else - { - //is the player potentialy 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 (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 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(netherManager.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(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()==FactoryModPlugin.CENTRAL_BLOCK_MATERIAL) - { - 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); - } - } -} diff --git a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java b/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java deleted file mode 100644 index fb0a4bce..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/PrintingPress.java +++ /dev/null @@ -1,678 +0,0 @@ -package com.github.igotyou.FactoryMod.Factorys; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -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.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.ItemList; -import com.github.igotyou.FactoryMod.utility.NamedItemStack; -import com.github.igotyou.FactoryMod.utility.InteractionResponse.InteractionResult; -import com.github.igotyou.FactoryMod.utility.PrettyLore; - -public class PrintingPress extends BaseFactory { - - private PrintingPressProperties 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.containedPaper = 0; - this.containedBindings = 0; - this.containedSecurityMaterials = 0; - 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: - NamedItemStack plates = getPlateResult(); - int pageCount = 1; - if (plates != null) { - pageCount = Math.max(1, ((BookMeta) plates.getItemMeta()).getPageCount()); - } - 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: - NamedItemStack plates = getPlateResult(); - if (plates != null) { - int pageCount = ((BookMeta) plates.getItemMeta()).getPageCount(); - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - inputs.addAll(printingPressProperties.getPlateMaterials().getMultiple(pageCount)); - } - break; - } - return inputs; - } - - @Override - public ItemList getOutputs() { - ItemList outputs = new ItemList(); - switch(mode) { - case SET_PLATES: - NamedItemStack plates = getPlateResult(); - if (plates != null) { - outputs.add(plates); - } - break; - } - return outputs; - } - - @Override - public ItemList getRepairs() { - ItemList inputs = new ItemList(); - switch(mode) { - case REPAIR: - inputs.addAll(printingPressProperties.getRepairMaterials()); - 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; - } - } - - public void printBooksUpdate() { - // Output finished results - int finished = processQueue[processQueueOffset]; - if (finished > 0) { - NamedItemStack result = getPrintResult().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 = getPrintResult().pageCount(); - pageCount = Math.min(pageCount, printingPressProperties.getBookPagesCap()); - - if (hasPages) { - // Check bindings - int expectedBindings = (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 = 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) { - NamedItemStack 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) { - NamedItemStack 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; - } - - 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())); - //[Inputs: amount Name, amount Name.] - if(!getInputs().isEmpty()) - { - responses.add(new InteractionResponse(InteractionResult.SUCCESS,"Input: "+getInputs().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(!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; - } - - private PrintResult getPrintResult() { - return new PrintResult(); - } - - private NamedItemStack getPlateResult() { - for (ItemStack stack : getInventory().getContents()) { - if (stack == null) { - continue; - } - if (stack.getType().equals(Material.BOOK_AND_QUILL) || - stack.getType().equals(Material.WRITTEN_BOOK)) { - ItemMeta meta = stack.getItemMeta(); - if (meta instanceof BookMeta) { - // Found a book - BookMeta bookData = (BookMeta) meta; - String title = bookData.getTitle(); - String author = bookData.getAuthor(); - if (author == null) { - author = ""; - } - List pages = new ArrayList(bookData.getPages()); - - NamedItemStack plates = new NamedItemStack(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; - } - } - } - 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; - - 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)) { - ItemMeta meta = stack.getItemMeta(); - List lore = meta.getLore(); - if (lore != null && !lore.isEmpty()) { - String firstLore = lore.get(0); - Matcher match = printPlateRE.matcher(firstLore); - if (match.matches()) { - if (meta instanceof BookMeta) { - BookMeta bookData = (BookMeta) meta; - title = bookData.getTitle(); - author = bookData.getAuthor(); - if (author == null) { - author = ""; - } - watermark = Integer.parseInt(match.group(1)); - pages = new ArrayList(bookData.getPages()); - valid = true; - break; - } - } - } - } - } - } - - public boolean isValid() { - return valid; - } - - public int pageCount() { - return pages.size(); - } - - public NamedItemStack toBook() { - NamedItemStack book = new NamedItemStack(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 NamedItemStack toPamphlet() { - NamedItemStack book = new NamedItemStack(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 NamedItemStack toSecurityNote() { - NamedItemStack book = new NamedItemStack(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 = PrettyLore.limitLengthEllipsis(lore, PAGE_LORE_LENGTH_LIMIT); - - // Split in to lines based on length - List lines = PrettyLore.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/Factorys/ProductionFactory.java b/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java deleted file mode 100644 index 340e4af3..00000000 --- a/src/com/github/igotyou/FactoryMod/Factorys/ProductionFactory.java +++ /dev/null @@ -1,301 +0,0 @@ -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(); - } -} diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Factory.java b/src/com/github/igotyou/FactoryMod/interfaces/Factory.java deleted file mode 100644 index cdaadbee..00000000 --- a/src/com/github/igotyou/FactoryMod/interfaces/Factory.java +++ /dev/null @@ -1,55 +0,0 @@ -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(); -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java b/src/com/github/igotyou/FactoryMod/interfaces/Manager.java deleted file mode 100644 index 2282d153..00000000 --- a/src/com/github/igotyou/FactoryMod/interfaces/Manager.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.github.igotyou.FactoryMod.interfaces; - -import java.io.File; -import java.io.IOException; - -import org.bukkit.Location; - -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 -{ - -/** -* Saves the machine objects list of this manager to file -*/ - public void save(File file) throws IOException; - -/** -* Loads machine objects list of this manager from file -*/ - public void load(File file) throws IOException; - -/** -* 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(Factory factory); - -/** -* Returns the machine (if any exists) at the given location from this manager -*/ - public Factory 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(Factory factory); - -/** -* Returns the saves file name for this manager -*/ - public String getSavesFileName(); - -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Properties.java b/src/com/github/igotyou/FactoryMod/interfaces/Properties.java deleted file mode 100644 index 38ddad61..00000000 --- a/src/com/github/igotyou/FactoryMod/interfaces/Properties.java +++ /dev/null @@ -1,24 +0,0 @@ -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() ; -} \ No newline at end of file diff --git a/src/com/github/igotyou/FactoryMod/interfaces/Recipe.java b/src/com/github/igotyou/FactoryMod/interfaces/Recipe.java deleted file mode 100644 index d7e1ba2a..00000000 --- a/src/com/github/igotyou/FactoryMod/interfaces/Recipe.java +++ /dev/null @@ -1,10 +0,0 @@ -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(); -} diff --git a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java b/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java deleted file mode 100644 index c46b8d7a..00000000 --- a/src/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java +++ /dev/null @@ -1,414 +0,0 @@ -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; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -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 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; - - /** - * Constructor - */ - public FactoryModListener(FactoryModManager 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; - } - - /** - * 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) - { - 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 && !isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) - { - destroyFactoryAt(block); - } - } - } - } - - private void destroyFactoryAt(Block block) { - //Is the factory a production factory? - if (factoryMan.factoryExistsAt(block.getLocation())) - { - Factory factory = factoryMan.getFactory(block.getLocation()); - factory.destroy(block.getLocation()); - if(FactoryModPlugin.DESTRUCTIBLE_FACTORIES) - { - factoryMan.getManager(block.getLocation()).removeFactory(factory); - } - } - } - - /** - * Called when a entity explodes(creeper,tnt etc.) - * Nearly the same as blockBreakEvent - */ - @EventHandler - public void explosionListener(EntityExplodeEvent e) - { - List blocks = e.blockList(); - for (Block block : blocks) - { - if(isPotentialFactoryBlock(block)) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - Factory factory = factoryMan.getFactory(block.getLocation()); - if ((FactoryModPlugin.CITADEL_ENABLED && !isReinforced(block)) || !FactoryModPlugin.CITADEL_ENABLED) - { - destroyFactoryAt(block); - } - } - } - } - } - - /** - * Called when a block burns - * Nearly the same as blockBreakEvent - */ - @EventHandler - public void burnListener(BlockBurnEvent e) - { - Block block = e.getBlock(); - if (factoryMan.factoryExistsAt(block.getLocation())) - { - if (factoryMan.factoryExistsAt(block.getLocation())) - { - destroyFactoryAt(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(); - 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 && !isReinforced(clicked)) || - (((PlayerReinforcement) getReinforcement(clicked)).isAccessible(player))) - { - //if there is a production Factory at the clicked location - if (factoryMan.factoryExistsAt(clicked.getLocation())) - { - Factory 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 && !isReinforced(clicked)) || - (((PlayerReinforcement) 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 && !isReinforced(clicked)) || - (((PlayerReinforcement) 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 && !isReinforced(clicked)) || - (((PlayerReinforcement) 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); - } - } - } - } - } - 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!" )); - } - } - } - } - */ - } - 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.getId()== 61 || westType.getId() == 62) && eastType.getId()== 54) - { - return factoryMan.createFactory(loc, eastLocation, westLocation); - } - else if ((eastType.getId()== 61 || eastType.getId()== 62) && westType.getId()== 54) - { - return factoryMan.createFactory(loc, westLocation, eastLocation); - } - } - else - { - response=new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - if(! factoryMan.factoryExistsAt(southLocation) && !factoryMan.factoryExistsAt(northLocation)) - { - if((northType.getId()== 61 || northType.getId()== 62) && southType.getId()== 54) - { - return factoryMan.createFactory(loc, southLocation, northLocation); - } - else if((southType.getId()== 61 || southType.getId()== 62) && northType.getId()== 54) - { - return factoryMan.createFactory(loc, northLocation, southLocation); - } - } - else - { - response=new InteractionResponse(InteractionResult.FAILURE, "There is already a factory there!"); - } - return response; - } - -} 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 3d312c16..00000000 --- a/src/com/github/igotyou/FactoryMod/listeners/NoteStackListener.java +++ /dev/null @@ -1,194 +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.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) - 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 f06882c0..00000000 --- a/src/com/github/igotyou/FactoryMod/listeners/RedstoneListener.java +++ /dev/null @@ -1,129 +0,0 @@ -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 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; - //this is a lazy fix... - private ProductionManager productionMan; - - /** - * Constructor - */ - public RedstoneListener(FactoryModManager factoryManager, ProductionManager productionManager) - { - this.factoryMan = factoryManager; - this.productionMan = productionManager; - } - - @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 && !isReinforced(clicked)) || - (((PlayerReinforcement) 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())) - { - //Is the factory a production factory? - if (productionMan.factoryExistsAt(block.getLocation())) - { - ProductionFactory factory = (ProductionFactory) productionMan.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/managers/FactoryModManager.java b/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java deleted file mode 100644 index 80cd259e..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/FactoryModManager.java +++ /dev/null @@ -1,326 +0,0 @@ -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; -//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 listeners; - List managers; - - FactoryModPlugin plugin; //The plugin object - - public static FactoryModManager factoryMan; - - - /** - * Constructor - */ - public FactoryModManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - FactoryModManager.factoryMan = this; - - initializeManagers(); - loadManagers(); - periodicSaving(); - } - - /** - * Initializes the necassary managers for enabled factorys - */ - private void initializeManagers() - { - managers = new ArrayList(); - listeners = new ArrayList(); - - //if (FactoryModPlugin.PRODUCTION_ENEABLED) - //{ - initializeProductionManager(); - initializeNetherFactoryManager(); - initializePrintingPressManager(); - //} - } - - - /** - * 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); - } - - /** - * When plugin disabled, this is called. - */ - public void onDisable() - { - saveManagers(); - } - - /** - * Saves all managers - */ - private void saveManagers() - { - for (Manager manager : managers) - { - save(manager, getSavesFile(manager.getSavesFileName())); - } - } - - /** - * Loads all managers - */ - private void loadManagers() - { - for (Manager manager : managers) - { - load(manager, getSavesFile(manager.getSavesFileName())); - } - } - - /** - * Returns the appropriate manager depending on the given Manager Type - */ - @SuppressWarnings("rawtypes") - public Manager getManager(Class managerType) - { - for (Manager manager : managers) - { - if (managerType.isInstance(manager)) - { - return manager; - } - } - - return null; - } - - /** - * Load file - */ - private static void load(Manager managerInterface, File file) - { - try - { - 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); - } - } - - /** - * Save 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()); - } - } - catch (IOException exception) - { - throw new RuntimeException("Failed to save to " + file.getAbsolutePath(), exception); - } - } - - /** - * 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 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) - { - 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; - } - } - return response; - } -} 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 0e46791a..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/NetherFactoryManager.java +++ /dev/null @@ -1,407 +0,0 @@ -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; -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 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.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 java.util.Iterator; - -//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 implements Manager -{ - private FactoryModPlugin plugin; - private List netherFactorys; - private long repairTime; - - public NetherFactoryManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - netherFactorys = new ArrayList(); - //Set maintenance clock to 0 - updateFactorys(); - } - - 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); - 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(); - } - - public void load(File file) throws IOException - { - 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(); - } - } - - 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); - } - - 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 < 10000) - { - 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-plugin.NETHER_MARKER_MAX_DISTANCE; centerY <= blockY+plugin.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 && (isReinforced(netherLocation) || isReinforced(netherLocation1) || isReinforced(netherLocation2) || 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(!isReinforced(netherLocation) && !isReinforced(netherLocation1) && !isReinforced(netherLocation2) && !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(), this); - 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 InteractionResponse addFactory(Factory 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()) )) - { - netherFactorys.add(netherFactory); - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, ""); - } - } - - public NetherFactory getFactory(Location factoryLocation) - { - for (NetherFactory factory : netherFactorys) - { - 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 boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - public void removeFactory(Factory factory) - { - netherFactorys.remove((NetherFactory)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)) - { - itr.remove(); - } - } - } - - public String getSavesFileName() - { - return FactoryModPlugin.NETHER_FACTORY_SAVE_FILE; - } - - public double getScalingFactor(Location location) - { - double scalingFactor = 1; - NetherFactoryProperties properties = plugin.getNetherFactoryProperties(); - for (NetherFactory factory : netherFactorys) - { - 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())); - } - } - } - } - return scalingFactor; - } - -} 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 464cdfaa..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/PrintingPressManager.java +++ /dev/null @@ -1,290 +0,0 @@ -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.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: -/** -* 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 implements Manager -{ - private FactoryModPlugin plugin; - private List producers; - private long repairTime; - - public PrintingPressManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - producers = new ArrayList(); - //Set maintenance clock to 0 - updateFactorys(); - } - - 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); - ObjectOutputStream oos = new ObjectOutputStream(fileOutputStream); - int version = 1; - oos.writeInt(version); - oos.writeInt(producers.size()); - for (PrintingPress 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 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(); - } - - public void load(File file) throws IOException - { - 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(); - } - } - - public void updateFactorys() - { - plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() - { - @Override - public void run() - { - for (PrintingPress production: producers) - { - production.update(); - } - } - }, 0L, FactoryModPlugin.PRODUCER_UPDATE_CYCLE); - } - - 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 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())) - { - producers.add(production); - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, ""); - } - } - - public PrintingPress getFactory(Location factoryLocation) - { - for (PrintingPress production : producers) - { - if (production.getCenterLocation().equals(factoryLocation) || production.getInventoryLocation().equals(factoryLocation) - || production.getPowerSourceLocation().equals(factoryLocation)) - return production; - } - return null; - } - - public boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - public void removeFactory(Factory factory) - { - producers.remove((ProductionFactory)factory); - } - - public void updateRepair(long time) - { - for (PrintingPress production: producers) - { - production.updateRepair(time/((double)FactoryModPlugin.REPAIR_PERIOD)); - } - long currentTime=System.currentTimeMillis(); - Iterator itr=producers.iterator(); - while(itr.hasNext()) - { - PrintingPress producer=itr.next(); - if(currentTime>(producer.getTimeDisrepair()+FactoryModPlugin.DISREPAIR_PERIOD)) - { - itr.remove(); - } - } - } - - public String getSavesFileName() - { - return FactoryModPlugin.PRINTING_PRESSES_SAVE_FILE; - } - -} diff --git a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java b/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java deleted file mode 100644 index 0085443f..00000000 --- a/src/com/github/igotyou/FactoryMod/managers/ProductionManager.java +++ /dev/null @@ -1,338 +0,0 @@ -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.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -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.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.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: -/** -* 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 long repairTime; - - public ProductionManager(FactoryModPlugin plugin) - { - this.plugin = plugin; - producers = new ArrayList(); - //Set maintenance clock to 0 - updateFactorys(); - } - - 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(); - } - - public void load(File file) throws IOException - { - 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); - } - } - fileInputStream.close(); - } - - 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); - } - - public InteractionResponse createFactory(Location factoryLocation, Location inventoryLocation, Location powerSourceLocation) - { - if (!factoryExistsAt(factoryLocation)) - { - HashMap properties = plugin.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)) - { - HashMap properties = plugin.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 InteractionResponse addFactory(Factory factory) - { - ProductionFactory production = (ProductionFactory) factory; - if (production.getCenterLocation().getBlock().getType().equals(Material.WORKBENCH) && (!factoryExistsAt(production.getCenterLocation())) - || !factoryExistsAt(production.getInventoryLocation()) || !factoryExistsAt(production.getPowerSourceLocation())) - { - producers.add(production); - return new InteractionResponse(InteractionResult.SUCCESS, ""); - } - else - { - return new InteractionResponse(InteractionResult.FAILURE, ""); - } - } - - 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; - } - - public boolean factoryExistsAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = true; - } - return returnValue; - } - - public boolean factoryWholeAt(Location factoryLocation) - { - boolean returnValue = false; - if (getFactory(factoryLocation) != null) - { - returnValue = getFactory(factoryLocation).isWhole(false); - } - return returnValue; - } - - public void removeFactory(Factory factory) - { - producers.remove((ProductionFactory)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)) - { - itr.remove(); - } - } - } - - public String getSavesFileName() - { - return FactoryModPlugin.PRODUCTION_SAVES_FILE; - } - -} 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 7591f2cf..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/NetherFactoryProperties.java +++ /dev/null @@ -1,119 +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 -{ - private ItemList constructionMaterials; - private ItemList fuel; - private ItemList repairMaterials; - private int energyTime; - private String name; - 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 String getName() - { - return name; - } - - 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 deleted file mode 100644 index 7285b726..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/PrintingPressProperties.java +++ /dev/null @@ -1,187 +0,0 @@ -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; - -public class PrintingPressProperties { - - 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 String name; - 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 NamedItemStack(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 String getName() - { - return name; - } - - public ItemList getConstructionMaterials() { - return constructionMaterials; - } - - - public int getBookPagesCap() { - return bookPagesCap; - } -} 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 4172b3aa..00000000 --- a/src/com/github/igotyou/FactoryMod/properties/ProductionProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -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; - } -} 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/ProductionRecipe.java b/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java deleted file mode 100644 index 10d85dc2..00000000 --- a/src/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java +++ /dev/null @@ -1,110 +0,0 @@ -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; - } -} 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 009080e0..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/ItemList.java b/src/com/github/igotyou/FactoryMod/utility/ItemList.java deleted file mode 100644 index 68807640..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/ItemList.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -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; - -/** - * - * @author Brian Landry - */ -public class ItemList extends ArrayList { - public boolean exactlyIn(Inventory inventory) - { - 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; - } - 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) - { - 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; - } - 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) - { - int amountAvailable=0; - for(ItemStack itemStack:this) - { - int currentAmountAvailable=amountAvailable(inventory,itemStack); - amountAvailable=amountAvailable>currentAmountAvailable ? amountAvailable : currentAmountAvailable; - } - return amountAvailable; - } - public void putIn(Inventory inventory) - { - putIn(inventory,new ArrayList()); - } - public void putIn(Inventory inventory,List probabilisticEnchaments) - { - for(ItemStack itemStack:this) - { - int maxStackSize=itemStack.getMaxStackSize(); - int amount=itemStack.getAmount(); - while(amount>maxStackSize) - { - ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments); - for(Enchantment enchantment:enchantments.keySet()) - { - if(enchantment.canEnchantItem(itemStack)) - { - itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); - } - } - itemClone.setAmount(maxStackSize); - inventory.addItem(itemClone); - amount-=maxStackSize; - } - ItemStack itemClone=itemStack.clone(); - Map enchantments=getEnchantments(probabilisticEnchaments); - for(Enchantment enchantment:enchantments.keySet()) - { - if(enchantment.canEnchantItem(itemStack)) - { - itemClone.addUnsafeEnchantment(enchantment,enchantments.get(enchantment)); - } - } - itemClone.setAmount(amount); - inventory.addItem(itemClone); - } - } - - public HashMap getEnchantments(List probabilisticEnchaments) - { - 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()); - } - } - return enchantments; - } - - 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; - } - 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; - } -} 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 8fbfdf2f..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/NamedItemStack.java +++ /dev/null @@ -1,47 +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 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; - } -} diff --git a/src/com/github/igotyou/FactoryMod/utility/PrettyLore.java b/src/com/github/igotyou/FactoryMod/utility/PrettyLore.java deleted file mode 100644 index 69dbe58f..00000000 --- a/src/com/github/igotyou/FactoryMod/utility/PrettyLore.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.github.igotyou.FactoryMod.utility; - -import java.util.ArrayList; -import java.util.List; - -public class PrettyLore { - 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(); - } -} diff --git a/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java new file mode 100644 index 00000000..476c9a20 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java @@ -0,0 +1,925 @@ +package com.github.igotyou.FactoryMod; + +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.TreeMap; + +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.scheduler.BukkitRunnable; + +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; +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.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; +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.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; +import com.github.igotyou.FactoryMod.utility.FactoryGarbageCollector; + +public class ConfigParser { + private FactoryMod plugin; + private HashMap recipes; + private FactoryModManager manager; + private int defaultUpdateTime; + private ItemStack defaultFuel; + private int defaultFuelConsumptionTime; + private double defaultReturnRate; + private HashMap upgradeEggs; + private HashMap> recipeLists; + private HashMap recipeScalingUpgradeMapping; + private String defaultMenuFactory; + private long defaultBreakGracePeriod; + private int defaultDamagePerBreakPeriod; + private boolean useYamlIdentifers; + private int defaultHealth; + + public ConfigParser(FactoryMod 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(); + 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 { + 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() + .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); + 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); + int redstonePowerOn = config.getInt("redstone_power_on", 7); + int redstoneRecipeChange = config.getInt("redstone_recipe_change", 2); + 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) { + new BukkitRunnable() { + + @Override + public void run() { + FactoryMod.getManager().saveFactories(); + + } + }.runTaskTimerAsynchronously(plugin, savingIntervall, savingIntervall); + } + 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, factoryRenames); + upgradeEggs = new HashMap(); + recipeLists = new HashMap>(); + recipeScalingUpgradeMapping = new HashMap(); + parseFactories(config.getConfigurationSection("factories")); + parseRecipes(config.getConfigurationSection("recipes")); + assignRecipeScalingRecipes(); + 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 + // 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; + } + + /** + * 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(); + List recipeKeys = new LinkedList(); + for (String key : config.getKeys(false)) { + ConfigurationSection current = config.getConfigurationSection(key); + if (current == null) { + plugin.warning("Found invalid section that should not exist at " + config.getCurrentPath() + key); + continue; + } + 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.", currentIdent)); + } else { + if (recipes.containsKey(recipe.getIdentifier())) { + plugin.warning("Recipe identifier " + recipe.getIdentifier() + " was found twice in the config. One instance was skipped"); + } + else { + recipes.put(recipe.getIdentifier(), recipe); + manager.registerRecipe(recipe); + } + } + } + } + + /** + * 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) { + for (String key : config.getKeys(false)) { + parseFactory(config.getConfigurationSection(key)); + } + + } + + /** + * 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) { + IFactoryEgg egg = null; + 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) { + break; + } + ItemMap setupCost = parseItemMap(config + .getConfigurationSection("setupcost")); + 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")); + 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")); + 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")); + } + if (egg != null) { + plugin.info("Parsed factory " + egg.getName()); + } else { + plugin.warning(String.format("Failed to set up factory %s", config.getCurrentPath())); + } + + } + + 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")); + } else { + update = defaultUpdateTime; + } + ItemStack fuel; + if (config.contains("fuel")) { + 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; + } + 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 sortamount = config.getInt("sort_amount"); + int matsPerSide = config.getInt("maximum_materials_per_side"); + return new SorterEgg(name, update, fuel, fuelIntervall, sortTime, + 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")); + } else { + update = defaultUpdateTime; + } + ItemStack fuel; + if (config.contains("fuel")) { + 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; + } + 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("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, maxLength); + } + + 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")); + } else { + update = defaultUpdateTime; + } + ItemStack fuel; + if (config.contains("fuel")) { + 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; + } + 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 + .getString("fuel_consumption_intervall")); + } 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; + } + double citadelBreakReduction = config.getDouble("citadelBreakReduction", 1.0); + FurnCraftChestEgg egg = new FurnCraftChestEgg(name, update, null, fuel, + fuelIntervall, returnRate, health, gracePeriod, healthPerDamageIntervall, citadelBreakReduction); + recipeLists.put(egg, config.getStringList("recipes")); + return egg; + } + + public void enableFactoryDecay(ConfigurationSection config) { + long interval = parseTime(config.getString("decay_intervall")); + plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, + new FactoryGarbageCollector(), interval, interval); + } + + /** + * 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; + 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) { + identifier = config.getName(); + } + else { + identifier = name; + } + } + String prodTime = config.getString("production_time"); + if (prodTime == null && parentRecipe == null) { + plugin.warning("No production time specied for recipe " + name + ". Skipping it"); + return null; + } + 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 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": + 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); + } + 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", + (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(); + 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, input, excluded, name, + productionTime, compactedLore); + break; + case "DECOMPACT": + 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": + 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": + String upgradeName = config.getString("factory"); + 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.warning("Could not find factory " + upgradeName + + " for upgrade recipe " + name); + result = null; + } else { + 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){ + ItemStack essence = tessence + .getItemStackRepresentation().get(0); + int repPerEssence = config.getInt("repair_per_essence"); + int range = config.getInt("range"); + result = new AOERepairRecipe(identifier, name, productionTime, essence, range, + repPerEssence); + } else { + plugin.severe("No essence specified for AOEREPAIR " + config.getCurrentPath()); + result = null; + } + break; + case "PYLON": + 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": + 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": + ConfigurationSection outputSect = config.getConfigurationSection("outputs"); + Map outputs = new HashMap(); + ItemMap displayThis = null; + 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; + } + } + 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, input, outputs, displayThis); + break; + case "COSTRETURN": + double factor = config.getDouble("factor", + (parentRecipe instanceof FactoryMaterialReturnRecipe) ? ((FactoryMaterialReturnRecipe)parentRecipe).getFactor() : 1.0); + result = new FactoryMaterialReturnRecipe(identifier, name, productionTime, input, factor); + break; + case "LOREENCHANT": + 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; + } + 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 "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; + default: + plugin.severe("Could not identify type " + config.getString("type") + + " as a valid recipe identifier"); + result = null; + } + if (result != null) { + ((InputRecipe)result).setFuelConsumptionIntervall((int)parseTime(config.getString("fuel_consumption_intervall", "-1"))); + plugin.info("Parsed recipe " + name); + } + 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(); + 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 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.warning("Could not find specified recipe " + recipeName + + " for factory " + entry.getKey().getName()); + } + } + ((FurnCraftChestEgg) entry.getKey()).setRecipes(recipeList); + } + } + for(IRecipe reci : recipes.values()) { + if (!usedRecipes.contains(reci)) { + plugin.warning("The recipe " + reci.getName() + " is specified in the config, but not used in any factory"); + } + } + } + + 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/FactoryMod.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java new file mode 100644 index 00000000..98c05d1d --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java @@ -0,0 +1,79 @@ +package com.github.igotyou.FactoryMod; + +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; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; + +import vg.civcraft.mc.civmenu.guides.ResponseManager; +import vg.civcraft.mc.civmodcore.ACivMod; + +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(); + handle.registerCommands(); + super.onEnable(); + plugin = this; + MultiBlockStructure.initializeBlockFaceMap(); + ConfigParser cp = new ConfigParser(this); + manager = cp.parse(); + mb = new MenuBuilder(cp.getDefaultMenuFactory()); + manager.loadFactories(); + registerListeners(); + if (getServer().getPluginManager().isPluginEnabled("CivMenu")) { + rm = ResponseManager.getResponseManager(this); + } + info("Successfully enabled"); + } + + public void onDisable() { + manager.shutDown(); + 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(), plugin); + if (manager.isCitadelEnabled()) { + plugin.getServer().getPluginManager().registerEvents(new CitadelListener(), 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/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java new file mode 100644 index 00000000..a77bfa89 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java @@ -0,0 +1,628 @@ +package com.github.igotyou.FactoryMod; + +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 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 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; +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; +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 + * + */ +public class FactoryModManager { + private FactoryMod plugin; + private FileHandler fileHandler; + 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 logInventories; + private int redstonePowerOn; + private int redstoneRecipeChange; + private Set compactLore; + + public FactoryModManager(FactoryMod plugin, + Material factoryInteractionMaterial, boolean citadelEnabled, + boolean nameLayerEnabled, int redstonePowerOn, + int redstoneRecipeChange, boolean logInventories, + Map factoryRenames) { + this.plugin = plugin; + this.factoryInteractionMaterial = factoryInteractionMaterial; + this.citadelEnabled = citadelEnabled; + this.redstonePowerOn = redstonePowerOn; + this.redstoneRecipeChange = redstoneRecipeChange; + this.fileHandler = new FileHandler(this, factoryRenames); + + 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(); + eggs = new HashMap(); + possibleCenterBlocks = new HashSet(); + possibleInteractionBlock = new HashSet(); + factories = new HashSet(); + totalSetupCosts = new HashMap(); + recipes = new HashMap(); + compactLore = new HashSet(); + + // Normal furnace, craftingtable, chest factories + possibleCenterBlocks.add(Material.WORKBENCH); + possibleInteractionBlock.add(Material.WORKBENCH); + possibleInteractionBlock.add(Material.FURNACE); + possibleInteractionBlock.add(Material.BURNING_FURNACE); + possibleInteractionBlock.add(Material.CHEST); + + // sorter + possibleCenterBlocks.add(Material.DROPPER); + possibleInteractionBlock.add(Material.DROPPER); + + // pipe + possibleCenterBlocks.add(Material.DISPENSER); + possibleInteractionBlock.add(Material.DISPENSER); + } + + /** + * Sets the lore used for compacting recipes. This is needed for the compact + * item listeners + * + * @param lore + * Lore used for compacting items + */ + public void addCompactLore(String lore) { + compactLore.add(lore); + } + + public boolean logInventories() { + return logInventories; + } + + /** + * @return Lore given to compacted items + */ + public boolean isCompactLore(String lore) { + return compactLore.contains(lore); + } + + /** + * 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 + * + * @param f + * Factory to add + */ + public void addFactory(Factory f) { + factories.add(f); + for (Block b : f.getMultiBlockStructure().getRelevantBlocks()) { + locations.put(b.getLocation(), f); + } + } + + /** + * @return Whether citadel is enabled on the server + */ + 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 + */ + public Material getFactoryInteractionMaterial() { + return factoryInteractionMaterial; + } + + /** + * Removes a factory from the manager + * + * @param f + * Factory to remove + */ + public void removeFactory(Factory f) { + if (f.isActive()) { + f.deactivate(); + } + factories.remove(f); + FurnCraftChestFactory.removePylon(f); + for (Location b : f.getMultiBlockStructure().getAllBlocks()) { + locations.remove(b); + } + } + + /** + * 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) { + 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) { + //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) { + 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) { + 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) { + ((Chest) (fccs.getChest().getState())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.getName()); + FactoryMod.sendResponse("FactoryCreation", p); + } + } else { + p.sendMessage(ChatColor.RED + + "There is no factory with the given creation materials"); + FactoryMod.sendResponse( + "WrongFactoryCreationItems", p); + } + } + return; + } 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) { + 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()) { + p.sendMessage(ChatColor.RED + + "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())) + .getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.getName()); + FactoryMod.sendResponse("PipeCreation", p); + } + + } else { + p.sendMessage(ChatColor.RED + + "There is no pipe with the given creation materials"); + FactoryMod + .sendResponse("WrongPipeCreationItems", p); + } + } + return; + } else { + p.sendMessage(ChatColor.RED + + "This pipe is not set up the right way"); + 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) { + 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) { + ((Dropper) (bfs.getCenter().getBlock() + .getState())).getInventory().clear(); + addFactory(f); + p.sendMessage(ChatColor.GREEN + + "Successfully created " + f.getName()); + LoggingUtils.log(f.getLogData() + + " was created by " + p.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 + + "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); + 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()); + return map; + } + } + + } + } + return map; + } + + /** + * 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; + } + + 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 + * 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 addFactoryCreationEgg(Class blockStructureClass, + ItemMap recipe, IFactoryEgg egg) { + HashMap eggs = factoryCreationRecipes + .get(blockStructureClass); + if (eggs == null) { + eggs = new HashMap(); + factoryCreationRecipes.put(blockStructureClass, eggs); + } + eggs.put(recipe, 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(getAllFactories()); + } + + 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 + * 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); + } + + /** + * 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; + } + + /** + * 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() { + synchronized (factories) { + return new HashSet(factories); + } + } + + /** + * 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 identifier) { + if (identifier == null) { + return null; + } + 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/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java b/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java new file mode 100644 index 00000000..77921c8c --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/commands/FactoryModCommandHandler.java @@ -0,0 +1,67 @@ +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 com.github.igotyou.FactoryMod.commands.commands.RunAmountSetterCommand; + +import vg.civcraft.mc.civmodcore.command.CommandHandler; + +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) { + 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/main/java/com/github/igotyou/FactoryMod/commands/commands/Create.java b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Create.java new file mode 100644 index 00000000..f12d4713 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Create.java @@ -0,0 +1,130 @@ +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.factories.Factory; +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); + 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) { + 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/main/java/com/github/igotyou/FactoryMod/commands/commands/Menu.java b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Menu.java new file mode 100644 index 00000000..f8fa7088 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/commands/commands/Menu.java @@ -0,0 +1,49 @@ +package com.github.igotyou.FactoryMod.commands.commands; + +import java.util.List; + +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.commands.FactoryModCommandHandler; +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, 10); + } + + @Override + public boolean execute(CommandSender sender, String[] args) { + if (!(sender instanceof Player)) { + sender.sendMessage(ChatColor.MAGIC + "Fuck off console man"); + return true; + } + 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 { + mb.openFactoryBrowser(p, FactoryModCommandHandler.getFactoryName(args)); + } + return true; + } + + @Override + public List tabComplete(CommandSender arg0, String [] arg1) { + return FactoryModCommandHandler.tabCompleteFactory(arg0, 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 new file mode 100644 index 00000000..d4bf70f2 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/FurnCraftChestEgg.java @@ -0,0 +1,157 @@ +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; +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; + private int updateTime; + private List recipes; + private ItemStack fuel; + private int fuelConsumptionIntervall; + private int maximumHealth; + 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, double citadelBreakReduction) { + 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; + this.citadelBreakReduction = citadelBreakReduction; + } + + public Factory hatch(MultiBlockStructure mbs, Player p) { + FurnCraftChestStructure fccs = (FurnCraftChestStructure) mbs; + FurnacePowerManager fpm = new FurnacePowerManager(fccs.getFurnace(), + fuel, fuelConsumptionIntervall); + FurnCraftChestInteractionManager fccim = new FurnCraftChestInteractionManager(); + PercentageHealthRepairManager phrm = new PercentageHealthRepairManager(maximumHealth, maximumHealth, 0, healthPerDamagePeriod, breakGracePeriod); + FurnCraftChestFactory fccf = new FurnCraftChestFactory(fccim, phrm, + fpm, fccs, updateTime, name, recipes, citadelBreakReduction); + fccim.setFactory(fccf); + phrm.setFactory(fccf); + if (recipes.size() != 0) { + fccf.setRecipe(recipes.get(0)); + } + return fccf; + } + + public String getName() { + return name; + } + + public int getUpdateTime() { + return updateTime; + } + + public ItemStack getFuel() { + return fuel; + } + + public List getRecipes() { + return recipes; + } + + public void setRecipes(List recipes) { + this.recipes = recipes; + } + + public double getReturnRate() { + return returnRateOnDestruction; + } + + 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, long 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 (); + 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, currRecipes, citadelBreakReduction); + fccim.setFactory(fccf); + phrm.setFactory(fccf); + for (IRecipe recipe : currRecipes) { + if (recipe.getName().equals(selectedRecipe)) { + fccf.setRecipe(recipe); + } + } + if (fccf.getCurrentRecipe() == null && currRecipes.size() != 0) { + fccf.setRecipe(currRecipes.get(0)); + } + if (productionTimer != 0) { + fccf.attemptToActivate(null, true); + if (fccf.isActive()) { + fccf.setProductionTimer(productionTimer); + } + } + return fccf; + } + + public Class getMultiBlockStructure() { + return FurnCraftChestStructure.class; + } + + public double getCitadelBreakReduction() { + return citadelBreakReduction; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java new file mode 100644 index 00000000..e3722be4 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java @@ -0,0 +1,68 @@ +package com.github.igotyou.FactoryMod.eggs; + +import org.bukkit.entity.Player; + +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.structures.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 { + /** + * 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(); + + /** + * 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 + * 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/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java new file mode 100644 index 00000000..d9fb8487 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/PipeEgg.java @@ -0,0 +1,127 @@ +package com.github.igotyou.FactoryMod.eggs; + +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.Material; +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; + private byte color; + 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 maximumLength) { + this.name = name; + this.fuel = fuel; + this.updateTime = updateTime; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.transferTimeMultiplier = transferTimeMultiplier; + this.transferAmount = transferAmount; + this.allowedMaterials = allowedMaterials; + this.color = color; + this.returnRate = returnRate; + this.maximumLength = maximumLength; + } + + 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 double getReturnRate() { + return returnRate; + } + + public int getTransferAmount() { + return transferAmount; + } + + public int getTransferTimeMultiplier() { + return transferTimeMultiplier; + } + + public byte getColor() { + return color; + } + + public int getMaximumLength() { + return maximumLength; + } + + 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); + ((NoRepairDestroyOnBreakManager)rm).setFactory(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); + ((PipeStructure) ps).setGlassColor(color); + ((PipeInteractionManager) im).setPipe(pipe); + ((NoRepairDestroyOnBreakManager)rm).setFactory(pipe); + pipe.setAllowedMaterials(allowedMaterials); + if (runTime != 0) { + pipe.attemptToActivate(null, true); + if (pipe.isActive()) { + pipe.setRunTime(runTime); + } + } + return pipe; + } + + public Class getMultiBlockStructure() { + return PipeStructure.class; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/eggs/SorterEgg.java b/src/main/java/com/github/igotyou/FactoryMod/eggs/SorterEgg.java new file mode 100644 index 00000000..6eb576eb --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/eggs/SorterEgg.java @@ -0,0 +1,118 @@ +package com.github.igotyou.FactoryMod.eggs; + +import java.util.List; +import java.util.Map; + +import org.bukkit.Location; +import org.bukkit.block.BlockFace; +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; +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; + +public class SorterEgg implements IFactoryEgg { + private String name; + private int updateTime; + private ItemStack fuel; + private int fuelConsumptionIntervall; + 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, 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; + } + + 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, sortAmount); + ((NoRepairDestroyOnBreakManager) rm).setFactory(sorter); + ((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, sortAmount); + ((SorterInteractionManager) im).setSorter(sorter); + ((NoRepairDestroyOnBreakManager) rm).setFactory(sorter); + sorter.setAssignments(assignments); + if (runTime != 0) { + sorter.attemptToActivate(null, true); + if (sorter.isActive()) { + sorter.setRunTime(runTime); + } + } + return sorter; + } + + public String getName() { + return name; + } + + public int getUpdateTime() { + return updateTime; + } + + public ItemStack getFuel() { + return fuel; + } + + public double getReturnRate() { + return returnRate; + } + + public int getFuelConsumptionIntervall() { + return fuelConsumptionIntervall; + } + + public int getSortTime() { + return sortTime; + } + + public int getMaterialsPerSide() { + return matsPerSide; + } + + public int getSortAmount() { + return sortAmount; + } + + public Class getMultiBlockStructure() { + return BlockFurnaceStructure.class; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/FactoryActivateEvent.java new file mode 100644 index 00000000..93343ea2 --- /dev/null +++ b/src/main/java/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/main/java/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/ItemTransferEvent.java new file mode 100644 index 00000000..25f451d3 --- /dev/null +++ b/src/main/java/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/main/java/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java b/src/main/java/com/github/igotyou/FactoryMod/events/RecipeExecuteEvent.java new file mode 100644 index 00000000..9b03c6a1 --- /dev/null +++ b/src/main/java/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/main/java/com/github/igotyou/FactoryMod/factories/Factory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Factory.java new file mode 100644 index 00000000..1baacba1 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/Factory.java @@ -0,0 +1,159 @@ +package com.github.igotyou.FactoryMod.factories; + +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; +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 + * + */ +public abstract class Factory implements Runnable { + protected IInteractionManager im; + protected IRepairManager rm; + protected IPowerManager pm; + protected boolean active; + protected MultiBlockStructure mbs; + protected int updateTime; + protected String name; + protected int threadId; + + public Factory(IInteractionManager im, IRepairManager rm, 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; + } + + /** + * @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 + * @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, boolean onStartUp); + + public void scheduleUpdate() { + threadId = FactoryMod.getPlugin().getServer().getScheduler() + .scheduleSyncDelayedTask(FactoryMod.getPlugin(), this, (long) updateTime); + } + + 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(); + furnace.getInventory().clear(); + f.setType(Material.BURNING_FURNACE); + furnace = (Furnace) f.getState(); + MaterialData data = furnace.getData(); + ((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(); + } + + 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. + if (f.getType() != Material.BURNING_FURNACE) { + return; + } + Furnace furnace = (Furnace) f.getState(); + furnace.setBurnTime((short) 0); + furnace.update(); + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java new file mode 100644 index 00000000..00c448f9 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/FurnCraftChestFactory.java @@ -0,0 +1,544 @@ +package com.github.igotyou.FactoryMod.factories; + +import java.util.ArrayList; +import java.util.HashMap; +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; +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; + +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.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; +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.RecipeScalingUpgradeRecipe; +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; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; + +/** + * 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 class FurnCraftChestFactory extends Factory { + protected int currentProductionTimer = 0; + protected List recipes; + protected IRecipe currentRecipe; + protected Map runCount; + 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) { + super(im, rm, ipm, mbs, updateTime, name); + 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) { + addRecipe(rec); + } + if (pylonFactories == null) { + pylonFactories = new HashSet(); + } + for (IRecipe rec : recipes) { + if (rec instanceof PylonRecipe) { + pylonFactories.add(this); + break; + } + } + } + + /** + * @return Inventory of the chest or null if there is no chest where one + * should be + */ + public Inventory getInventory() { + if (!(getChest().getType() == Material.CHEST)) { + return null; + } + Chest chestBlock = (Chest) (getChest().getState()); + return chestBlock.getInventory(); + } + + /** + * @return Inventory of the furnace or null if there is no furnace where one + * should be + */ + public FurnaceInventory getFurnaceInventory() { + 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()); + mbs.recheckComplete(); + //dont activate twice + if (active) { + 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) { + p.sendMessage(ChatColor.RED + "Not enough materials available to run any recipe"); + } + return; + } else { + if (p != null) { + p.sendMessage(ChatColor.GOLD + "Automatically selected recipe " + autoSelected.getName()); + } + setRecipe(autoSelected); + } + } + } + //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; + } + } + } + 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(); + } + + /** + * 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() { + LoggingUtils.log("Activating " + getLogData()); + active = true; + pm.setPowerCounter(0); + turnFurnaceOn(getFurnace()); + // reset the production timer + currentProductionTimer = 0; + run(); + } + + /** + * Turns the factory off. + */ + public void deactivate() { + LoggingUtils.log("Deactivating " + getLogData()); + if (active) { + Bukkit.getScheduler().cancelTask(threadId); + turnFurnaceOff(getFurnace()); + active = false; + // reset the production timer + currentProductionTimer = 0; + activator = null; + } + } + + /** + * @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(); + } + + /** + * @return How long the factory has been running in ticks + */ + public int getRunningTime() { + return currentProductionTimer; + } + + public void setRunCount(IRecipe r, Integer count) { + if (recipes.contains(r)) { + 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 + * 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 + */ + public void run() { + if (active && mbs.isComplete()) { + // if the materials required to produce the current recipe are in + // the factory inventory + if (hasInputMaterials()) { + // if the factory has been working for less than the required + // time for the recipe + if (currentProductionTimer < currentRecipe.getProductionTime()) { + // 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).getFuelConsumptionIntervall() != -1 ? ((InputRecipe) currentRecipe) + .getFuelConsumptionIntervall() : pm.getPowerConsumptionIntervall(); + if (pm.getPowerCounter() >= consumptionIntervall - 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 + currentProductionTimer += updateTime; + // schedule next update + scheduleUpdate(); + } + // if there is no fuel Available turn off the factory + else { + 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); + Bukkit.getPluginManager().callEvent(ree); + if (ree.isCancelled()) { + LoggingUtils.log("Executing recipe " + currentRecipe.getName() + " for " + getLogData() + + " was cancelled over the event"); + deactivate(); + return; + } + 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 + // other stuff, this is needed + currentRecipe.applyEffect(getInventory(), this); + deactivate(); + return; + } else { + currentRecipe.applyEffect(getInventory(), this); + runCount.put(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 (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 + } else { + deactivate(); + } + } + } else { + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because it ran out of required materials"); + deactivate(); + } + } else { + sendActivatorMessage(ChatColor.GOLD + name + " deactivated, because the factory was destroyed"); + deactivate(); + } + } + + /** + * @return All the recipes which are available for this instance + */ + 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 + */ + 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; + } + } + + 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) { + Player p = Bukkit.getPlayer(activator); + if (p != null) { + p.sendMessage(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 + * + * @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 + */ + 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) { + 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); + if (recipes.size() != 0) { + setRecipe(recipes.get(0)); + } else { + currentRecipe = null; + } + runCount = new HashMap(); + for (IRecipe rec : recipes) { + runCount.put(rec, 0); + } + for (IRecipe rec : recipes) { + if (rec instanceof PylonRecipe) { + pylonFactories.add(this); + break; + } + } + } + + public double getCitadelBreakReduction() { + return citadelBreakReduction; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/Pipe.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Pipe.java new file mode 100644 index 00000000..fa8bab6f --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/Pipe.java @@ -0,0 +1,241 @@ +package com.github.igotyou.FactoryMod.factories; + +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; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.ItemStack; + +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.MultiBlockStructure; +import com.github.igotyou.FactoryMod.structures.PipeStructure; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; + +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, boolean onStartUp) { + LoggingUtils.log((p != null ? p.getName() : "Redstone") + + "is attempting to activate " + getLogData()); + mbs.recheckComplete(); + 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"); + } + 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"); + } + } + } else { + rm.breakIt(); + p.sendMessage(ChatColor.RED + + "Failed to activate pipe, it is missing blocks"); + } + } + + public void activate() { + LoggingUtils.log("Activating " + getLogData()); + active = true; + pm.setPowerCounter(0); + turnFurnaceOn(((PipeStructure) mbs).getFurnace()); + // reset the production timer + runTime = 0; + run(); + } + + public void deactivate() { + LoggingUtils.log("Deactivating " + getLogData()); + active = false; + Bukkit.getScheduler().cancelTask(threadId); + 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 { + 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) { + // 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() { + LoggingUtils.log("Attempting to transfer for " + getLogData()); + mbs.recheckComplete(); + 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 + && is.getAmount() != 0 + && (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)) { + 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()); + LoggingUtils.logInventory(targetInventory, + "Target inventory before transfer for " + + getLogData()); + if (removeMap.removeSafelyFrom(sourceInventory)) { + 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; + } + 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 int getRunTime() { + return runTime; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/factories/Sorter.java b/src/main/java/com/github/igotyou/FactoryMod/factories/Sorter.java new file mode 100644 index 00000000..1d69d7a2 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/factories/Sorter.java @@ -0,0 +1,270 @@ +package com.github.igotyou.FactoryMod.factories; + +import java.util.HashMap; +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; +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 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.utility.LoggingUtils; + +public class Sorter extends Factory { + private Map assignedMaterials; + 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 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) { + assignedMaterials.put(bf, new ItemMap()); + } + } + + public void attemptToActivate(Player p, boolean onStartUp) { + LoggingUtils.log((p != null ? p.getName() : "Redstone") + + "is attempting to activate " + getLogData()); + mbs.recheckComplete(); + 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) { + 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() { + 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()); + Bukkit.getScheduler().cancelTask(threadId); + 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 { + Block furnace = ((BlockFurnaceStructure) mbs).getFurnace(); + if (furnace.getType() != Material.BURNING_FURNACE) { + turnFurnaceOn(furnace); + } + 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 ItemMap getItemsForSide(BlockFace face) { + return assignedMaterials.get(face); + } + + public void removeAssignment(ItemStack is) { + for (Entry entry : assignedMaterials.entrySet()) { + if (entry.getValue().getAmount(is) != 0) { + entry.getValue().removeItemStackCompletly(is); + break; + } + } + } + + public void sortStack() { + LoggingUtils.log("Attempting to sort " + getLogData()); + Block center = mbs.getCenter().getBlock(); + Inventory inv = getCenterInventory(); + 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); + for (ItemStack is : inv.getContents()) { + if (is != null && is.getType() != Material.AIR + && im != null && im.getAmount(is) != 0) { + int removeAmount = Math.min(leftToSort, is.getAmount()); + 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 " + + 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); + LoggingUtils.logInventory(inv, + "Origin inventory after transfer for " + + getLogData()); + LoggingUtils.logInventory(relInv, + "Target inventory after transfer for " + + getLogData()); + leftToSort -= removeAmount; + break; + } + } + if (leftToSort <= 0) { + break; + } + } + } + if (leftToSort <= 0) { + break; + } + } + } + + public void setRunTime(int runtime) { + this.runTime = runtime; + } + + public int getRunTime() { + return 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; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java new file mode 100644 index 00000000..38d0223d --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/FurnCraftChestInteractionManager.java @@ -0,0 +1,307 @@ +package com.github.igotyou.FactoryMod.interactionManager; + +import java.text.DecimalFormat; +import java.util.HashMap; +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; +import org.bukkit.event.block.BlockRedstoneEvent; +import org.bukkit.inventory.ItemStack; + +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; +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; +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(); + this.fccf = fccf; + } + + public FurnCraftChestInteractionManager() { + this.decimalFormatting = new DecimalFormat("#.#####"); + } + + 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, false); + } + } 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 leftClick(Player p, Block b, BlockFace bf) { + if (p.getInventory().getItemInMainHand().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 (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getChest())) { // chest interaction + if (p.isSneaking()) { // sneaking, so showing detailed recipe stuff + ClickableInventory ci = new ClickableInventory(54, fccf + .getCurrentRecipe().getName()); + int index = 4; + List inp = ((InputRecipe) fccf.getCurrentRecipe()) + .getInputRepresentation(fccf.getInventory(), fccf); + 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(), fccf); + 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); + + } 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().getName()); + p.sendMessage(ChatColor.GOLD + "Currently at " + + fccf.getRepairManager().getHealth() + " health"); + if (fccf.getRepairManager().inDisrepair()) { + PercentageHealthRepairManager rm = ((PercentageHealthRepairManager) fccf.getRepairManager()); + 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" : ""); + if (time.equals("")) { + time = " less than an hour"; + } + p.sendMessage(ChatColor.GOLD + "It will break permanently in " + time); + } + } + + return; + } + if (b.equals(((FurnCraftChestStructure) fccf.getMultiBlockStructure()) + .getCraftingTable())) { // crafting table interaction + int rows = (fccf.getRecipes().size() / 9) + 1; + if (fccf.getRecipes().size() > 52 || rows > 6) { + p.sendMessage(ChatColor.RED + + "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; + } + ClickableInventory ci = new ClickableInventory(rows * 9, + "Select a recipe"); + for (IRecipe rec : fccf.getRecipes()) { + InputRecipe recipe = (InputRecipe) (rec); + ItemStack recStack = recipe.getRecipeRepresentation(); + int runcount = fccf.getRunCount(recipe); + ISUtils.addLore( + recStack, + 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 + 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).getName()); + FactoryMod.sendResponse("RecipeSwitch", 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 + + "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); + + 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, false); + 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 + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java new file mode 100644 index 00000000..1a0400a0 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/IInteractionManager.java @@ -0,0 +1,56 @@ +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; + +/** + * 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, BlockFace bf); + + /** + * 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, BlockFace bf); + + /** + * 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, Block factoryBlock); + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java new file mode 100644 index 00000000..223fcc2b --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/PipeInteractionManager.java @@ -0,0 +1,131 @@ +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.block.BlockFace; +import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockRedstoneEvent; +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.group.Group; +import vg.civcraft.mc.namelayer.permission.PermissionType; + +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; + +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, BlockFace bf) { + // no use for this here + } + + public void leftClick(Player p, Block b, BlockFace bf) { + ItemStack hand = p.getInventory().getItemInMainHand(); + 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(((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, false); + } + } + } + + 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, false); + } + } else { + return; + } + } + } + + 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/main/java/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java new file mode 100644 index 00000000..91bdfc75 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/interactionManager/SorterInteractionManager.java @@ -0,0 +1,136 @@ +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 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 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; +import com.github.igotyou.FactoryMod.structures.BlockFurnaceStructure; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; +import com.github.igotyou.FactoryMod.utility.MenuBuilder; + +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) { + this.sorter = sorter; + this.bfs = (BlockFurnaceStructure) sorter.getMultiBlockStructure(); + } + + public void blockBreak(Player p, Block b) { + sorter.getRepairManager().breakIt(); + if (p != null) { + p.sendMessage(ChatColor.DARK_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 (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(bfs.getFurnace())) { + if (p.getInventory().getItemInMainHand() + .getType() + .equals(FactoryMod.getManager() + .getFactoryInteractionMaterial())) { + sorter.attemptToActivate(p, false); + } + } else { // center + if (p.isSneaking() + && p.getInventory().getItemInMainHand() + .getType() + .equals(FactoryMod.getManager() + .getFactoryInteractionMaterial())) { + mb.showSorterFace(p, sorter, bf); + return; + } + ItemStack is = p.getInventory().getItemInMainHand(); + if (is == null) { + return; + //no item in hand + } + BlockFace side = sorter.getSide(is); + if (side == null) { + sorter.addAssignment(bf, is); + p.sendMessage(ChatColor.GREEN + "Added " + + NiceNames.getName(is) + " to " + bf.toString()); + } else { + if (side == bf) { + sorter.removeAssignment(is); + p.sendMessage(ChatColor.GOLD + "Removed " + + NiceNames.getName(is) + " from " + + side.toString()); + } else { + p.sendMessage(ChatColor.RED + + "This item is already associated with " + + side.toString()); + } + } + } + } + + 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, false); + } + } else { + return; + } + } + } +} 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/listeners/CompactItemListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java new file mode 100644 index 00000000..458bc744 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/CompactItemListener.java @@ -0,0 +1,74 @@ +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; +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 { + + /** + * Prevents players from placing compacted blocks + */ + @EventHandler + public void blockPlaceEvent(BlockPlaceEvent e) { + if (isCompacted(e.getItemInHand())) { + e.setCancelled(true); + Player p = e.getPlayer(); + if (p != null) { + 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()) { + if (isCompacted(is)) { + e.setCancelled(true); + HumanEntity h = e.getWhoClicked(); + if (h instanceof Player && h != null) { + ((Player) h) + .sendMessage("You can not craft with compacted items"); + } + break; + } + } + } + + 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/listeners/FactoryModListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java new file mode 100644 index 00000000..6a43e064 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/FactoryModListener.java @@ -0,0 +1,209 @@ +package com.github.igotyou.FactoryMod.listeners; + +import java.util.List; + +import org.bukkit.GameMode; +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.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; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.meta.ItemMeta; + +import vg.civcraft.mc.citadel.Citadel; +import vg.civcraft.mc.citadel.ReinforcementManager; + +import com.github.igotyou.FactoryMod.FactoryModManager; +import com.github.igotyou.FactoryMod.factories.Factory; +import com.github.igotyou.FactoryMod.structures.MultiBlockStructure; + +public class FactoryModListener implements Listener { + private FactoryModManager manager; + private ReinforcementManager rm; + + public FactoryModListener(FactoryModManager manager) { + this.manager = manager; + if (manager.isCitadelEnabled()) { + rm = Citadel.getReinforcementManager(); + } + } + + /** + * 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) + public void blockBreakEvent(BlockBreakEvent e) { + Block block = e.getBlock(); + if (manager.isPossibleInteractionBlock(block.getType())) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + //let creative player interact without breaking it + 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); + } + } + + } + + @EventHandler + public void redstoneChange(BlockRedstoneEvent e) { + if (e.getOldCurrent() == e.getNewCurrent()) { + return; + } + for (BlockFace face : MultiBlockStructure.allBlockSides) { + Factory f = manager.getFactoryAt(e.getBlock().getRelative(face)); + if (f != null) { + f.getInteractionManager().redStoneEvent(e, + e.getBlock().getRelative(face)); + } + } + } + + /** + * Called when a entity explodes(creeper,tnt etc.) Nearly the same as + * blockBreakEvent + */ + @EventHandler + 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())) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + c.getInteractionManager().blockBreak(null, block); + } + } + } + } + + /** + * Called when a block burns Nearly the same as blockBreakEvent + */ + @EventHandler + public void burnListener(BlockBurnEvent e) { + Block block = e.getBlock(); + if (manager.isPossibleInteractionBlock(block.getType()) + && ((manager.isCitadelEnabled() && !rm.isReinforced(block)) || !manager + .isCitadelEnabled())) { + Factory c = manager.getFactoryAt(block); + if (c != null) { + c.getInteractionManager().blockBreak(null, block); + } + } + } + + @EventHandler + public void playerInteract(PlayerInteractEvent e) { + Block block = e.getClickedBlock(); + 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, bf); + } else { + // check if chest is other half of double chest + 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, + bf); + } + } + } + } + } + if (e.getAction() == Action.LEFT_CLICK_BLOCK) { + if (c == null) { + if (manager.isPossibleCenterBlock(block.getType())) { + if (player.getInventory().getItemInMainHand().getType() == manager + .getFactoryInteractionMaterial()) { + manager.attemptCreation(block, player); + } + } else { + // check if chest is other half of double chest + if (block.getType() == Material.CHEST) { + for (Block b : MultiBlockStructure + .searchForBlockOnAllSides(block, + Material.CHEST)) { + Factory f = manager.getFactoryAt(b); + if (f != null) { + f.getInteractionManager().leftClick(player, + b, bf); + } + } + } + } + } else { + c.getInteractionManager().leftClick(player, block, bf); + } + + } + } + } + + @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 + * 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; + } + + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java b/src/main/java/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java new file mode 100644 index 00000000..178aa11a --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/listeners/NetherPortalListener.java @@ -0,0 +1,38 @@ +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; + +/** + * 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 { + @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/main/java/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java b/src/main/java/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java new file mode 100644 index 00000000..b7d05f09 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/powerManager/FurnacePowerManager.java @@ -0,0 +1,71 @@ +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 vg.civcraft.mc.civmodcore.itemHandling.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 ItemStack fuel; + private int powerCounter; + private int fuelConsumptionIntervall; + private Block furnace; + + public FurnacePowerManager(Block furnace, ItemStack fuel, + int fuelConsumptionIntervall) { + this.fuel = fuel; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + this.furnace = furnace; + } + + public FurnacePowerManager(ItemStack fuel, int fuelConsumptionIntervall) { + this.fuel = fuel; + this.fuelConsumptionIntervall = fuelConsumptionIntervall; + } + + public int getPowerCounter() { + return powerCounter; + } + + public boolean powerAvailable() { + 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()); + return im.getAmount(fuel) != 0; + } + + public int getPowerConsumptionIntervall() { + return fuelConsumptionIntervall; + } + + public void increasePowerCounter(int amount) { + powerCounter += amount; + } + + public void setPowerCounter(int amount) { + powerCounter = amount; + } + + 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/main/java/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java b/src/main/java/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java new file mode 100644 index 00000000..dcf781f9 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/powerManager/IPowerManager.java @@ -0,0 +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/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java new file mode 100644 index 00000000..dcc5ea87 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/AOERepairRecipe.java @@ -0,0 +1,178 @@ +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 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; + +public class AOERepairRecipe extends InputRecipe { + private ItemStack essence; + private int repairPerEssence; + private int range; + + public AOERepairRecipe(String identifier, String name, int productionTime, ItemStack essence, + int range, int repairPerEssence) { + super(identifier, name, productionTime, new ItemMap(essence)); + this.essence = essence; + this.range = range; + this.repairPerEssence = repairPerEssence; + } + + public ItemStack getRecipeRepresentation() { + return essence; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + 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); + ISUtils.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, FurnCraftChestFactory fccf) { + 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) { + 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) { + break; + } + } + List bla = new LinkedList(); + bla.add(is); + return bla; + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + Chest c = (Chest) i.getHolder(); + Location loc = c.getLocation(); + List facs = getNearbyFactoriesSortedByDistance(loc); + 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); + ItemMap remMap = new ItemMap(remStack); + Inventory targetInv = ((InventoryHolder) (fac.getChest() + .getState())).getInventory(); + 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, false); + break; + } + } + } + if (essenceCount <= 0) { + break; + } + } + } + + 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 new file mode 100644 index 00000000..847d4b64 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/CompactingRecipe.java @@ -0,0 +1,197 @@ +package com.github.igotyou.FactoryMod.recipes; + +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; + +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.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 + * 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 { + private List excludedMaterials; + private String compactedLore; + + public CompactingRecipe(String identifier, ItemMap input, List excludedMaterial, + String name, int productionTime, String compactedLore) { + super(identifier, name, productionTime, input); + this.excludedMaterials = excludedMaterial; + this.compactedLore = compactedLore; + } + + 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, im)) { + return true; + } + } + } + return false; + } + + public int getProductionTime() { + return productionTime; + } + + public String getName() { + return name; + } + + 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, + //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, im)) { + if (input.removeSafelyFrom(i)) { + compact(is,i); + } + break; + } + } + } + } + logAfterRecipeRun(i, fccf); + + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List result = new LinkedList(); + if (i == null) { + result.add(new ItemStack(Material.STONE, 64)); + result.addAll(input.getItemStackRepresentation()); + return result; + } + result = createLoredStacksForInfo(i); + ItemMap im = new ItemMap(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is, im)) { + ItemStack compactedStack = is.clone(); + result.add(compactedStack); + break; + } + } + } + return result; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List result = new LinkedList(); + if (i == null) { + ItemStack is = new ItemStack(Material.STONE, 64); + compactStack(is); + result.add(is); + return result; + } + ItemMap im = new ItemMap(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + if (compactable(is, im)) { + ItemStack decompactedStack = is.clone(); + compactStack(decompactedStack); + result.add(decompactedStack); + break; + } + } + } + + return result; + } + + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.CHEST); + ItemMeta im = res.getItemMeta(); + im.setDisplayName(getName()); + res.setItemMeta(im); + return res; + } + + /** + * 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, 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 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, 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.getType().getMaxStackSize() == 1)) { + return false; + } + if (im.getAmount(is) >= getCompactStackSize(is.getType())) { + return true; + } + 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 new file mode 100644 index 00000000..d9189d6d --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DecompactingRecipe.java @@ -0,0 +1,159 @@ +package com.github.igotyou.FactoryMod.recipes; + +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; + +import vg.civcraft.mc.civmodcore.itemHandling.ISUtils; +import vg.civcraft.mc.civmodcore.itemHandling.ItemMap; + +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +/** + * 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; + + public DecompactingRecipe(String identifier, ItemMap input, String name, int productionTime, + String compactedLore) { + super(identifier, name, productionTime, input); + this.compactedLore = compactedLore; + } + + public boolean enoughMaterialAvailable(Inventory i) { + if (!input.isContainedIn(i)) { + return false; + } + for (ItemStack is : i.getContents()) { + if (is != null) { + if (isDecompactable(is)) { + return true; + } + } + } + return false; + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + if (input.isContainedIn(i)) { + for (ItemStack is : i.getContents()) { + if (is != null) { + 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; + } + } + } + } + logAfterRecipeRun(i, fccf); + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List result = new LinkedList(); + if (i == null) { + ItemStack is = new ItemStack(Material.STONE, 64); + ISUtils.addLore(is, compactedLore); + is.setAmount(1); + result.add(is); + return result; + } + result = createLoredStacksForInfo(i); + for (ItemStack is : i.getContents()) { + if (is != null) { + if (isDecompactable(is)) { + 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(getName()); + res.setItemMeta(im); + return res; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List result = new LinkedList(); + if (i == null) { + result.add(new ItemStack(Material.STONE, 64)); + return result; + } + for (ItemStack is : i.getContents()) { + if (is != null) { + 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) { + //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(); + 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); + } + + @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 new file mode 100644 index 00000000..08ea91e7 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/DeterministicEnchantingRecipe.java @@ -0,0 +1,126 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.ChatColor; +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; + +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +public class DeterministicEnchantingRecipe extends InputRecipe { + private Enchantment enchant; + private int level; + private ItemMap tool; + + public DeterministicEnchantingRecipe(String identifier, String name, int productionTime, + ItemMap input, ItemMap tool, Enchantment enchant, int level) { + super(identifier, name, productionTime, input); + this.enchant = enchant; + this.tool = tool; + this.level = level; + } + + 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() + && toolio.getEnchantmentLevel(enchant) == is + .getEnchantmentLevel(enchant)) { + return true; + } + } + } + return false; + } + + public ItemStack getRecipeRepresentation() { + ItemStack is = tool.getItemStackRepresentation().get(0); + ItemMeta im = is.getItemMeta(); + im.removeEnchant(enchant); + im.addEnchant(enchant, level, true); + is.setItemMeta(im); + ISUtils.setName(is, name); + return is; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + ItemStack is = tool.getItemStackRepresentation().get(0); + ItemMeta im = is.getItemMeta(); + im.removeEnchant(enchant); + im.addEnchant(enchant, level, true); + is.setItemMeta(im); + 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, FurnCraftChestFactory fccf) { + if (i == null) { + List bla = input.getItemStackRepresentation(); + bla.add(tool.getItemStackRepresentation().get(0)); + return bla; + } + List returns = createLoredStacksForInfo(i); + ItemStack toSt = tool.getItemStackRepresentation().get(0); + ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); + returns.add(toSt); + return returns; + } + + 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()) { + 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, fccf); + } + + @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..d774fc4a --- /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.FurnCraftChestFactory; + +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, FurnCraftChestFactory fccf) { + } + + @Override + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + return null; + } + + @Override + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + 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 new file mode 100644 index 00000000..09f6044f --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/FactoryMaterialReturnRecipe.java @@ -0,0 +1,109 @@ +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; +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.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 identifier, String name, int productionTime, + ItemMap input, double factor) { + super(identifier, name, productionTime, input); + this.factor = factor; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + 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 + .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, 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 = fccf.getMultiBlockStructure() + .getCenter(); + for (Entry items : FactoryMod + .getManager().getTotalSetupCost(fccf) + .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; + } + + @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 new file mode 100644 index 00000000..43b97530 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/IRecipe.java @@ -0,0 +1,57 @@ +package com.github.igotyou.FactoryMod.recipes; + +import org.bukkit.inventory.Inventory; + +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +/** + * 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 getName(); + + /** + * @return A unique identifier for this recipe + */ + public String getIdentifier(); + + /** + * @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); + + /** + * 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, FurnCraftChestFactory 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/InputRecipe.java b/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java new file mode 100644 index 00000000..aaea6e59 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/InputRecipe.java @@ -0,0 +1,153 @@ +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.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.LoggingUtils; + +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 + * + */ +public abstract class InputRecipe implements IRecipe { + protected String name; + protected int productionTime; + protected ItemMap input; + protected int fuel_consumption_intervall = -1; + protected String identifier; + + public InputRecipe(String identifier, String name, int productionTime, ItemMap input) { + this.name = name; + this.productionTime = productionTime; + this.input = input; + this.identifier = identifier; + } + + /** + * 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 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, 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 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, FurnCraftChestFactory fccf); + + public String getName() { + return name; + } + + public int getFuelConsumptionIntervall() { + return fuel_consumption_intervall; + } + + public void setFuelConsumptionIntervall(int intervall) { + this.fuel_consumption_intervall = intervall; + } + + public int getProductionTime() { + return productionTime; + } + + public ItemMap getInput() { + return input; + } + + 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 + * whole in an item gui + */ + public abstract ItemStack getRecipeRepresentation(); + + /** + * 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); + 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()); + } else { + possibleRuns.addItemAmount(entry.getKey(), 0); + + } + } + + for (ItemStack is : input.getItemStackRepresentation()) { + 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()); + } + + @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 new file mode 100644 index 00000000..d254008a --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/LoreEnchantRecipe.java @@ -0,0 +1,157 @@ +package com.github.igotyou.FactoryMod.recipes; + +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; +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.FurnCraftChestFactory; + +public class LoreEnchantRecipe extends InputRecipe { + + private List appliedLore; + private List overwritenLore; + private ItemMap tool; + + public LoreEnchantRecipe(String identifier, String name, int productionTime, ItemMap input, ItemMap tool, List appliedLore, + List overwritenLore) { + super(identifier, 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, FurnCraftChestFactory fccf) { + 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, FurnCraftChestFactory fccf) { + 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, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + if (input.removeSafelyFrom(i)) { + ItemStack toolio = tool.getItemStackRepresentation().get(0); + for (ItemStack is : i.getContents()) { + 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); + break; + } + } + } + logAfterRecipeRun(i, fccf); + } + + private boolean hasStackRequiredLore(ItemStack is) { + if (is == null) { + return false; + } + if (!is.hasItemMeta() && overwritenLore.size() != 0) { + return false; + } + ItemMeta im = is.getItemMeta(); + 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); + } + + @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 new file mode 100644 index 00000000..cf0b4710 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/ProductionRecipe.java @@ -0,0 +1,152 @@ +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; +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.FurnCraftChestFactory; +import com.github.igotyou.FactoryMod.recipes.scaling.ProductionRecipeModifier; + +/** + * 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; + private ProductionRecipeModifier modifier; + private Random rng; + private DecimalFormat decimalFormatting; + + 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 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) { + if (modifier == null) { + return output.clone(); + } + 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 int getCurrentMultiplier(Inventory i) { + return input.getMultiplesContainedIn(i); + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null || fccf == null) { + 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()); + 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"); + } + return stacks; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public List getGuaranteedOutput(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + ItemMap toRemove = input.clone(); + 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)) { + if (toRemove.removeSafelyFrom(i)) { + for (ItemStack is : toAdd.getItemStackRepresentation()) { + i.addItem(is); + } + } + } + logAfterRecipeRun(i, fccf); + } + + public ItemStack getRecipeRepresentation() { + List out = getOutput().getItemStackRepresentation(); + ItemStack res; + if (out.size() == 0) { + res = new ItemStack(Material.STONE); + } else { + res = out.get(0); + } + 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 new file mode 100644 index 00000000..26d7572b --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/PylonRecipe.java @@ -0,0 +1,142 @@ +package com.github.igotyou.FactoryMod.recipes; + +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; +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.FurnCraftChestFactory; + +public class PylonRecipe extends InputRecipe { + + private ItemMap output; + private static int currentGlobalWeight; + private static int globalLimit; + private int weight; + + public PylonRecipe(String identifier, String name, int productionTime, ItemMap input, + ItemMap output, int weight) { + super(identifier, name, productionTime, input); + this.output = output; + this.weight = weight; + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + if (!input.isContainedIn(i)) { + return; + } + ItemMap actualOutput = getCurrentOutput(); + if (!actualOutput.fitsIn(i)) { + return; + } + if (input.removeSafelyFrom(i)) { + for (ItemStack is : actualOutput.getItemStackRepresentation()) { + i.addItem(is); + } + } + } + + public static void setGlobalLimit(int limit) { + globalLimit = limit; + } + + public static int getGlobalLimit() { + return globalLimit; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + ItemMap currOut = getCurrentOutput(); + List res = new LinkedList(); + for (ItemStack is : currOut.getItemStackRepresentation()) { + ISUtils.setLore(is, ChatColor.GOLD + "Currently there are " + + FurnCraftChestFactory.getPylonFactories() == null ? "0" + : FurnCraftChestFactory.getPylonFactories().size() + + " pylons on the map", ChatColor.RED + + "Current global weight is " + currentGlobalWeight); + res.add(is); + } + return res; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + 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); + } + ISUtils.setName(res, getName()); + 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() { + int weight = 0; + 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 multiplier = 1.0 / overload; + 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; + } + + @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 new file mode 100644 index 00000000..0da2368d --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomEnchantingRecipe.java @@ -0,0 +1,127 @@ +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 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.factories.FurnCraftChestFactory; + +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 identifier, String name, int productionTime, + ItemMap input, Material tool, List enchants) { + super(identifier, 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); + } + ISUtils.setName(is, name); + return is; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + List bla = input.getItemStackRepresentation(); + bla.add(new ItemStack(tool)); + return bla; + } + List returns = createLoredStacksForInfo(i); + ItemStack toSt = new ItemStack(tool); + ISUtils.addLore(toSt, ChatColor.GREEN + "Enough materials for " + + new ItemMap(toSt).getMultiplesContainedIn(i) + " runs"); + returns.add(toSt); + return returns; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + ItemStack is = new ItemStack(tool); + for (RandomEnchant re : enchants) { + is.addEnchantment(re.enchant, re.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"); + } + for (RandomEnchant re : enchants) { + ISUtils.addLore(is, + ChatColor.YELLOW + String.valueOf(re.chance * 100) + + " % chance for " + NiceNames.getName(re.enchant) + + " " + String.valueOf(re.level)); + } + ISUtils.addLore(is, ChatColor.LIGHT_PURPLE + + "At least one guaranteed"); + List stacks = new LinkedList(); + stacks.add(is); + return stacks; + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + 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; + } + } + logAfterRecipeRun(i, fccf); + } + + @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 new file mode 100644 index 00000000..e4d07b55 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RandomOutputRecipe.java @@ -0,0 +1,124 @@ +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.FactoryMod; +import com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory; + +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 identifier, String name, int productionTime, ItemMap input, + Map outputs, ItemMap displayOutput) { + super(identifier, name, productionTime, input); + this.outputs = outputs; + if (rng == null) { + rng = new Random(); + } + 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 (lowestChanceMap == null) { + lowestChanceMap = new ItemMap(new ItemStack(Material.STONE)); + } + } else { + lowestChanceMap = displayOutput; + } + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + ItemMap toRemove = input.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," + fccf.getLogData()); + return; + } + if (toRemove.isContainedIn(i)) { + if (toRemove.removeSafelyFrom(i)) { + for(ItemStack is: toAdd.getItemStackRepresentation()) { + i.addItem(is); + } + } + } + logAfterRecipeRun(i, fccf); + } + + 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, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List items = lowestChanceMap.getItemStackRepresentation(); + for (ItemStack is : items) { + ISUtils.addLore(is, ChatColor.LIGHT_PURPLE + "Randomized output"); + } + return items; + } + + @Override + public String getTypeIdentifier() { + return "RANDOM"; + } + + public ItemMap getDisplayMap() { + return lowestChanceMap; + } + +} 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 new file mode 100644 index 00000000..ea3249be --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/RepairRecipe.java @@ -0,0 +1,76 @@ +package com.github.igotyou.FactoryMod.recipes; + +import java.util.LinkedList; +import java.util.List; + +import org.bukkit.Material; +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.repairManager.PercentageHealthRepairManager; +import com.github.igotyou.FactoryMod.utility.LoggingUtils; + +/** + * 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; + + public RepairRecipe(String identifier, String name, int productionTime, ItemMap input, + int healthPerRun) { + super(identifier, name, productionTime, input); + this.healthPerRun = healthPerRun; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + List result = new LinkedList(); + ItemStack furn = new ItemStack(Material.FURNACE); + ISUtils.setLore(furn, "+" + String.valueOf(healthPerRun) + " health"); + result.add(furn); + return result; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + return createLoredStacksForInfo(i); + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logBeforeRecipeRun(i, fccf); + if (enoughMaterialAvailable(i)) { + if (input.removeSafelyFrom(i)) { + ((PercentageHealthRepairManager) (fccf.getRepairManager())) + .repair(healthPerRun); + LoggingUtils.log(((PercentageHealthRepairManager) (fccf + .getRepairManager())).getHealth() + + " for " + + fccf.getLogData() + " after repairing"); + } + } + logAfterRecipeRun(i, fccf); + } + + public ItemStack getRecipeRepresentation() { + ItemStack res = new ItemStack(Material.FURNACE); + 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 new file mode 100644 index 00000000..f0791fa5 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/recipes/Upgraderecipe.java @@ -0,0 +1,118 @@ +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.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; + +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; + +public class Upgraderecipe extends InputRecipe { + private IFactoryEgg egg; + + public Upgraderecipe(String identifier, String name, int productionTime, ItemMap input, + IFactoryEgg egg) { + super(identifier, name, productionTime, input); + this.egg = egg; + } + + public void applyEffect(Inventory i, FurnCraftChestFactory fccf) { + logAfterRecipeRun(i, fccf); + if (input.isContainedIn(i)) { + if (input.removeSafelyFrom(i)) { + FurnCraftChestEgg e = (FurnCraftChestEgg) egg; + fccf.upgrade(e.getName(), + e.getRecipes(), e.getFuel(), + e.getFuelConsumptionIntervall(), e.getUpdateTime(), e.getMaximumHealth(), + e.getDamagePerDamagingPeriod(), e.getBreakGracePeriod(), e.getCitadelBreakReduction()); + } + } + logAfterRecipeRun(i, fccf); + } + + public ItemStack getRecipeRepresentation() { + 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); + im.addItemFlags(ItemFlag.HIDE_ENCHANTS); + res.setItemMeta(im); + ISUtils.setName(res, name); + return res; + } + + public List getInputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + if (i == null) { + return input.getItemStackRepresentation(); + } + LinkedList result = new LinkedList(); + ItemMap inventoryMap = new ItemMap(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()); + } else { + possibleRuns.addItemAmount(entry.getKey(), 0); + } + } + for (ItemStack is : input.getItemStackRepresentation()) { + if (possibleRuns.getAmount(is) != 0) { + ISUtils.addLore(is, ChatColor.GREEN + + "Enough of this material available to upgrade"); + } else { + ISUtils.addLore(is, ChatColor.RED + + "Not enough of this materials available to upgrade"); + } + result.add(is); + } + return result; + } + + public List getOutputRepresentation(Inventory i, FurnCraftChestFactory fccf) { + 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"); + 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()) { + ISUtils.addLore(fur, ChatColor.YELLOW + rec.getName()); + } + 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.setName(che, egg.getName()); + res.add(che); + return res; + } + + public IFactoryEgg getEgg() { + return egg; + } + + @Override + public String getTypeIdentifier() { + return "UPGRADE"; + } + +} 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/repairManager/IRepairManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java new file mode 100644 index 00000000..9d6d80d9 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/repairManager/IRepairManager.java @@ -0,0 +1,28 @@ +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 health the factory represented currently has as a nice string for output messages + */ + public String getHealth(); + + /** + * @return Whether the factory represented is currently at full health + */ + public boolean atFullHealth(); + + /** + * @return Whether the factory is in disrepair currently + */ + public boolean inDisrepair(); + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java new file mode 100644 index 00000000..19f9bb2f --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/repairManager/NoRepairDestroyOnBreakManager.java @@ -0,0 +1,59 @@ +package com.github.igotyou.FactoryMod.repairManager; + +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; + + 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() { + 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() { + return true; + } + + public boolean inDisrepair() { + return false; + } + + public String getHealth() { + return "full"; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java b/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java new file mode 100644 index 00000000..f4902027 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/repairManager/PercentageHealthRepairManager.java @@ -0,0 +1,116 @@ +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; + private Factory factory; + private long breakTime; + private int maximumHealth; + private int damageAmountPerDecayIntervall; + private long gracePeriod; + + public PercentageHealthRepairManager(int initialHealth, int maximumHealth, long 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 int getMaximumHealth() { + return maximumHealth; + } + + public int getDamageAmountPerDecayIntervall() { + return damageAmountPerDecayIntervall; + } + + public long getGracePeriod() { + return gracePeriod; + } + + public boolean inDisrepair() { + return health <= 0; + } + + public void setFactory(Factory factory) { + this.factory = factory; + } + + public String getHealth() { + return String.valueOf(health / (maximumHealth / 100)) + "." + String.valueOf(health % (maximumHealth / 100)) + + " %"; + } + + public void repair(int amount) { + health = Math.min(health + amount, maximumHealth); + breakTime = 0; + } + + public void breakIt() { + health = 0; + if (breakTime == 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); + } + + } + }); + } + + 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()) { + if (is.getDurability() == -1) + is.setDurability((short) 0); + factory.getMultiBlockStructure().getCenter().getWorld() + .dropItemNaturally(factory.getMultiBlockStructure().getCenter(), is); + } + } + } + + public long getBreakTime() { + return breakTime; + } + + public void setBreakTime(long breakTime) { + this.breakTime = breakTime; + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java new file mode 100644 index 00000000..bfb25dee --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/BlockFurnaceStructure.java @@ -0,0 +1,70 @@ +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 Location center; + private Location furnace; + private boolean complete = false; + + public BlockFurnaceStructure(Block center) { + if (center.getType() == Material.DROPPER) { + this.center = center.getLocation(); + for (Block b : searchForBlockOnAllSides(center, Material.FURNACE)) { + furnace = b.getLocation(); + complete = true; + break; + } + } + } + + public BlockFurnaceStructure(List blocks) { + this.center = blocks.get(0); + this.furnace = blocks.get(1); + } + + public boolean relevantBlocksDestroyed() { + return center.getBlock().getType() != Material.DROPPER + && furnace.getBlock().getType() != Material.FURNACE + && furnace.getBlock().getType() != Material.BURNING_FURNACE; + } + + public Location getCenter() { + return center; + } + + public Block getFurnace() { + return furnace.getBlock(); + } + + 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.getBlock().getType() == Material.DROPPER && (furnace + .getBlock().getType() == Material.FURNACE || furnace.getBlock() + .getType() == Material.BURNING_FURNACE)); + } + + public List getRelevantBlocks() { + List blocks = new LinkedList(); + blocks.add(center.getBlock()); + blocks.add(furnace.getBlock()); + return blocks; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java new file mode 100644 index 00000000..4144a80a --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/FurnCraftChestStructure.java @@ -0,0 +1,146 @@ +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.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 Location craftingTable; + private Location furnace; + private Location chest; + private boolean complete; + + public FurnCraftChestStructure(Block center) { + if (center.getType() == Material.WORKBENCH) { + craftingTable = center.getLocation(); + for (Block b : searchForBlockOnAllSides(center, Material.CHEST)) { + switch (center.getFace(b)) { + case SOUTH: + if (center.getRelative(BlockFace.NORTH).getType() == Material.FURNACE) { + chest = b.getLocation(); + 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; + } + + } + } + if (chest != null && furnace != null) { + complete = true; + } else { + complete = false; + } + } + + public FurnCraftChestStructure(List blocks) { + craftingTable = blocks.get(0); + furnace = blocks.get(1); + chest = blocks.get(2); + } + + 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; + } + + public boolean isComplete() { + return complete; + } + + public Block getCraftingTable() { + return craftingTable.getBlock(); + } + + public Block getFurnace() { + return furnace.getBlock(); + } + + 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(); + } + + public boolean relevantBlocksDestroyed() { + 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() { + 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); + return result; + } + + public Location getCenter() { + return craftingTable; + } + +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java new file mode 100644 index 00000000..0cd1f915 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/MultiBlockStructure.java @@ -0,0 +1,185 @@ +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; +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. + * + */ +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[] northEastWestSouthSides = new BlockFace[] { + BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH }; + + protected static Map dataBlockFaceConversion; + + /** + * 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 : northEastWestSouthSides) { + Block side = b.getRelative(face); + if (side.getType() == m) { + result.add(side); + } + } + 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 + */ + public abstract boolean isComplete(); + + /** + * 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(); + + /** + * 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 + */ + 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(); + for (BlockFace face : allBlockSides) { + blocks.add(b.getRelative(face)); + } + 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; + } + + public boolean blockedByExistingFactory() { + for (Block b : getRelevantBlocks()) { + if (FactoryMod.getManager().factoryExistsAt(b.getLocation())) { + return true; + } + } + 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/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java b/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java new file mode 100644 index 00000000..bb3c9f63 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/structures/PipeStructure.java @@ -0,0 +1,164 @@ +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 dispenser 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 Location start; + private Location furnace; + private Location end; + private int length; + private List glassPipe; + private byte glassColor; + private static Material pipeMaterial = Material.STAINED_GLASS; + private boolean complete; + + public PipeStructure(Block startBlock) { + if (startBlock.getType() != Material.DISPENSER) { + return; + } + this.start = startBlock.getLocation(); + for (Block b : MultiBlockStructure.searchForBlockOnAllSides(startBlock, + Material.FURNACE)) { + furnace = b.getLocation(); + 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; + } + glassColor = currentBlock.getData(); + glassPipe.add(currentBlock.getLocation()); + int length = 1; + while (length <= 512) { + List blocks = MultiBlockStructure + .getAdjacentBlocks(currentBlock); + boolean foundEnd = false; + boolean foundPipeBlock = false; + for (Block b : blocks) { + if (b.getState() instanceof InventoryHolder && !b.getLocation().equals(start)) { + end = b.getLocation(); + this.length = length; + complete = true; + foundEnd = true; + break; + } else if (b.getType() == pipeMaterial + && b.getData() == glassColor + && !b.equals(previousBlock)) { + glassPipe.add(b.getLocation()); + 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 (int i = 2; i < blocks.size()-1;i++) { + glass.add(blocks.get(i)); + } + this.glassPipe = glass; + length = glassPipe.size(); + recheckComplete(); + } + + public Location getCenter() { + return start; + } + + public boolean relevantBlocksDestroyed() { + return start.getBlock().getType() != Material.DISPENSER + && furnace.getBlock().getType() != Material.FURNACE + && furnace.getBlock().getType() != Material.BURNING_FURNACE; + } + + public List getAllBlocks() { + List res = new LinkedList(); + res.add(start); + res.add(furnace); + res.addAll(glassPipe); + res.add(end); + return res; + } + + public List getRelevantBlocks() { + List res = new LinkedList(); + res.add(start.getBlock()); + res.add(furnace.getBlock()); + return res; + } + + public void recheckComplete() { + if (start == null + || furnace == null + || end == null + || 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 (Location loc : glassPipe) { + Block b = loc.getBlock(); + if (b.getType() != pipeMaterial || b.getData() != glassColor) { + complete = false; + return; + } + } + complete = true; + } + + public boolean isComplete() { + return complete; + } + + public byte getGlassColor() { + return glassColor; + } + + public void setGlassColor(byte data) { + this.glassColor = data; + } + + public int getLength() { + return length; + } + + public Block getStart() { + return start.getBlock(); + } + + public Block getEnd() { + return end.getBlock(); + } + + public Block getFurnace() { + return furnace.getBlock(); + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java new file mode 100644 index 00000000..42210ce8 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryGarbageCollector.java @@ -0,0 +1,31 @@ +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 { + + public void run() { + 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) { + //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() - rm.getDamageAmountPerDecayIntervall()); + if (rm.getRawHealth() <= 0) { + rm.breakIt(); + } + } + } + } + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java new file mode 100644 index 00000000..c53619c9 --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java @@ -0,0 +1,358 @@ +package com.github.igotyou.FactoryMod.utility; + +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; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +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; + +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; +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; + +public class FileHandler { + private FactoryMod plugin; + private FactoryModManager manager; + private File saveFile; + private File backup; + + private Map factoryRenames; + + private static int saveFileVersion = 2; + + 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"); + backup = new File(plugin.getDataFolder().getAbsolutePath() + + File.separator + "factoryDataPreviousSave.yml"); + } + + 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(); + 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()); + 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"); + 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().getName()); + config.set(current + ".autoSelect", fccf.isAutoSelect()); + 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"); + } + else { + config.set(current + ".activator", fccf.getActivator().toString()); + } + 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; + 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()); + } + } + } + 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 + plugin.severe("Fatal error while trying to save factory data"); + e.printStackTrace(); + saveFile.delete(); + } + } + + 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) { + return loc.getWorld().getName() + "#" + loc.getBlockX() + "#" + + loc.getBlockY() + "#" + loc.getBlockZ(); + } + + 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) { + 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(); + 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"); + 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)); + } + 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); + 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"); + 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(); + } + FurnCraftChestFactory fac = (FurnCraftChestFactory) egg.revive(blocks, health, selectedRecipe, + runtime, breakTime, recipes); + 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)) { + int runs = runCounts.getInt(countKey); + for(IRecipe r : fac.getRecipes()) { + if (r.getName().equals(countKey)) { + fac.setRunCount(r, runs); + break; + } + } + } + } + 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; + } + } + } + } + fac.setAutoSelect(autoSelect); + manager.addFactory(fac); + counter++; + 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")) { + mats.add(Material.valueOf(mat)); + } + } else { + mats = null; + } + if (mats.size() == 0) { + 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); + 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 + .getConfigurationSection("faces").get(face); + // it works, okay? + ItemMap map = new ItemMap(stacks); + assignments.put(BlockFace.valueOf(face), map); + } + Factory s = sorterEgg.revive(blocks, assignments, runtime); + manager.addFactory(s); + counter++; + break; + } + } + plugin.info("Loaded " + counter + " factory from save file"); + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/LoggingUtils.java b/src/main/java/com/github/igotyou/FactoryMod/utility/LoggingUtils.java new file mode 100644 index 00000000..4170283a --- /dev/null +++ b/src/main/java/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.INFO, 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)); + } + } +} diff --git a/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java new file mode 100644 index 00000000..35ec081b --- /dev/null +++ b/src/main/java/com/github/igotyou/FactoryMod/utility/MenuBuilder.java @@ -0,0 +1,586 @@ +package com.github.igotyou.FactoryMod.utility; + +import java.util.HashMap; +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; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; +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 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; +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.ProductionRecipe; +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 viewed = new HashMap(); + // child is key, parent is value + private Map parentFactories = new HashMap(); + private DecorationStack input; + private IFactoryEgg defaultMenu; + + public MenuBuilder(String defaultFactory) { + 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(((Upgraderecipe) rec).getEgg() + .getName(), egg.getName()); + } + } + } + } + ItemStack inp = new ItemStack(Material.PAPER); + 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); + ISUtils.setName(outp, "Output"); + ISUtils.setLore(outp, ChatColor.LIGHT_PURPLE + + "The output of this recipe"); + if (defaultFactory != null) { + defaultMenu = manager.getEgg(defaultFactory); + } + } + + public void openFactoryBrowser(Player p, String 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 + for (Entry entry : manager.getAllEggs() + .entrySet()) { + if (entry.getKey().toLowerCase().equals(comp)) { + egg = entry.getValue(); + break; + } + } + 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; + } + } + if (egg instanceof FurnCraftChestEgg) { + FurnCraftChestEgg furnegg = (FurnCraftChestEgg) egg; + factoryViewed.put(p.getUniqueId(), furnegg.getName()); + ClickableInventory browser = new ClickableInventory( + InventoryType.CHEST, furnegg.getName()); + // creation option + ItemStack creationStack = new ItemStack(Material.CHEST); + 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) { + @Override + public void clicked(Player arg0) { + openSetupBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + browser.setSlot(creationClickable, 10); + + // recipe option + ItemStack recipeStack = new ItemStack(Material.WORKBENCH); + 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) { + @Override + public void clicked(Player arg0) { + openRecipeBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + browser.setSlot(recipeClickable, 13); + + // 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"); + Clickable upgradeClickable = new Clickable(upgradeStack) { + @Override + public void clicked(Player arg0) { + openUpgradeBrowser(arg0, + factoryViewed.get(arg0.getUniqueId())); + } + }; + browser.setSlot(upgradeClickable, 16); + browser.showInventory(p); + } + } + + private void openRecipeBrowser(Player p, String facName) { + 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++) { + if (recipes.get(i) == null) { + continue; + } + InputRecipe rec = ((InputRecipe) recipes.get(i)); + ItemStack is = rec.getRecipeRepresentation(); + Clickable c = new Clickable(is) { + @Override + public void clicked(Player arg0) { + openDetailedRecipeBrowser(arg0, + ISUtils.getName(this.getItemStack())); + } + }; + 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"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + recipeInventory.setSlot(backClickable, size - 5); + recipeInventory.showInventory(p); + } + + 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, "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 crafting table with a stick"); + DecorationStack furnDec = new DecorationStack(fur); + DecorationStack chestDec = new DecorationStack(che); + DecorationStack craStack = new DecorationStack(cr); + ci.setSlot(furnDec, 3); + ci.setSlot(craStack, 4); + ci.setSlot(chestDec, 5); + ItemMap im = manager.getSetupCost(FurnCraftChestStructure.class, + egg.getName()); + int slot = 31; + for (ItemStack is : im.getItemStackRepresentation()) { + DecorationStack dec = new DecorationStack(is); + ci.setSlot(dec, slot); + if ((slot % 9) == 4) { + slot++; + continue; + } + if ((slot % 9) > 4) { + slot -= (((slot % 9) - 4) * 2); + } else { + if ((slot % 9) == 0) { + slot += 13; + } else { + slot += (((4 - (slot % 9)) * 2) + 1); + } + } + } + } else { + Upgraderecipe rec = null; + for (IRecipe reci : parEgg.getRecipes()) { + if (reci instanceof Upgraderecipe + && ((Upgraderecipe) reci).getEgg().equals(egg)) { + rec = (Upgraderecipe) reci; + } + } + + ISUtils.setLore(cr, ChatColor.LIGHT_PURPLE + "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, 4); + 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) { + openFactoryBrowser(arg0, parentFactories.get(factoryViewed + .get(arg0.getUniqueId()))); + } + }; + ci.setSlot(furCli, 3); + Clickable cheCli = new Clickable(che) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, parentFactories.get(factoryViewed + .get(arg0.getUniqueId()))); + } + }; + ci.setSlot(cheCli, 5); + int slot = 31; + 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) { + slot++; + continue; + } + if ((slot % 9) > 4) { + slot -= (((slot % 9) - 4) * 2); + } else { + if ((slot % 9) == 0) { + slot += 13; + } else { + slot += (((4 - (slot % 9)) * 2) + 1); + } + } + } + } + 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"); + Clickable backClickable = new Clickable(backStack) { + @Override + public void clicked(Player arg0) { + openFactoryBrowser(arg0, factoryViewed.get(arg0.getUniqueId())); + } + }; + ci.setSlot(backClickable, 18); + ci.showInventory(p); + } + + private void openUpgradeBrowser(Player p, String facName) { + FurnCraftChestEgg egg = (FurnCraftChestEgg) manager + .getEgg(factoryViewed.get(p.getUniqueId())); + 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"); + Clickable noUpgrades = new Clickable(bar) { + @Override + public void clicked(Player p) { + openFactoryBrowser(p, factoryViewed.get(p.getUniqueId())); + } + }; + ci.setSlot(noUpgrades, 4); + } else { + for (IRecipe recipe : upgrades) { + ItemStack recStack = ((InputRecipe) recipe) + .getRecipeRepresentation(); + 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, + ISUtils.getName(this.getItemStack())); + } + }; + ci.addSlot(c); + } + } + ItemStack backStack = new ItemStack(Material.ARROW); + ISUtils.setName(backStack, "Back to factory overview"); + ISUtils.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); + ci.showInventory(p); + } + + private void openDetailedRecipeBrowser(Player p, String recipeName) { + 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 == null || recipe.getName() == null) { + FactoryMod.getPlugin().warning( + "Null recipe or recipe name registered with " + + egg.getName()); + continue; + } + if (recipeName.equals(recipe.getName())) { + 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"); + ISUtils.addLore(inputStack, ChatColor.LIGHT_PURPLE + + "The materials required to run this recipe"); + DecorationStack inputClickable = new DecorationStack(inputStack); + ci.setSlot(inputClickable, 4); + int index = 13; + List ins = rec.getInputRepresentation(null, 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 + 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); + } + } + + } + + ItemStack outputStack = new ItemStack(Material.PAPER); + ISUtils.setName(outputStack, "Output/effect"); + 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"); + 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; + List out = rec.getOutputRepresentation(null, null); + if (out.size() > 18) { + out = new ItemMap(out).getLoredItemCountRepresentation(); + } + for (ItemStack is : out) { + 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(ISUtils.getName(this + .getItemStack()))) { + openFactoryBrowser(arg0, ((Upgraderecipe) re) + .getEgg().getName()); + break; + } + } + } + }; + } else { + 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 += 13; + } else { + index += (((4 - (index % 9)) * 2) + 1); + } + } + } + int fuelInterval = rec.getFuelConsumptionIntervall() != -1? rec.getFuelConsumptionIntervall() : egg.getFuelConsumptionIntervall(); + int fuelConsumed = rec.getProductionTime()/fuelInterval; + ItemStack fuels = egg.getFuel().clone(); + fuels.setAmount(fuelConsumed); + 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); + ci.showInventory(p); + } + + public void showPipeMaterials(Player p, Pipe pipe) { + viewed.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) { + ((Pipe) viewed.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); + ISUtils.setName(nextPage, "Next page"); + ISUtils.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, + (Pipe) viewed.get(arg0.getUniqueId()), + Integer.valueOf(this.getItemStack().getItemMeta() + .getLore().get(0).split(" ")[7])); + } + }; + ci.setSlot(nextClick, 49); + } + ci.showInventory(p); + } + + 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()) { + 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/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 00000000..9e303809 --- /dev/null +++ b/src/main/resources/config.yml @@ -0,0 +1,746 @@ +#FactoryMod configuration file + +#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. + + +#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 + +#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 + +#This section allows you to define global default values and some general stuff. + +#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 + +#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: + +#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 + + +#When FCCs are in disrepair they will be removed after a set amount of time, which can be specified here +default_break_grace_period: 7d + + +#How often factories are passively decayed +decay_intervall: 1h + +#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 + +#How often factory data is saved automatically. Recommended value and default is 15 minutes. Set to -1 to disable +saving_intervall: 15m + + +#---------------------------------------------------------------------------------------------------------------------- +#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 +# health: 20000 +# grace_period: 14d +# decay_amount: 40 +# 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 + +#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. + +#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 +# maximum_length: 32 + +#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 + +#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 + +#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) + +factories: + +#----------------------------------------------------------------------------------------------------------------------------- + +#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. 10000 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 +# production_time: 1d +# 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. + + +#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 +# production_time: 10s +# 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 + + +#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 + +#Optionally use "display:" to pick which output to show in the GUI; otherwise the least-likely option +# will be shown. + +#Example: + +#random: +# type: RANDOM +# production_time: 2s +# name: Stone or Dirt +# input: +# diamond: +# material: DIAMOND +# outputs: +# display: second +# 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 + + +#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: + + + +#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 + +#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. 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: + + #Called when someone attempts to interact with any type of factory, but doesnt have the correct permissions + FactoryNoPermission: + + + + diff --git a/src/main/resources/configCivcraft.yml b/src/main/resources/configCivcraft.yml new file mode 100644 index 00000000..0f7c2794 --- /dev/null +++ b/src/main/resources/configCivcraft.yml @@ -0,0 +1,11843 @@ +default_update_time: 1s +default_fuel: + charcoal: + material: COAL + durability: 1 +default_fuel_consumption_intervall: 2s +default_menu_factory: Basic Contraption +default_return_rate: 0.5 +default_break_grace_period: 10d +decay_intervall: 1h +default_decay_amount: 21 +default_health: 10000 +use_recipe_yamlidentifiers: true +global_pylon_limit: 100 + + +factories: + + #Base factory from which all others upgrade + basiccontraption: + type: FCC + name: Basic Contraption + citadelBreakReduction: 0.4 + setupcost: + planks: + material: WOOD + durability: -1 + amount: 1024 + stone: + material: STONE + amount: 256 + bread: + material: BREAD + amount: 32 + recipes: + - Smelt_Stone_Basic + - 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 + - Upgrade_to_Stone_Smelter + - Upgrade_to_Farmstead_Factory + - Upgrade_to_Blacksmith + - Upgrade_to_Laboratory + - Upgrade_to_Wood_Processor + - Upgrade_to_Wood_Processor_2 + - Upgrade_to_Basic_Forge + - Upgrade_to_Basic_Fortification + - Upgrade_to_Printing_Press + + #Reinforcement factories + #Basic Contraption --> Basic Fortification + basicFortification: + type: FCCUPGRADE + name: Basic Fortifications + citadelBreakReduction: 0.2 + 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 + - Repair_Basic_Factory + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification + intermediateFortification: + type: FCCUPGRADE + citadelBreakReduction: 0.05 + 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_strong_Hunter_Component2 + - Produce_strong_Miner_Component2 + - Produce_good_reinforcement + - Produce_Bracers + - Upgrade_to_Advanced_Fortification + - Repair_Advanced_Factory + + #Basic Contraption --> Basic Fortification --> Intermediate Fortification --> Advanced Fortification + advancedFortification: + type: FCCUPGRADE + name: Advanced Fortifications + citadelBreakReduction: 0.025 + 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_strong_Hunter_Component2 + - Produce_strong_Miner_Component2 + - Produce_good_reinforcement + - Produce_Bracers + - Produce_best_reinforcement + - Produce_good_instant_reinforcement + - Repair_Expert_Factory + + #Smelting + stonesmelter: + #Basic Contraption --> Stone Smelter + type: FCCUPGRADE + name: Stone Smelter + citadelBreakReduction: 0.4 + recipes: + - 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 + - Upgrade_to_Kiln + + #Ore smelting + oresmelter: + #Basic Contraption --> Stone Smelter --> Ore Smelter + type: FCCUPGRADE + name: Ore Smelter + citadelBreakReduction: 0.1 + recipes: + - Smelt_Coal_Ore_Advanced + - Smelt_Iron_Ore_Basic + - Extract_Redstone_Basic + - Extract_Quartz_Basic + - Repair_Factory + - Upgrade_to_Ore_Forge + - Upgrade_to_Gem_Extractor + - Break_Fossil_Basic + oresmelter2: + #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 + - Smelt_Gold_Ore + - Craft_Cave_Concentrate + - Break_Fossil_Advanced + - Repair_Advanced_Factory + gemextractor: + #Basic Contraption --> Stone Smelter --> Ore Smelter --> Gem Extractor + type: FCCUPGRADE + name: Gem Extractor + citadelBreakReduction: 0.05 + recipes: + - Extract_Diamonds + - Extract_Emeralds + - Extract_Quartz_Advanced + - Extract_Redstone_Advanced + - Extract_Lapis + - Break_Fossil_Advanced + - Repair_Advanced_Factory + + #Sand smelting + sandsmelter: + #Basic Contraption --> Stone Smelter --> Sand Smelter + type: FCCUPGRADE + name: Sand Smelter + citadelBreakReduction: 0.2 + recipes: + - Smelt_Glass_Advanced + - Smelt_Glass_Panes_Basic + - Smelt_Sandstone_Basic + - Smelt_Red_Sandstone_Basic + - Convert_Normal_Sand_to_Red_Sand + - Repair_Basic_Factory + - 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 + citadelBreakReduction: 0.1 + 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 + - Concentrate_Rainbow + - Repair_Factory + advancedsandsmelter: + #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 + - Blow_Glassbottles + - Upgrade_to_Crystallization_Factory + - Repair_Factory + sandstonesmelter: + #Basic Contraption --> Stone Smelter --> Sand Smelter --> Sandstone Smelter + type: FCCUPGRADE + name: Sandstone Smelter + citadelBreakReduction: 0.1 + 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 + - Sieve_Desert_Concentrate + - Repair_Factory + + #Brick smelting + bricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter + type: FCCUPGRADE + name: Brick Smelter + citadelBreakReduction: 0.2 + recipes: + - Smelt_Stone_Advanced + - Craft_Stonebricks_Basic + - Craft_Prismarine_Basic + - Craft_Netherbrick_Basic + - Repair_Basic_Factory + - Upgrade_to_Stonebrick_Smelter + - 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 + name: Fancy Stone Smelter + citadelBreakReduction: 0.1 + recipes: + - Smelt_Stone_Expert + - Craft_Polished_Andesite + - Craft_Polished_Diorite + - Craft_Polished_Granite + - Repair_Factory + stonebricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Stonebrick Smelter + type: FCCUPGRADE + name: Stonebrick Smelter + citadelBreakReduction: 0.1 + recipes: + - Craft_Stonebricks_Advanced + - Craft_Stonebrick_Stairs + - Craft_Stonebrick_Slabs + - Craft_Chiselled_Stonebrick + - Craft_Cracked_Stonebrick + - Craft_Mossy_Stonebrick + - Repair_Factory + netherbricksmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Netherbrick Smelter + type: FCCUPGRADE + name: Netherbrick Smelter + citadelBreakReduction: 0.1 + recipes: + - Smelt_Netherbrick_Advanced + - Craft_Netherbrick_Fence + - Craft_Netherbrick_Slabs + - Craft_Netherbrick_Stairs + - Craft_Hell_Concentrate + - Repair_Factory + aquaticstonesmelter: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Aquatic Brick Smelter + type: FCCUPGRADE + name: Aquatic Brick Smelter + citadelBreakReduction: 0.1 + recipes: + - Smelt_Prismarine + - Smelt_Dark_Prismarine + - Smelt_Prismarine_Bricks + - Craft_Sea_Lanterns + - Craft_Concentrate_Of_Ocean + - Repair_Factory + quartzfactory: + #Basic Contraption --> Stone Smelter --> Brick Smelter --> Quartz Factory + type: FCCUPGRADE + name: Quartz Factory + citadelBreakReduction: 0.1 + recipes: + - Craft_Quartz_Slabs + - Craft_Quartz_Blocks + - Craft_Chiselled_Quartz_Blocks + - Craft_Pillar_Quartz_Blocks + - Craft_Quartz_Stairs + - Repair_Factory + + #Clay Smelting + kiln: + #Basic Contraption --> Stone Smelter --> Kiln + type: FCCUPGRADE + name: Kiln + citadelBreakReduction: 0.1 + recipes: + - Smelt_Clay_Bricks + - Harden_Clay_Basic + - Craft_Flowerpots + - Repair_Factory + + #Wood processing + woodprocessor: + type: FCCUPGRADE + name: Wood Processor + citadelBreakReduction: 0.4 + recipes: + - Burn_Charcoal_from_Logs_Advanced + - Burn_Charcoal_from_Logs2_Advanced + - Craft_Oak_Fence + - Cut_any_type_of_Plank_Advanced + - Repair_Rudimentary_Factory + - Upgrade_to_Carpentry + - Upgrade_to_Fine_Woodworking + - Upgrade_to_Coal_Burner + carpentry: + type: FCCUPGRADE + name: Carpentry + citadelBreakReduction: 0.2 + 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 + - Cut_any_type_of_Plank_Expert + - Repair_Basic_Factory + - Create_Crate + finewoodworking: + type: FCCUPGRADE + name: Fine Woodworking + citadelBreakReduction: 0.2 + recipes: + - Craft_any_type_of_fence + - Craft_any_type_of_fence_gate + - Craft_ladder + - Craft_trap_door + - Repair_Basic_Factory + coalburner: + type: FCCUPGRADE + name: Coal Burner + citadelBreakReduction: 0.2 + recipes: + - Burn_Charcoal_from_Logs_Expert + - Burn_Charcoal_from_Logs2_Expert + - Burn_Charcoal_from_Coal + - Repair_Basic_Factory + farmsteadfactory: + type: FCCUPGRADE + name: Farmstead Factory + citadelBreakReduction: 0.4 + recipes: + - Bake_Bread_Advanced + - Grill_Steak_Basic + - Create_Poppy_Basic + - Repair_Rudimentary_Factory + - Upgrade_to_Bakery + - Upgrade_to_Grill + - 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 + name: Bakery + citadelBreakReduction: 0.1 + recipes: + - Bake_Potatoes + - Bake_Bread_Expert + - Bake_Cookies + - Bake_Cake + - Bake_Pumpkin_Pie + - Bake_Food_Concentrate + - Repair_Factory + grill: + type: FCCUPGRADE + name: Grill + citadelBreakReduction: 0.1 + recipes: + - Grill_Steak_Advanced + - Grill_Pork + - Fry_Chicken + - Cook_Salmon + - Cook_Fish + - Cook_Mutton + - Cook_Rabbit + - Repair_Factory + stewmaker: + type: FCCUPGRADE + name: Soup kitchen + citadelBreakReduction: 0.1 + recipes: + - Make_Rabbit_Stew + - Make_Mushroom_Stew + - Make_Beetroot_Soup + - Brew_Soup_Concentrate + - Repair_Factory + animalhusbandryfactorybasic: + type: FCCUPGRADE + name: Animal Husbandry Factory + citadelBreakReduction: 0.1 + recipes: + - Craft_Saddles_Basic + - Create_Nametags + - Create_Leads + - Repair_Factory + woolprocessor: + type: FCCUPGRADE + name: Wool Processing + citadelBreakReduction: 0.2 + 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_Basic_Factory + biolab: + type: FCCUPGRADE + name: Bio Lab + citadelBreakReduction: 0.2 + recipes: + - Create_Poppy_Advanced + - Mutate_Tall_Grass_Basic + - Take_friendly_mob_egg_apart_Basic + - Create_Podzol_Basic + - Repair_Basic_Factory + - Upgrade_to_Grass_Gardening + - Upgrade_to_Flower_Gardening + - Upgrade_to_Tree_Mutator + - Upgrade_to_Organic_Block_Factory + grassgardening: + type: FCCUPGRADE + name: Grass Gardening + citadelBreakReduction: 0.1 + recipes: + - Mutate_Tall_Grass_Advanced + - Mutate_Large_Fern + - Kill_Dead_Bush + - Grow_Grass + - Grow_Fern + - Grow_Vine + - Kill_Dead_Shrub + - Repair_Basic_Factory + 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 + - Grow_Concentrate_Of_Nature + - Repair_Basic_Factory + organicblockfactory: + type: FCCUPGRADE + name: Organic Block Factory + citadelBreakReduction: 0.1 + recipes: + - Create_Podzol_Advanced + - Create_Coarse_Dirt + - Create_Mycelium + - Repair_Basic_Factory + blacksmith: + type: FCCUPGRADE + name: Blacksmith + citadelBreakReduction: 0.4 + recipes: + - Forge_Stone_Sword + - Forge_Stone_Pickaxe + - Forge_Stone_Shovel + - Forge_Stone_Hoe + - Forge_Stone_Axe + - Repair_Rudimentary_Factory + - Upgrade_to_Iron_Forge_Basic + - Upgrade_to_Iron_Equipment_Forge + ironforgebasic: + type: FCCUPGRADE + name: Iron Forge + citadelBreakReduction: 0.1 + recipes: + - Craft_Rail_Basic + - Craft_Buckets_Basic + - Craft_Anvils_Basic + - Repair_Factory + - Upgrade_to_Iron_Forge_Advanced + - Upgrade_to_Rail_Factory + ironforgeadvanced: + type: FCCUPGRADE + name: Steel Forge + citadelBreakReduction: 0.05 + recipes: + - Craft_Shears + - Craft_Anvils_Advanced + - Craft_Buckets_Advanced + - Craft_Iron_Bars + - Craft_Iron_Door + - Craft_Flint_and_Steel + - Repair_Advanced_Factory + railfactory: + type: FCCUPGRADE + name: Rail Factory + citadelBreakReduction: 0.05 + recipes: + - Create_Rail_Advanced + - Create_Powered_Rail + - Create_Detector_Rail + - Create_Activator_Rail + - Repair_Advanced_Factory + ironequipmentforge: + type: FCCUPGRADE + name: Iron Equipment Forge + citadelBreakReduction: 0.1 + 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 + - Repair_Factory + - Upgrade_to_Gold_Equipment_Forge + - Upgrade_to_Diamond_Equipment_Forge + goldequipmentforge: + type: FCCUPGRADE + name: Gold Equipment Forge + citadelBreakReduction: 0.1 + recipes: + - 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 + diamondequipmentforge: + type: FCCUPGRADE + name: Diamond Equipment Forge + citadelBreakReduction: 0.05 + recipes: + - 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 + goldarmourforge: + type: FCCUPGRADE + name: Gold Armour Forge + citadelBreakReduction: 0.1 + recipes: + - Forge_Gold_Helmet + - Forge_Gold_Boots + - Forge_Gold_Breastplate + - Forge_Gold_Leggings + - Forge_Gold_Horse_Armour + - Repair_Factory + goldtoolsforge: + type: FCCUPGRADE + name: Gold Tools Forge + citadelBreakReduction: 0.1 + recipes: + - Forge_Gold_Pickaxe + - Forge_Gold_Shovel + - Forge_Gold_Axe + - Forge_Gold_Hoe + - Forge_Gold_Sword + - Repair_Factory + diamondarmourforge: + type: FCCUPGRADE + name: Diamond Armour Forge + citadelBreakReduction: 0.025 + recipes: + - Forge_Diamond_Helmet + - Forge_Diamond_Boots + - Forge_Diamond_Breastplate + - Forge_Diamond_Leggings + - Forge_Diamond_Horse_Armour + - Repair_Expert_Factory + diamondtoolsforge: + type: FCCUPGRADE + name: Diamond Tools Forge + citadelBreakReduction: 0.025 + recipes: + - Forge_Diamond_Pickaxe + - Forge_Diamond_Shovel + - Forge_Diamond_Axe + - Forge_Diamond_Hoe + - Forge_Diamond_Sword + - Repair_Expert_Factory + laboratory: + type: FCCUPGRADE + name: Laboratory + citadelBreakReduction: 0.4 + recipes: + - Craft_Redstone_Repeater_Basic + - Craft_Dispenser_Basic + - Repair_Rudimentary_Factory + - Upgrade_to_Bastion_Factory + - Upgrade_to_Compactor_Basic + - Upgrade_to_Basic_Pylon + - Upgrade_to_Redstone_Factory_Basic + 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: + - Bind_Books + - Bind_Writable_Books + - Repair_Factory + compactorbasic: + type: FCCUPGRADE + name: Compactor Basic + citadelBreakReduction: 0.2 + recipes: + - Compact_Stack_Basic + - De-compact_Stack_Basic + - Repair_Basic_Factory + - Upgrade_to_Dedicated_Compactor + - Upgrade_to_Dedicated_De-Compactor + dedicatedcompactor: + type: FCCUPGRADE + name: Dedicated Compactor + citadelBreakReduction: 0.1 + updatetime: 5t + recipes: + - Compact_Stack_Advanced + - Repair_Basic_Factory + 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 + - Craft_Noteblocks_Basic + - Craft_Dispenser_Basic + - Repair_Factory + - Upgrade_to_Redstone_Circularity_Factory + - Upgrade_to_Redstone_Mechanics_Factory + redstonecircularityfactory: + type: FCCUPGRADE + name: Redstone Electronics + citadelBreakReduction: 0.05 + recipes: + - Craft_Redstone_Repeater_Advanced + - Craft_Redstone_Torch_Advanced + - Craft_Redstone_Comparator + - Craft_Daylight_Sensor + - Craft_End_Concentrate + - Create_Pylon_Locator + - Repair_Advanced_Factory + redstonemechanicsfactory: + type: FCCUPGRADE + name: Redstone Mechanics + citadelBreakReduction: 0.05 + recipes: + - Craft_Piston + - Craft_Sticky_Piston + - Craft_Noteblocks_Advanced + - Craft_Jukeboxes + - Craft_Dispenser_Advanced + - Craft_Droppers + - Craft_Redstone_Lamps + - Repair_Advanced_Factory + basicpylon: + type: FCCUPGRADE + name: Basic Pylon + citadelBreakReduction: 0.1 + recipes: + - Pylon_Basic + - Upgrade_to_Advanced_Pylon + - Repair_Basic_Pylon + advancedPylon: + type: FCCUPGRADE + name: Advanced Pylon + citadelBreakReduction: 0.05 + recipes: + - Pylon_Advanced + - Upgrade_to_Expert_Pylon + - Repair_Advanced_Pylon + 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 + - Repair_Factory +## Enchanting + basicforge: + type: FCCUPGRADE + name: Basic Forge + citadelBreakReduction: 0.1 + 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 + - Repair_Factory +#Fire + emberforge: + type: FCCUPGRADE + name: Ember Forge + citadelBreakReduction: 0.1 + recipes: + - Enchant_Helmet_FireP_I + - Enchant_Helmet_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 + - Repair_Factory + magmaforge: + type: FCCUPGRADE + name: Magma Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_Helmet_FireP_I + - Enchant_Helmet_FireP_II + - Enchant_Helmet_FireP_III + - Enchant_Helmet_FireP_IV + - Enchant_Helmet_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 + - Repair_Advanced_Factory +#Water + riverforge: + type: FCCUPGRADE + name: River Forge + citadelBreakReduction: 0.1 + recipes: + - Enchant_DepthStrider_I + - Enchant_Respiration_I + - Enchant_Respiration_II + - Enchant_Frost_Walker_I + - Upgrade_to_Ocean_Forge + - Repair_Factory + oceanforge: + type: FCCUPGRADE + name: Ocean Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_DepthStrider_I + - Enchant_DepthStrider_II + - Enchant_DepthStrider_III + - Enchant_AquaAffinity_I + - Enchant_Respiration_I + - Enchant_Respiration_II + - Enchant_Respiration_III + - Enchant_Frost_Walker_I + - Enchant_Frost_Walker_II + - Repair_Advanced_Factory +#Magic + magicforge: + type: FCCUPGRADE + name: Magic Forge + citadelBreakReduction: 0.1 + recipes: + - Enchant_FeatherFalling_I + - Enchant_FeatherFalling_II + - Enchant_BOA_I + - Enchant_BOA_II + - Enchant_BOA_III + - Upgrade_to_Arcane_Forge + - Repair_Factory + arcaneforge: + type: FCCUPGRADE + name: Arcane Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_Infinity_I + - Enchant_Pickaxe_SilkTouch_I + - Enchant_Axe_SilkTouch_I + - Enchant_Shovel_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 + - Repair_Advanced_Factory +#Armor + mithrilforge: + type: FCCUPGRADE + name: Mithril Forge + citadelBreakReduction: 0.1 + 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 + - Repair_Factory + titaniumforge: + type: FCCUPGRADE + name: Titanium Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_Helmet_Protection_I + - Enchant_Helmet_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_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_Thorns_I + - Enchant_Thorns_II + - Upgrade_to_Meteor_Forge + - Repair_Advanced_Factory + Meteorforge: + type: FCCUPGRADE + name: Meteor Forge + citadelBreakReduction: 0.025 + 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_I + - Enchant_Boots_BlastProtection_II + - Enchant_Boots_BlastProtection_III + - Enchant_Boots_BlastProtection_IV + - Enchant_Thorns_I + - Enchant_Thorns_II + - Enchant_Thorns_III + - Repair_Expert_Factory +#Archery + archerforge: + type: FCCUPGRADE + name: Archer Forge + citadelBreakReduction: 0.1 + 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 + - Repair_Factory + marksmanforge: + type: FCCUPGRADE + name: Marksman Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_Power_I + - Enchant_Power_II + - Enchant_Power_III + - Enchant_Power_IV + - Enchant_Helmet_ProjectileProtection_I + - Enchant_Helmet_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_Punch_I + - Upgrade_to_Sniper_Forge + - Repair_Advanced_Factory + sniperforge: + type: FCCUPGRADE + name: Sniper Forge + citadelBreakReduction: 0.025 + 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_I + - Enchant_Boots_ProjectileProtection_II + - Enchant_Boots_ProjectileProtection_III + - Enchant_Boots_ProjectileProtection_IV + - Enchant_Punch_I + - Enchant_Punch_II + - Repair_Expert_Factory +#Swords + daggerforge: + type: FCCUPGRADE + name: Dagger Forge + citadelBreakReduction: 0.1 + recipes: + - Enchant_Sharpness_I + - Enchant_Sharpness_II + - Enchant_Smite_I + - Enchant_Smite_II + - Upgrade_to_Sword_Forge + - Repair_Factory + swordforge: + type: FCCUPGRADE + name: Sword Forge + citadelBreakReduction: 0.05 + 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 + - Upgrade_to_Blade_Forge + - Repair_Advanced_Factory + bladeforge: + type: FCCUPGRADE + name: Blade Forge + citadelBreakReduction: 0.025 + 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 + - Repair_Expert_Factory +#Efficiency + quickforge: + type: FCCUPGRADE + name: Quick Forge + citadelBreakReduction: 0.1 + recipes: + - Enchant_Pickaxe_Efficiency_I + - Enchant_Pickaxe_Efficiency_II + - Enchant_Axe_Efficiency_I + - Enchant_Axe_Efficiency_II + - Enchant_Shovel_Efficiency_I + - Enchant_Shovel_Efficiency_II + - Enchant_Leaf_Burner_I + - Upgrade_to_Rapid_Forge + - Repair_Factory + rapidforge: + type: FCCUPGRADE + name: Rapid Forge + citadelBreakReduction: 0.05 + recipes: + - Enchant_Pickaxe_Efficiency_I + - Enchant_Pickaxe_Efficiency_II + - Enchant_Pickaxe_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 + - Enchant_Leaf_Burner_I + - Enchant_Leaf_Burner_II + - Upgrade_to_Sonic_Forge + - Repair_Advanced_Factory + sonicforge: + type: FCCUPGRADE + name: Sonic Forge + citadelBreakReduction: 0.025 + 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 + - Enchant_Leaf_Burner_I + - Enchant_Leaf_Burner_II + - Repair_Expert_Factory +#Unbreaking + rockforge: + type: FCCUPGRADE + name: Rock Forge + citadelBreakReduction: 0.1 + 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_Shield_Unbreaking_I + - Enchant_Sword_Unbreaking_I + - Enchant_Bow_Unbreaking_I + - Upgrade_to_Metal_Forge + - Repair_Factory + metalforge: + type: FCCUPGRADE + name: Metal Forge + citadelBreakReduction: 0.05 + 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_Shield_Unbreaking_I + - Enchant_Shield_Unbreaking_II + - Enchant_Sword_Unbreaking_I + - Enchant_Sword_Unbreaking_II + - Enchant_Bow_Unbreaking_I + - Enchant_Bow_Unbreaking_II + - Upgrade_to_Carbon_Forge + - Repair_Advanced_Factory + carbonforge: + type: FCCUPGRADE + name: Carbon Forge + citadelBreakReduction: 0.025 + 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_Shield_Unbreaking_I + - Enchant_Shield_Unbreaking_II + - Enchant_Shield_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 + - Repair_Expert_Factory + +## XP Production + apprenticetransmuter: + type: FCCUPGRADE + name: Apprentice Transmuter + citadelBreakReduction: 0.1 + recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment + - Upgrade_to_Adept_Transmuter + - Repair_Factory + adepttransmuter: + type: FCCUPGRADE + name: Adept Transmuter + citadelBreakReduction: 0.05 + recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment + - Lead_Enrichment + - Copper_Enrichment + - Tin_Enrichment + - Upgrade_to_Grandmaster_Transmuter + - Repair_Advanced_Factory + grandmastertransmuter: + type: FCCUPGRADE + name: Grandmaster Transmuter + citadelBreakReduction: 0.025 + recipes: + - Aspen_Enrichment + - Cypress_Enrichment + - Pine_Enrichment + - Lead_Enrichment + - Copper_Enrichment + - Tin_Enrichment + - Amethyst_Enrichment + - Topaz_Enrichment + - Ruby_Enrichment + - Repair_Expert_Factory + + +#Pipes + normalpipe: + type: PIPE + name: Standard Pipe + setupcost: + redstone: + material: REDSTONE + amount: 48 + 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 + +#Sorters + sortera: + type: SORTER + name: Standard Sorter + setupcost: + redstone: + material: REDSTONE + amount: 48 + 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: +# lvl 1 + Repair_Rudimentary_Factory: + type: REPAIR + name: Repair Factory + production_time: 30s + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 17 + health_gained: 3334 +# lvl 2 + Repair_Basic_Factory: + type: REPAIR + name: Repair Factory + production_time: 40s + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 26 + health_gained: 3334 +# lvl 3 + Repair_Factory: + type: REPAIR + name: Repair Factory + production_time: 50s + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 35 + health_gained: 3334 +# lvl 4 + Repair_Advanced_Factory: + type: REPAIR + name: Repair Advanced Factory + production_time: 60s + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 70 + health_gained: 3334 +# lvl 5 + Repair_Expert_Factory: + type: REPAIR + name: Repair Expert Factory + production_time: 90s + input: + eye of ender: + material: EYE_OF_ENDER + lore: + - Essence + enchants: + dura: + enchant: DURABILITY + amount: 105 + health_gained: 3334 + Bake_Bread_Advanced: + type: PRODUCTION + name: Bake Bread + production_time: 30s + input: + wheat: + material: WHEAT + amount: 256 + output: + bread: + material: BREAD + amount: 128 + Bake_Bread_Expert: + type: PRODUCTION + name: Bake Bread + 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: 27 + Bake_Cake: + type: PRODUCTION + name: Bake Cake + production_time: 5s + input: + wheat: + material: WHEAT + amount: 80 + sugar: + material: SUGAR + amount: 48 + eggs: + material: EGG + amount: 24 + milk: + material: MILK_BUCKET + amount: 16 + output: + cake: + material: CAKE + amount: 32 + bucket: + material: BUCKET + amount: 16 + Bake_Cookies: + type: PRODUCTION + name: Bake Cookies + production_time: 32s + input: + cocoa: + material: INK_SACK + durability: 3 + amount: 64 + wheat: + material: WHEAT + amount: 128 + output: + cookie: + material: COOKIE + amount: 768 + Bake_Potatoes: + type: PRODUCTION + name: Bake Potatoes + production_time: 32s + input: + potato: + material: POTATO_ITEM + amount: 256 + output: + baked potato: + material: BAKED_POTATO + amount: 512 + Bake_Pumpkin_Pie: + type: PRODUCTION + name: Bake Pumpkin Pie + production_time: 32s + input: + pumpkin: + material: PUMPKIN + amount: 128 + egg: + material: EGG + amount: 128 + sugar: + material: SUGAR + amount: 128 + output: + 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 + production_time: 16s + input: + coal: + material: COAL + amount: 64 + output: + charcoal: + material: COAL + amount: 128 + durability: 1 + Burn_Charcoal_from_Logs_Basic: + type: PRODUCTION + name: Burn Charcoal from Logs + production_time: 16s + input: + log: + material: LOG + durability: -1 + amount: 64 + output: + charcoal: + 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 + production_time: 28s + input: + log: + material: LOG + durability: -1 + amount: 128 + output: + charcoal: + 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 + production_time: 45s + input: + log: + material: LOG + durability: -1 + amount: 512 + output: + charcoal: + material: COAL + amount: 1024 + durability: 1 + Burn_Charcoal_from_Logs2_Expert: + type: PRODUCTION + name: Burn Charcoal from Acacia or Dark Oak + 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 + fuel_consumption_intervall: 5t + production_time: 5t + input: + crate: + material: CHEST + lore: + - Crate + compact_lore: Compacted Item + excluded_materials: + - BOOK + Compact_Stack_Basic: + type: COMPACT + name: Compact Stack + production_time: 5s + input: + crate: + material: CHEST + lore: + - Crate + compact_lore: Compacted Item + excluded_materials: + - BOOK + Convert_Normal_Sand_to_Red_Sand: + type: PRODUCTION + name: Extract Red Sand + production_time: 16s + input: + sand: + material: SAND + amount: 64 + output: + red sand: + material: SAND + durability: 1 + amount: 32 + Cook_Fish: + type: PRODUCTION + name: Cook Fish + production_time: 16s + input: + raw fish: + material: RAW_FISH + amount: 32 + output: + cooked fish: + material: COOKED_FISH + amount: 64 + Cook_Mutton: + type: PRODUCTION + name: Cook Mutton + production_time: 16s + input: + raw mutton: + material: MUTTON + amount: 32 + output: + cooked mutton: + material: COOKED_MUTTON + amount: 64 + Cook_Rabbit: + type: PRODUCTION + name: Cook Rabbit + production_time: 16s + input: + raw rabbit: + material: RABBIT + amount: 32 + output: + cooked rabbit: + material: COOKED_RABBIT + amount: 64 + Cook_Salmon: + type: PRODUCTION + name: Cook Salmon + production_time: 16s + input: + raw salmon: + material: RAW_FISH + durability: 1 + amount: 32 + output: + cooked salmon: + material: COOKED_FISH + durability: 1 + amount: 64 + Craft_Anvils_Advanced: + type: PRODUCTION + name: Craft Anvils + production_time: 10s + input: + iron block: + material: IRON_BLOCK + amount: 32 + output: + anvil: + material: ANVIL + amount: 16 + Craft_Anvils_Basic: + type: PRODUCTION + name: Craft Anvils + production_time: 5s + input: + iron block: + 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: + planks: + material: WOOD + durability: -1 + amount: 64 + output: + boat: + material: BOAT + amount: 18 + Craft_Buckets_Advanced: + type: PRODUCTION + name: Craft Buckets + production_time: 5s + input: + iron block: + material: IRON_INGOT + amount: 18 + output: + bucket: + material: BUCKET + amount: 10 + Craft_Buckets_Basic: + type: PRODUCTION + name: Craft Buckets + production_time: 5s + input: + iron block: + material: IRON_INGOT + amount: 24 + output: + bucket: + material: BUCKET + amount: 10 + 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: 8 + flint: + material: FLINT + amount: 1 + 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: 8 + 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 dust: + 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 dust: + 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 dust: + 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 ingot: + 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 ingot: + 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 ingot: + 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: 8 + output: + chiseled stone brick: + material: SMOOTH_BRICK + durability: 1 + amount: 16 + Craft_Netherbrick_Basic: + type: PRODUCTION + name: Smelt Netherbrick + production_time: 5s + input: + netherrack: + material: NETHERRACK + amount: 64 + output: + netherbrick: + material: NETHER_BRICK + amount: 24 + Craft_Netherbrick_Fence: + type: PRODUCTION + name: Craft Netherbrick Fence + production_time: 20s + 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: 20s + input: + nether brick: + material: NETHER_BRICK + amount: 64 + output: + nether brick slabs: + material: STEP + durability: 6 + amount: 160 + Craft_Netherbrick_Stairs: + type: PRODUCTION + name: Craft Netherbrick Stairs + production_time: 20s + 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 dust: + 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 dust: + 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: + oak fence: + material: FENCE + 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 dust: + material: REDSTONE + amount: 48 + iron ingot: + 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: 8s + input: + andesite: + material: STONE + durability: 5 + amount: 64 + output: + polished andesite: + material: STONE + durability: 6 + amount: 88 + Craft_Polished_Diorite: + type: PRODUCTION + name: Craft Polished Diorite + production_time: 8s + input: + andesite: + material: STONE + durability: 3 + amount: 64 + output: + polished andesite: + material: STONE + durability: 4 + amount: 88 + Craft_Polished_Granite: + type: PRODUCTION + name: Craft Polished Granite + production_time: 8s + input: + andesite: + material: STONE + durability: 1 + amount: 64 + output: + polished andesite: + material: STONE + durability: 2 + amount: 88 + Craft_Prismarine_Basic: + type: PRODUCTION + name: Craft Prismarine + production_time: 15s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 64 + output: + orismarine: + material: PRISMARINE + amount: 24 + 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: 20s + input: + quartz block: + material: QUARTZ_BLOCK + amount: 64 + output: + quartz slab: + material: STEP + durability: 7 + amount: 160 + Craft_Quartz_Stairs: + type: PRODUCTION + name: Craft Quartz Stairs + production_time: 20s + 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 ingot: + material: IRON_INGOT + amount: 30 + stick: + material: STICK + amount: 5 + 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 dust: + 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 dust: + 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 dust: + 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 dust: + 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 dust: + material: REDSTONE + amount: 32 + stick: + material: STICK + amount: 32 + output: + redstone torch: + material: REDSTONE_TORCH_ON + amount: 64 + Craft_Saddles_Basic: + type: PRODUCTION + name: Craft Saddles + production_time: 5s + input: + leather: + material: LEATHER + amount: 128 + iron ingot: + material: IRON_INGOT + amount: 32 + output: + saddle: + material: SADDLE + amount: 4 + 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 ingot: + material: IRON_INGOT + amount: 16 + output: + shears: + material: SHEARS + amount: 10 + Craft_Sticky_Piston: + type: PRODUCTION + name: Craft Sticky Piston + production_time: 10s + input: + cobblestone: + material: COBBLESTONE + amount: 128 + redstone dust: + material: REDSTONE + amount: 48 + iron ingot: + 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 ingot: + 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 + Grow_random_flower: + type: RANDOM + name: Grow random flower + production_time: 5s + input: + seeds: + material: SEEDS + amount: 32 + waterbucket: + material: WATER_BUCKET + amount: 1 + outputs: + 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_Bastion: + type: PRODUCTION + name: Create Bastion + production_time: 5s + input: + pretzel: + material: CAKE + lore: + - Food Concentrate + soup: + material: MUSHROOM_SOUP + lore: + - Soup Concentrate + sand: + material: SAND + lore: + - Desert Concentrate + durability: 1 + brick: + material: NETHER_BRICK_ITEM + lore: + - 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 + ocean: + material: INK_SACK + lore: + - Ocean Concentrate + output: + bastion: + material: SPONGE + amount: 12 + 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 ingot: + material: IRON_INGOT + amount: 32 + redstone dust: + 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: 4 + Create_Podzol_Advanced: + type: PRODUCTION + name: Create Podzol + production_time: 32s + input: + dirt: + material: DIRT + amount: 64 + output: + podzol: + material: DIRT + durability: 2 + amount: 128 + Create_Podzol_Basic: + type: PRODUCTION + name: Create Podzol + production_time: 32s + 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: 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 + production_time: 16s + input: + seeds: + material: SEEDS + amount: 64 + waterbucket: + material: WATER_BUCKET + amount: 1 + output: + roses: + material: RED_ROSE + amount: 2 + emptybucket: + material: BUCKET + amount: 1 + Create_Powered_Rail: + type: PRODUCTION + name: Create Powered Rail + production_time: 5s + input: + gold ingot: + material: GOLD_INGOT + amount: 32 + redstone dust: + 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 ingot: + material: IRON_INGOT + amount: 32 + sticks: + material: STICK + amount: 5 + output: + rail: + material: RAILS + amount: 128 + Cut_any_type_of_Plank_Advanced: + type: WOODMAPPING + name: Cut Planks + production_time: 15s + input: + log: + material: LOG + durability: -2 + amount: 128 + output: + planks: + material: WOOD + amount: 600 + durability: -2 + Cut_any_type_of_Plank_Basic: + type: WOODMAPPING + name: Cut Planks + production_time: 5s + input: + log: + material: LOG + durability: -2 + amount: 32 + output: + planks: + material: WOOD + 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: Decompact Stack + production_time: 5t + fuel_consumption_intervall: 5t + compact_lore: Compacted Item + De-compact_Stack_Basic: + type: DECOMPACT + name: Decompact Stack + production_time: 5s + compact_lore: Compacted Item + Extract_Diamonds: + type: PRODUCTION + name: Extract Diamonds + production_time: 10s + input: + diamond ore: + material: DIAMOND_ORE + amount: 20 + output: + diamond: + material: DIAMOND + amount: 24 + 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: 8s + input: + lapis ore: + material: LAPIS_ORE + amount: 32 + output: + lapis: + material: INK_SACK + durability: 4 + amount: 64 + Extract_Quartz_Advanced: + type: PRODUCTION + name: Extract Quartz + production_time: 8s + input: + quartz ore: + material: QUARTZ_ORE + amount: 32 + output: + quartz: + material: QUARTZ + amount: 128 + Extract_Quartz_Basic: + type: PRODUCTION + name: Extract Quartz + production_time: 10s + input: + quartz ore: + material: QUARTZ_ORE + amount: 32 + output: + quartz: + material: QUARTZ + amount: 96 + Extract_Redstone_Advanced: + type: PRODUCTION + name: Extract Redstone + production_time: 15s + input: + redstone ore: + material: REDSTONE_ORE + amount: 64 + output: + redstone dust: + material: REDSTONE + amount: 192 + Extract_Redstone_Basic: + type: PRODUCTION + name: Extract Redstone + production_time: 20s + input: + redstone ore: + material: REDSTONE_ORE + amount: 64 + output: + redstone dust: + material: REDSTONE + amount: 128 + Forge_Diamond_Axe: + type: PRODUCTION + name: Forge Diamond Axe + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 6 + output: + diamond axe: + material: DIAMOND_AXE + amount: 4 + Forge_Diamond_Boots: + type: PRODUCTION + name: Forge Diamond Boots + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 8 + output: + diamond boots: + material: DIAMOND_BOOTS + amount: 4 + Forge_Diamond_Breastplate: + type: PRODUCTION + name: Forge Diamond Breastplate + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 16 + output: + diamond chestplate: + material: DIAMOND_CHESTPLATE + amount: 4 + Forge_Diamond_Breastplate_Basic: + type: PRODUCTION + name: Forge Diamond Breastplate + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 24 + output: + diamond chestplate: + material: DIAMOND_CHESTPLATE + amount: 4 + Forge_Diamond_Helmet: + type: PRODUCTION + name: Forge Diamond Helmet + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 10 + output: + diamond helmet: + material: DIAMOND_HELMET + amount: 4 + Forge_Diamond_Hoe: + type: PRODUCTION + name: Forge Diamond Hoe + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 4 + output: + diamond hoe: + material: DIAMOND_HOE + amount: 4 + Forge_Diamond_Horse_Armour: + type: PRODUCTION + name: Forge Diamond Horse Armour + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 20 + output: + diamond horse armor: + material: DIAMOND_BARDING + amount: 1 + Forge_Diamond_Leggings: + type: PRODUCTION + name: Forge Diamond Leggings + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 14 + output: + diamond leggings: + material: DIAMOND_LEGGINGS + amount: 4 + Forge_Diamond_Leggings_Basic: + type: PRODUCTION + name: Forge Diamond Leggings + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 21 + output: + diamond leggings: + material: DIAMOND_LEGGINGS + amount: 4 + Forge_Diamond_Pickaxe: + type: PRODUCTION + name: Forge Diamond Pickaxe + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 6 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 4 + Forge_Diamond_Shovel: + type: PRODUCTION + name: Forge Diamond Shovel + production_time: 16s + input: + diamond: + material: DIAMOND + amount: 2 + 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: 9 + output: + diamond pickaxe: + material: DIAMOND_PICKAXE + amount: 4 + Forge_Diamond_Shovel_Basic: + type: PRODUCTION + name: Forge Diamond Shovel + production_time: 32s + input: + diamond: + material: DIAMOND + amount: 3 + output: + diamond shovel: + material: DIAMOND_SPADE + amount: 4 + Forge_Diamond_Sword: + type: PRODUCTION + name: Forge Diamond Sword + production_time: 5s + input: + diamond: + material: DIAMOND + amount: 4 + output: + diamond sword: + material: DIAMOND_SWORD + amount: 4 + Forge_Gold_Axe: + type: PRODUCTION + name: Forge Gold Axe + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 6 + output: + gold axe: + material: GOLD_AXE + amount: 4 + Forge_Gold_Boots: + type: PRODUCTION + name: Forge Gold Boots + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 8 + output: + gold boots: + material: GOLD_BOOTS + amount: 4 + Forge_Gold_Breastplate: + type: PRODUCTION + name: Forge Gold Breastplate + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 16 + output: + gold chestplate: + material: GOLD_CHESTPLATE + amount: 4 + Forge_Gold_Breastplate_Basic: + type: PRODUCTION + name: Forge Gold Breastplate + production_time: 8s + input: + gold: + material: GOLD_INGOT + amount: 24 + output: + gold chestplate: + material: GOLD_CHESTPLATE + amount: 4 + Forge_Gold_Helmet: + type: PRODUCTION + name: Forge Gold Helmet + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 10 + output: + gold helmet: + material: GOLD_HELMET + amount: 4 + Forge_Gold_Hoe: + type: PRODUCTION + name: Forge Gold Hoe + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 4 + output: + gold hoe: + material: GOLD_HOE + amount: 4 + Forge_Gold_Horse_Armour: + type: PRODUCTION + name: Forge Gold Horse Armour + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 20 + output: + gold horse armor: + material: GOLD_BARDING + amount: 1 + Forge_Gold_Leggings: + type: PRODUCTION + name: Forge Gold Leggings + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 14 + output: + gold leggings: + material: GOLD_LEGGINGS + amount: 4 + Forge_Gold_Leggings_Basic: + type: PRODUCTION + name: Forge Gold Leggings + production_time: 8s + input: + gold: + material: GOLD_INGOT + amount: 21 + output: + gold leggings: + material: GOLD_LEGGINGS + amount: 4 + Forge_Gold_Pickaxe: + type: PRODUCTION + name: Forge Gold Pickaxe + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 6 + output: + gold pickaxe: + material: GOLD_PICKAXE + amount: 4 + Forge_Gold_Shovel: + type: PRODUCTION + name: Forge Gold Shovel + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 2 + output: + gold shovel: + material: GOLD_SPADE + amount: 4 + Forge_Gold_Pickaxe_Basic: + type: PRODUCTION + name: Forge Gold Pickaxe + production_time: 8s + input: + gold: + material: GOLD_INGOT + amount: 9 + output: + gold pickaxe: + material: GOLD_PICKAXE + amount: 4 + Forge_Gold_Shovel_Basic: + type: PRODUCTION + name: Forge Gold Shovel + production_time: 8s + input: + gold: + material: GOLD_INGOT + amount: 3 + output: + gold shovel: + material: GOLD_SPADE + amount: 4 + Forge_Gold_Sword: + type: PRODUCTION + name: Forge Gold Sword + production_time: 4s + input: + gold: + material: GOLD_INGOT + amount: 4 + output: + gold sword: + material: GOLD_SWORD + amount: 4 + Forge_Iron_Axe: + type: PRODUCTION + name: Forge Iron Axe + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 8 + output: + iron axe: + material: IRON_AXE + amount: 4 + Forge_Iron_Boots: + type: PRODUCTION + name: Forge Iron Boots + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 12 + output: + iron boots: + material: IRON_BOOTS + amount: 4 + Forge_Iron_Breastplate: + type: PRODUCTION + name: Forge Iron Breastplate + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 24 + output: + iron chestplate: + material: IRON_CHESTPLATE + amount: 4 + Forge_Iron_Helmet: + type: PRODUCTION + name: Forge Iron Helmet + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 15 + output: + iron helmet: + material: IRON_HELMET + amount: 4 + Forge_Iron_Hoe: + type: PRODUCTION + name: Forge Iron Hoe + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 6 + output: + iron hoe: + material: IRON_HOE + amount: 4 + Forge_Iron_Horse_Armour: + type: PRODUCTION + name: Forge Iron Horse Armour + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 20 + output: + iron horse armor: + material: IRON_BARDING + amount: 1 + Forge_Iron_Leggings: + type: PRODUCTION + name: Forge Iron Leggings + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 21 + output: + iron leggings: + material: IRON_LEGGINGS + amount: 4 + Forge_Iron_Pickaxe: + type: PRODUCTION + name: Forge Iron Pickaxe + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 9 + output: + iron pickaxe: + material: IRON_PICKAXE + amount: 4 + Forge_Iron_Shovel: + type: PRODUCTION + name: Forge Iron Shovel + production_time: 16s + input: + iron: + material: IRON_INGOT + amount: 3 + output: + iron shovel: + material: IRON_SPADE + amount: 4 + 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: 16s + input: + stone: + material: COBBLESTONE + amount: 8 + output: + stone axe: + material: STONE_AXE + amount: 4 + Forge_Stone_Hoe: + type: PRODUCTION + name: Forge Stone Hoe + production_time: 16s + input: + stone: + material: COBBLESTONE + amount: 6 + output: + stone hoe: + material: STONE_HOE + amount: 4 + Forge_Stone_Pickaxe: + type: PRODUCTION + name: Forge Stone Pickaxe + production_time: 16s + input: + stone: + material: COBBLESTONE + amount: 9 + output: + stone pickaxe: + material: STONE_PICKAXE + amount: 4 + Forge_Stone_Shovel: + type: PRODUCTION + name: Forge Stone Shovel + production_time: 16s + input: + stone: + material: COBBLESTONE + amount: 3 + output: + stone shovel: + material: STONE_SPADE + amount: 4 + Forge_Stone_Sword: + type: PRODUCTION + name: Forge Stone Sword + production_time: 5s + input: + stone: + material: COBBLESTONE + amount: 10 + output: + stone sword: + material: STONE_SWORD + amount: 8 + Fry_Chicken: + type: PRODUCTION + name: Fry Chicken + production_time: 16s + input: + chicken: + material: RAW_CHICKEN + amount: 32 + output: + cooked chicken: + material: COOKED_CHICKEN + amount: 64 + Grill_Pork: + type: PRODUCTION + name: Grill Pork + production_time: 16s + input: + pork: + material: PORK + amount: 32 + output: + grilled pork: + material: GRILLED_PORK + amount: 64 + Grill_Steak_Advanced: + type: PRODUCTION + name: Grill Steak + production_time: 16s + 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: 20s + 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: 16s + input: + clay: + material: CLAY + amount: 64 + output: + hard clay: + material: HARD_CLAY + amount: 128 + 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: 8s + 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: 8s + 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 + 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 + production_time: 10s + input: + sapling: + material: SAPLING + amount: 64 + durability: -1 + waterbucket: + material: WATER_BUCKET + amount: 1 + outputs: + 1: + chance: 0.143 + oaksapling: + material: SAPLING + amount: 48 + durability: 0 + emptybucket: + material: BUCKET + amount: 1 + 2: + chance: 0.143 + sprucesapling: + material: SAPLING + amount: 48 + durability: 1 + emptybucket: + material: BUCKET + amount: 1 + 3: + chance: 0.143 + birchsapling: + material: SAPLING + amount: 48 + durability: 2 + emptybucket: + material: BUCKET + amount: 1 + 4: + chance: 0.143 + junglesapling: + material: SAPLING + amount: 48 + durability: 3 + emptybucket: + material: BUCKET + amount: 1 + 5: + chance: 0.143 + acaciasapling: + material: SAPLING + amount: 48 + durability: 4 + emptybucket: + material: BUCKET + amount: 1 + 6: + chance: 0.143 + darkoaksapling: + material: SAPLING + amount: 48 + durability: 5 + emptybucket: + material: BUCKET + amount: 1 + 7: + chance: 0.142 + 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: + 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 + 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: Grow Tall Grass + production_time: 5s + input: + fern: + material: LONG_GRASS + amount: 32 + durability: 1 + output: + large fern: + material: DOUBLE_PLANT + amount: 32 + durability: 2 + Smelt_Clay_Bricks: + type: PRODUCTION + name: Smelt Clay Bricks + production_time: 8s + input: + clay: + material: CLAY + amount: 16 + output: + bricks: + material: BRICK + amount: 32 + Smelt_Coal_Ore_Basic: + type: PRODUCTION + name: Smelt Coal Ore + production_time: 16s + input: + coal ore: + material: COAL_ORE + amount: 64 + output: + coal: + material: COAL + amount: 80 + Smelt_Coal_Ore_Advanced: + type: PRODUCTION + name: Smelt Coal Ore Advanced + production_time: 30s + input: + coal ore: + material: COAL_ORE + amount: 128 + output: + coal: + material: COAL + amount: 256 + Smelt_Coal_Ore_Expert: + type: PRODUCTION + name: Smelt Coal Ore + production_time: 50s + input: + coal ore: + material: COAL_ORE + amount: 256 + output: + coal: + material: COAL + amount: 640 + 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: 25s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 128 + Smelt_Glass_Basic: + type: PRODUCTION + name: Smelt Glass + production_time: 32s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 96 + Smelt_Glass_Expert: + type: PRODUCTION + name: Smelt Glass + production_time: 20s + input: + sand: + material: SAND + amount: 64 + output: + glass: + material: GLASS + amount: 192 + Smelt_Glass_Panes_Advanced: + type: PRODUCTION + name: Smelt Glass Panes + production_time: 8s + input: + sand: + material: SAND + amount: 32 + output: + glass pane: + material: THIN_GLASS + amount: 192 + 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 + Blow_Glassbottles: + type: PRODUCTION + name: Blow Glassbottles + production_time: 10s + 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: 10s + input: + gold ore: + material: GOLD_ORE + amount: 16 + output: + gold ingot: + material: GOLD_INGOT + amount: 32 + Smelt_Iron_Ore_Advanced: + type: PRODUCTION + name: Smelt Iron Ore + production_time: 15s + input: + iron ore: + material: IRON_ORE + amount: 64 + output: + iron ingot: + material: IRON_INGOT + amount: 110 + Smelt_Iron_Ore_Basic: + type: PRODUCTION + name: Smelt Iron Ore + production_time: 20s + input: + iron ore: + material: IRON_ORE + amount: 64 + output: + iron ingot: + material: IRON_INGOT + amount: 80 + Smelt_Netherbrick_Advanced: + type: PRODUCTION + name: Smelt Netherbrick + production_time: 10s + 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: 20s + input: + red sand: + material: SAND + durability: 1 + amount: 128 + output: + red sandstone: + material: RED_SANDSTONE + amount: 96 + Smelt_Red_Sandstone_Basic: + type: PRODUCTION + name: Smelt Red Sandstone + production_time: 12s + 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: 12s + input: + red sand: + material: RED_SANDSTONE + amount: 64 + output: + red sandstone: + material: STONE_SLAB2 + amount: 192 + Smelt_Red_Sandstone_Stairs: + type: PRODUCTION + name: Smelt Red Sandstone Stairs + production_time: 12s + input: + red sand: + material: RED_SANDSTONE + amount: 64 + output: + red sandstone: + material: RED_SANDSTONE_STAIRS + amount: 64 + Smelt_Sandstone_Advanced: + type: PRODUCTION + name: Smelt Sandstone + production_time: 20s + input: + red sand: + material: SAND + amount: 128 + output: + red sandstone: + material: SANDSTONE + amount: 96 + Smelt_Sandstone_Basic: + type: PRODUCTION + name: Smelt Sandstone + production_time: 12s + 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: 12s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + sandstone slab: + material: STEP + durability: 1 + amount: 192 + Smelt_Sandstone_Stairs: + type: PRODUCTION + name: Smelt Sandstone Stairs + production_time: 12s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + sandstone stairs: + material: SANDSTONE_STAIRS + amount: 64 + Smelt_Smooth_Red_Sandstone: + type: PRODUCTION + name: Smelt Smooth Red Sandstone + production_time: 16s + 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: 16s + input: + sandstone: + material: SANDSTONE + amount: 64 + output: + smooth sandstone: + 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 + production_time: 35s + input: + sobblestone: + material: COBBLESTONE + amount: 256 + output: + stone: + material: STONE + amount: 320 + Smelt_Stone_Basic: + type: PRODUCTION + name: Smelt Stone + production_time: 20s + input: + sobblestone: + material: COBBLESTONE + amount: 128 + output: + stone: + material: STONE + amount: 140 + Smelt_Stone_Expert: + type: PRODUCTION + name: Smelt Stone + production_time: 60s + input: + sobblestone: + material: COBBLESTONE + amount: 512 + output: + stone: + material: STONE + amount: 720 + 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_Basic: + 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_Animal_Husbandry_Factory_Basic: + production_time: 1800s + type: UPGRADE + name: Upgrade to Animal Husbandry Factory + fuel_consumption_intervall: 15s + input: + hay bale: + material: HAY_BLOCK + amount: 256 + golden apple: + material: GOLDEN_APPLE + amount: 32 + factory: Animal Husbandry Factory + Upgrade_to_Aquatic_Brick_Smelter: + production_time: 1h + type: UPGRADE + name: Upgrade to Aquatic Brick Smelter + fuel_consumption_intervall: 30s + input: + prismarine shard: + material: PRISMARINE_SHARD + amount: 2048 + prismarine crystals: + material: PRISMARINE_CRYSTALS + amount: 512 + ink: + material: INK_SACK + amount: 384 + waterbucket: + material: WATER_BUCKET + amount: 4 + lavabucket: + material: LAVA_BUCKET + amount: 4 + factory: Aquatic Brick Smelter + Upgrade_to_Quartz_Factory: + production_time: 1h + type: UPGRADE + name: Upgrade to Quartz Factory + fuel_consumption_intervall: 30s + input: + Quartz Block: + material: QUARTZ_BLOCK + amount: 2048 + quartz: + material: QUARTZ + amount: 1024 + pick: + material: DIAMOND_PICKAXE + amount: 8 + factory: Quartz Factory + Upgrade_to_Bakery: + production_time: 2h + type: UPGRADE + name: Upgrade to Bakery + fuel_consumption_intervall: 1m + input: + bread: + material: BREAD + amount: 1024 + cake: + material: CAKE + amount: 4 + pumpkinpie: + material: PUMPKIN_PIE + amount: 256 + baked potato: + material: BAKED_POTATO + amount: 1024 + cookie: + material: COOKIE + amount: 384 + fire: + material: FLINT_AND_STEEL + amount: 8 + factory: Bakery + Upgrade_to_Bastion_Factory: + production_time: 1d + type: UPGRADE + name: Upgrade to Bastion Factory + fuel_consumption_intervall: 15m + input: + pretzel: + material: CAKE + amount: 20 + lore: + - Food Concentrate + soup: + material: MUSHROOM_SOUP + amount: 20 + lore: + - Soup Concentrate + sand: + material: SAND + amount: 20 + lore: + - Desert Concentrate + durability: 1 + brick: + material: NETHER_BRICK_ITEM + amount: 20 + lore: + - Hell Concentrate + end: + material: ENDER_PEARL + amount: 20 + lore: + - End Concentrate + rainbow: + material: INK_SACK + amount: 20 + durability: 4 + lore: + - Rainbow Concentrate + cave: + material: COAL_ORE + amount: 20 + lore: + - Cave Concentrate + nature: + material: SAPLING + amount: 20 + lore: + - Nature Concentrate + durability: 3 + ocean: + material: INK_SACK + amount: 20 + lore: + - Ocean Concentrate + factory: Bastion Factory + Upgrade_to_Bio_Lab: + production_time: 2h + type: UPGRADE + name: Upgrade to Bio Lab + fuel_consumption_intervall: 1m + input: + dirt: + material: DIRT + 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: 384 + factory: Bio Lab + Upgrade_to_Blacksmith: + production_time: 10m + type: UPGRADE + name: Upgrade to Blacksmith + fuel_consumption_intervall: 20s + input: + stone: + material: COBBLESTONE + amount: 512 + iron: + material: IRON_INGOT + amount: 24 + wood: + material: WOOD + durability: -1 + amount: 512 + factory: Blacksmith + Upgrade_to_Brick_Smelter: + production_time: 900s + type: UPGRADE + name: Upgrade to Brick Smelter + fuel_consumption_intervall: 8s + input: + 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 + type: UPGRADE + name: Upgrade to Carpentry + fuel_consumption_intervall: 8s + input: + planks: + material: WOOD + durability: -1 + amount: 512 + factory: Carpentry + Upgrade_to_Coal_Burner: + production_time: 1800s + type: UPGRADE + name: Upgrade to Coal Burner + fuel_consumption_intervall: 15s + input: + coal: + material: COAL + amount: 512 + factory: Coal Burner + Upgrade_to_Compactor_Basic: + production_time: 1800s + type: UPGRADE + name: Upgrade to Compactor Basic + fuel_consumption_intervall: 15s + input: + piston: + material: PISTON_BASE + amount: 64 + pistonSticky: + material: PISTON_STICKY_BASE + amount: 64 + chest: + material: CHEST + amount: 256 + iron: + material: IRON_BLOCK + amount: 32 + redstone: + material: REDSTONE_BLOCK + amount: 16 + crate: + material: CHEST + amount: 256 + lore: + - Crate + factory: Compactor Basic + Upgrade_to_Dedicated_Compactor: + production_time: 1h + type: UPGRADE + name: Upgrade to Dedicated Compactor + fuel_consumption_intervall: 30s + input: + piston: + material: PISTON_STICKY_BASE + amount: 512 + chest: + material: CHEST + amount: 1024 + iron: + material: IRON_BLOCK + amount: 192 + redstone: + material: REDSTONE_BLOCK + amount: 64 + crate: + material: CHEST + amount: 512 + lore: + - Crate + factory: Dedicated Compactor + Upgrade_to_Dedicated_De-Compactor: + production_time: 1h + type: UPGRADE + name: Upgrade to Dedicated De-Compactor + fuel_consumption_intervall: 30s + input: + piston: + material: PISTON_STICKY_BASE + amount: 512 + chest: + material: CHEST + amount: 1024 + iron: + material: IRON_BLOCK + amount: 192 + redstone: + material: REDSTONE_BLOCK + amount: 64 + crate: + material: CHEST + amount: 512 + lore: + - Crate + factory: Dedicated De-Compactor + Upgrade_to_Diamond_Armour_Forge: + production_time: 2h + type: UPGRADE + name: Upgrade to Diamond Armour Forge + fuel_consumption_intervall: 60s + input: + diamond block: + material: DIAMOND_BLOCK + amount: 48 + char: + material: COAL + durability: 1 + amount: 1024 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 5 + factory: Diamond Armour Forge + Upgrade_to_Diamond_Equipment_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Diamond Equipment Forge + fuel_consumption_intervall: 30s + input: + diamond block: + material: DIAMOND_BLOCK + amount: 16 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 8 + anvil: + material: ANVIL + amount: 5 + factory: Diamond Equipment Forge + Upgrade_to_Diamond_Tools_Forge: + production_time: 1h + type: UPGRADE + name: Upgrade to Diamond Tools Forge + fuel_consumption_intervall: 30s + input: + diamond block: + material: DIAMOND_BLOCK + amount: 32 + char: + material: COAL + durability: 1 + amount: 1024 + lava: + material: LAVA_BUCKET + amount: 16 + anvil: + material: ANVIL + amount: 5 + factory: Diamond Tools Forge + Upgrade_to_Farmstead_Factory: + production_time: 10m + type: UPGRADE + name: Upgrade to Farmstead Factory + fuel_consumption_intervall: 20s + input: + wheat: + material: BREAD + amount: 192 + potato: + material: BAKED_POTATO + amount: 256 + chicken: + material: COOKED_CHICKEN + amount: 96 + beef: + material: GRILLED_PORK + amount: 96 + factory: Farmstead Factory + Upgrade_to_Fine_Woodworking: + production_time: 900s + type: UPGRADE + name: Upgrade to Fine Woodworking + fuel_consumption_intervall: 8s + input: + planks: + material: WOOD + durability: -1 + amount: 512 + iron axe: + material: IRON_AXE + amount: 1 + factory: Fine Woodworking + Upgrade_to_Flower_Gardening: + 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: 4h + type: UPGRADE + name: Upgrade to Gem Extractor + fuel_consumption_intervall: 2m + input: + diamond: + material: DIAMOND_BLOCK + amount: 20 + quartz: + material: QUARTZ + amount: 1280 + lapis: + material: LAPIS_BLOCK + amount: 128 + redstone: + material: REDSTONE_BLOCK + amount: 128 + factory: Gem Extractor + Upgrade_to_Glass_Dying_Factory: + production_time: 1h + type: UPGRADE + name: Upgrade to Glass Dying Factory + fuel_consumption_intervall: 30s + input: + glass: + material: GLASS + amount: 576 + panes: + material: THIN_GLASS + amount: 576 + 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: Glass Dying Factory + Upgrade_to_Gold_Equipment_Forge: + production_time: 30m + type: UPGRADE + name: Upgrade to Gold Equipment Forge + fuel_consumption_intervall: 15s + input: + gold block: + material: GOLD_BLOCK + 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: 1h + type: UPGRADE + name: Upgrade to Gold Tools 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 Tools Forge + Upgrade_to_Grass_Gardening: + production_time: 1h + type: UPGRADE + name: Upgrade to Grass Gardening + fuel_consumption_intervall: 30s + input: + grass: + material: LONG_GRASS + durability: 1 + amount: 256 + dirt: + material: DIRT + amount: 512 + deadbush: + material: DEAD_BUSH + amount: 128 + factory: Grass Gardening + Upgrade_to_Grill: + production_time: 2h + type: UPGRADE + name: Upgrade to Grill + fuel_consumption_intervall: 1m + input: + beef: + material: COOKED_BEEF + amount: 768 + pork: + material: GRILLED_PORK + amount: 768 + mutton: + material: COOKED_MUTTON + amount: 128 + chicken: + material: COOKED_CHICKEN + amount: 512 + fish: + material: COOKED_FISH + amount: 256 + 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 + type: UPGRADE + name: Upgrade to Iron Equipment Forge + fuel_consumption_intervall: 8s + input: + iron block: + material: IRON_BLOCK + amount: 32 + wood: + material: WOOD + durability: -1 + amount: 512 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 12 + anvil: + material: ANVIL + amount: 5 + factory: Iron Equipment Forge + Upgrade_to_Iron_Forge_Advanced: + production_time: 3600s + type: UPGRADE + name: Upgrade to Steel Forge + fuel_consumption_intervall: 30s + input: + iron block: + material: IRON_BLOCK + amount: 128 + char: + material: COAL + durability: 1 + amount: 1024 + anvil: + material: ANVIL + amount: 10 + lava: + material: LAVA_BUCKET + amount: 24 + factory: Steel Forge + Upgrade_to_Iron_Forge_Basic: + production_time: 1800s + type: UPGRADE + name: Upgrade to Iron Forge + fuel_consumption_intervall: 15s + input: + iron block: + material: IRON_BLOCK + amount: 32 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 8 + factory: Iron Forge + Upgrade_to_Kiln: + production_time: 1800s + type: UPGRADE + name: Upgrade to Kiln + fuel_consumption_intervall: 15s + input: + clay: + material: CLAY + amount: 1536 + char: + material: COAL + durability: 1 + amount: 512 + lava: + material: LAVA_BUCKET + amount: 16 + factory: Kiln + Upgrade_to_Laboratory: + production_time: 10m + type: UPGRADE + name: Upgrade to Laboratory + fuel_consumption_intervall: 20s + input: + redstone: + material: REDSTONE + amount: 192 + cauldron: + material: CAULDRON_ITEM + amount: 16 + slime balls: + material: SLIME_BALL + amount: 32 + factory: Laboratory + Upgrade_to_Netherbrick_Smelter: + production_time: 1h + type: UPGRADE + name: Upgrade to Netherbrick Smelter + fuel_consumption_intervall: 30s + input: + nether brick: + material: NETHER_BRICK + amount: 384 + netherrack: + material: NETHERRACK + amount: 2048 + lavabucket: + material: LAVA_BUCKET + amount: 16 + + factory: Netherbrick Smelter + Upgrade_to_Ore_Smelter: + production_time: 900s + type: UPGRADE + name: Upgrade to Ore Smelter + fuel_consumption_intervall: 8s + input: + iron ingot: + material: IRON_BLOCK + amount: 48 + coal: + material: COAL_BLOCK + amount: 128 + redstone: + material: REDSTONE_BLOCK + amount: 32 + factory: Ore Smelter + Upgrade_to_Ore_Forge: + production_time: 4h + type: UPGRADE + name: Upgrade to Ore Forge + fuel_consumption_intervall: 2m + input: + iron ingot: + material: IRON_BLOCK + amount: 192 + gold ingot: + material: GOLD_BLOCK + amount: 128 + coal: + material: COAL_BLOCK + amount: 256 + factory: Ore Forge + Upgrade_to_Organic_Block_Factory: + production_time: 1800s + type: UPGRADE + name: Upgrade to Organic Block Factory + fuel_consumption_intervall: 15s + input: + grass: + material: GRASS + amount: 1024 + dirt: + material: DIRT + amount: 1024 + water: + material: WATER_BUCKET + amount: 16 + factory: Organic Block Factory + Upgrade_to_Printing_Press: + production_time: 900s + type: UPGRADE + name: Upgrade to Printing Press + fuel_consumption_intervall: 15s + input: + ink sack: + material: INK_SACK + amount: 32 + paper: + material: PAPER + amount: 64 + factory: Printing Press + Upgrade_to_Rail_Factory: + production_time: 1800s + type: UPGRADE + name: Upgrade to Rail Factory + fuel_consumption_intervall: 15s + input: + iron: + material: IRON_BLOCK + amount: 64 + redstone: + material: REDSTONE_BLOCK + amount: 32 + gold: + material: GOLD_BLOCK + amount: 32 + char: + material: COAL + durability: 1 + amount: 512 + anvil: + material: ANVIL + amount: 10 + 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 Electronics + fuel_consumption_intervall: 15s + input: + redstone dust: + material: REDSTONE_BLOCK + amount: 128 + quartz: + material: QUARTZ + amount: 768 + glass: + material: GLASS + amount: 512 + gold: + material: GOLD_BLOCK + amount: 32 + factory: Redstone Electronics + Upgrade_to_Redstone_Factory_Basic: + production_time: 900s + type: UPGRADE + name: Upgrade to Redstone Techniques + fuel_consumption_intervall: 8s + input: + redstone dust: + material: REDSTONE + 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 + type: UPGRADE + name: Upgrade to Redstone Mechanics + fuel_consumption_intervall: 15s + input: + redstone dust: + material: REDSTONE_BLOCK + amount: 128 + quartz: + material: QUARTZ + amount: 256 + stone: + material: STONE + amount: 1024 + string: + material: STRING + amount: 256 + glowstone: + material: GLOWSTONE + amount: 512 + wood: + material: WOOD + amount: 512 + durability: -1 + factory: Redstone Mechanics + Upgrade_to_Sand_Smelter: + production_time: 20m + type: UPGRADE + name: Upgrade to Sand Smelter + fuel_consumption_intervall: 30s + input: + sand: + material: SAND + amount: 1536 + factory: Sand Smelter + Upgrade_to_Glass_Blowing_Workshop: + production_time: 2h + type: UPGRADE + name: Upgrade to Glass Blowing Workshop + fuel_consumption_intervall: 1m + input: + sand: + material: SAND + amount: 1536 + glass: + material: GLASS + amount: 1024 + panes: + material: THIN_GLASS + amount: 512 + factory: Glass Blowing Workshop + Upgrade_to_Sandstone_Smelter: + production_time: 2h + type: UPGRADE + name: Upgrade to Sandstone Smelter + fuel_consumption_intervall: 1m + input: + sandstone: + material: SANDSTONE + amount: 1280 + red sandstone: + material: RED_SANDSTONE + amount: 1280 + factory: Sandstone Smelter + Upgrade_to_Soup_kitchen: + production_time: 2h + type: UPGRADE + name: Upgrade to Soup Kitchen + fuel_consumption_intervall: 1m + input: + red mushroom: + material: RED_MUSHROOM + amount: 1024 + brown mushroom: + material: BROWN_MUSHROOM + amount: 1024 + rabbit: + material: RABBIT + amount: 192 + bowl: + material: BOWL + amount: 128 + fire: + material: FLINT_AND_STEEL + amount: 4 + water: + material: WATER_BUCKET + amount: 8 + beetroot: + material: BEETROOT + amount: 320 + factory: Soup kitchen + Upgrade_to_Stone_Smelter: + production_time: 10m + type: UPGRADE + name: Upgrade to Stone Smelter + fuel_consumption_intervall: 20s + input: + stone: + material: STONE + amount: 640 + factory: Stone Smelter + Upgrade_to_Stonebrick_Smelter: + production_time: 1800s + type: UPGRADE + name: Upgrade to Stonebrick Smelter + fuel_consumption_intervall: 15s + input: + stone: + material: BRICK + amount: 108 + lore: + - Compacted Item + picks: + material: DIAMOND_PICKAXE + amount: 12 + factory: Stonebrick Smelter + Upgrade_to_Tree_Mutator: + production_time: 1800s + type: UPGRADE + name: Upgrade to Tree Mutator + fuel_consumption_intervall: 15s + input: + sapling: + material: SAPLING + durability: -1 + amount: 128 + factory: Tree Mutator + Upgrade_to_Wood_Processor: + production_time: 10m + type: UPGRADE + name: Upgrade to Wood Processor + fuel_consumption_intervall: 20s + input: + planks: + material: LOG + 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 + name: Upgrade to Wool Processing + fuel_consumption_intervall: 15s + input: + 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 + production_time: 20m + type: UPGRADE + fuel_consumption_intervall: 30s + factory: Fancy Stone Smelter + input: + stone: + material: STONE + amount: 108 + lore: + - Compacted Item + otherstone: + material: STONE + durability: 1 + amount: 1024 + idontevenknowwhatthisoneiscalled: + material: STONE + durability: 3 + amount: 1024 + morestoneIguess: + material: STONE + durability: 5 + amount: 1024 + 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 + production_time: 8h + fuel_consumption_intervall: 5m + factory: Basic Pylon + input: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 10 + enchantmenttable: + material: ENCHANTMENT_TABLE + amount: 5 + ironblocks: + material: IRON_BLOCK + amount: 32 + goldenapples: + material: GOLDEN_APPLE + amount: 16 + compactedglass: + material: GLASS + 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 + production_time: 8h + fuel_consumption_intervall: 5m + factory: Advanced Pylon + input: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 32 + enderchests: + material: ENDER_CHEST + amount: 10 + ironblocks: + material: IRON_BLOCK + amount: 48 + goldenapples: + material: GOLDEN_APPLE + amount: 32 + compactedglass: + material: GLASS + 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 + production_time: 8h + fuel_consumption_intervall: 5m + factory: Expert Pylon + input: + poisonouspotatoes: + material: POISONOUS_POTATO + amount: 128 + enderchests: + material: ENDER_CHEST + amount: 64 + diamondblocks: + material: DIAMOND_BLOCK + amount: 16 + goldenapples: + material: GOLDEN_APPLE + amount: 256 + compactedglass: + material: GLASS + amount: 64 + lore: + - Compacted Item + netherquartzore: + material: QUARTZ_ORE + amount: 32 + lore: + - Compacted Item + emerald: + material: EMERALD_BLOCK + amount: 12 + lore: + - Compacted Item + compactedstone: + material: STONE + amount: 512 + lore: + - Compacted Item + compactedlogs1: + material: LOG + amount: 10 + durability: 0 + lore: + - Compacted Item + compactedlogs2: + material: LOG + amount: 10 + durability: 1 + lore: + - Compacted Item + compactedlogs3: + material: LOG + amount: 10 + durability: 2 + lore: + - Compacted Item + compactedlogs4: + material: LOG + amount: 10 + durability: 3 + lore: + - Compacted Item + compactedlogs5: + material: LOG_2 + amount: 10 + durability: 0 + lore: + - Compacted Item + compactedlogs6: + material: LOG_2 + amount: 10 + durability: 1 + lore: + - Compacted Item + +#Pylon recipes + Pylon_Basic: + name: Extract Aether + type: PYLON + production_time: 4h + fuel_consumption_intervall: 24m + input: + output: + aether: + material: GOLD_NUGGET + amount: 10 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + weight: 40 + Pylon_Advanced: + name: Extract Aether + type: PYLON + fuel_consumption_intervall: 24m + production_time: 2h + input: + output: + aether: + material: GOLD_NUGGET + amount: 14 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + weight: 26 + Pylon_Expert: + name: Extract Aether + type: PYLON + fuel_consumption_intervall: 24m + production_time: 2h + input: + output: + aether: + material: GOLD_NUGGET + amount: 20 + lore: + - Aether + enchants: + 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: 28 + health_gained: 1250 + Repair_Advanced_Pylon: + type: REPAIR + name: Repair Advanced Pylon + production_time: 10s + input: + xp: + material: EMERALD_BLOCK + amount: 17 + health_gained: 1250 + Repair_Expert_Pylon: + type: REPAIR + name: Repair Expert Pylon + production_time: 10s + input: + xp: + material: EMERALD_BLOCK + amount: 38 + health_gained: 1250 +#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 + beetroot: + material: BEETROOT + amount: 256 + bucket: + material: WATER_BUCKET + amount: 8 + output: + bucket: + material: BUCKET + amount: 8 + soup: + material: MUSHROOM_SOUP + lore: + - Soup Concentrate + Bake_Food_Concentrate: + name: Bake Food Concentrate + type: PRODUCTION + production_time: 15s + input: + sugar: + material: SUGAR + amount: 384 + egg: + material: EGG + amount: 192 + milk: + material: MILK_BUCKET + amount: 16 + wheat: + material: WHEAT + amount: 384 + output: + buckets: + material: BUCKET + amount: 16 + pretzel: + material: CAKE + lore: + - Food Concentrate + Sieve_Desert_Concentrate: + name: Sieve Desert Concentrate + type: PRODUCTION + production_time: 15s + input: + sand: + material: SAND + amount: 512 + redsand: + material: SAND + amount: 256 + durability: 1 + cactus: + material: CACTUS + amount: 192 + 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: 768 + slow: + material: SOUL_SAND + amount: 192 + glow: + material: GLOWSTONE + amount: 64 + 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: 384 + pearls: + material: ENDER_PEARL + amount: 64 + 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: 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 + Craft_Cave_Concentrate: + name: Craft Cave Concentrate + type: PRODUCTION + production_time: 15s + input: + goldore: + material: GOLD_ORE + amount: 32 + lapisore: + material: LAPIS_ORE + amount: 32 + redore: + material: REDSTONE_ORE + amount: 32 + diaore: + material: DIAMOND_ORE + amount: 12 + 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: 32 + durability: 0 + sapling2: + material: SAPLING + amount: 32 + durability: 1 + sapling3: + material: SAPLING + amount: 32 + durability: 2 + sapling4: + material: SAPLING + amount: 32 + durability: 3 + sapling5: + material: SAPLING + amount: 32 + durability: 4 + sapling6: + material: SAPLING + amount: 32 + durability: 5 + output: + concentrate: + material: SAPLING + lore: + - Nature Concentrate + durability: 3 + Craft_Concentrate_Of_Ocean: + name: Craft Ocean Concentrate + type: PRODUCTION + production_time: 15s + input: + prismarine: + material: PRISMARINE_CRYSTALS + amount: 128 + moreprismarine: + material: PRISMARINE_SHARD + amount: 512 + ink: + material: INK_SACK + amount: 256 + output: + ocean: + material: INK_SACK + lore: + - Ocean Concentrate + +#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_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 + 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 + 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: 64 + bucket: + material: BUCKET + amount: 4 + Compress_Ice_To_Packed_Ice: + name: Compress Ice into Compressed Ice + type: PRODUCTION + production_time: 10s + input: + ice: + material: ICE + amount: 192 + output: + 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 + Create_Pylon_Locator: + name: Create Pylon Locator + type: PRODUCTION + production_time: 1d + fuel_consumption_intervall: 15m + input: + compass: + material: COMPASS + amount: 1 + xp: + material: EMERALD_BLOCK + amount: 256 + redstone: + material: REDSTONE_BLOCK + amount: 64 + output: + basiccompass: + material: COMPASS + amount: 1 + lore: + - Shows all Active, + - Inactive and Upgrading Pylons + enchants: + dura: + enchant: DURABILITY + + + +## XP Generation Recipes +# Upgrades + + Upgrade_to_Apprentice_Transmuter: + production_time: 1h + type: UPGRADE + name: Upgrade to Apprentice Transmuter + factory: Apprentice Transmuter + 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_Adept_Transmuter: + production_time: 2h + type: UPGRADE + name: Upgrade to Adept Transmuter + factory: Adept Transmuter + fuel_consumption_intervall: 1m + input: + ironblocks: + material: IRON_BLOCK + amount: 128 + aether: + material: GOLD_NUGGET + amount: 500 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + xp: + material: EMERALD_BLOCK + amount: 44 + Upgrade_to_Grandmaster_Transmuter: + production_time: 4h + type: UPGRADE + name: Upgrade to Grandmaster Transmuter + factory: Grandmaster Transmuter + fuel_consumption_intervall: 1m + input: + ironblocks: + material: DIAMOND_BLOCK + amount: 16 + aether: + material: GOLD_NUGGET + amount: 78 + lore: + - Aether + - Compacted Item + enchants: + dura: + enchant: DURABILITY + xp: + material: EMERALD_BLOCK + amount: 384 + +# 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: 16 + durability: -1 + netherwart: + material: NETHER_STALK + amount: 32 + aether: + material: GOLD_NUGGET + amount: 4 + 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: 16 + durability: -1 + cactus: + material: CACTUS + amount: 64 + aether: + material: GOLD_NUGGET + amount: 4 + 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: 16 + durability: -1 + sugarcane: + material: SUGAR_CANE + amount: 64 + aether: + material: GOLD_NUGGET + amount: 4 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD + amount: 20 + + Lead_Enrichment: + name: Lead Enrichment + type: PRODUCTION + production_time: 30m + fuel_consumption_intervall: 5m + input: + wheat: + material: WHEAT + amount: 320 + acacialogs: + material: LOG_2 + amount: 80 + durability: 0 + netherwart: + material: NETHER_STALK + amount: 160 + melons: + material: MELON_BLOCK + amount: 128 +# chicken: +# material: RAW_CHICKEN +# amount: 32 + aether: + material: GOLD_NUGGET + amount: 21 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + Copper_Enrichment: + name: Copper Enrichment + type: PRODUCTION + production_time: 30m + fuel_consumption_intervall: 5m + input: + carrots: + material: CARROT_ITEM + amount: 320 + sprucelogs: + material: LOG + amount: 80 + durability: 1 + cactus: + material: CACTUS + amount: 320 + cocoa: + material: INK_SACK + amount: 256 + durability: 3 +# beef: +# material: RAW_BEEF +# amount: 32 + aether: + material: GOLD_NUGGET + amount: 21 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + Tin_Enrichment: + name: Tin Enrichment + type: PRODUCTION + production_time: 30m + fuel_consumption_intervall: 5m + input: + potatoes: + material: POTATO_ITEM + amount: 320 + birchlogs: + material: LOG + amount: 80 + durability: 2 + sugarcane: + material: SUGAR_CANE + amount: 320 + pumpkins: + material: PUMPKIN + amount: 128 +# pork: +# material: PORK +# amount: 32 + aether: + material: GOLD_NUGGET + amount: 21 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 19 + + Amethyst_Enrichment: + name: Amethyst Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + wheat: + material: WHEAT + amount: 25 + lore: + - Compacted Item + acacialogs: + material: LOG_2 + amount: 6 + durability: 0 + lore: + - Compacted Item + junglesaplings: + material: SAPLING + amount: 1 + durability: 3 + lore: + - Compacted Item + netherwart: + material: NETHER_STALK + amount: 15 + lore: + - Compacted Item + melons: + material: MELON_BLOCK + amount: 10 + lore: + - Compacted Item +# chicken: +# material: RAW_CHICKEN +# amount: 160 + vines: + material: VINE + amount: 6 + lore: + - Compacted Item + fish: + material: RAW_FISH + amount: 15 + durability: 1 + aether: + material: GOLD_NUGGET + amount: 120 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 + Topaz_Enrichment: + name: Topaz Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + carrots: + material: CARROT_ITEM + amount: 25 + lore: + - Compacted Item + sprucelogs: + material: LOG + amount: 6 + durability: 1 + lore: + - Compacted Item + darkoaksaplings: + material: SAPLING + amount: 16 + durability: 5 + cactus: + material: CACTUS + amount: 25 + lore: + - Compacted Item + cocoa: + material: INK_SACK + amount: 20 + durability: 3 + lore: + - Compacted Item +# beef: +# material: RAW_BEEF +# amount: 160 + pufferfish: + material: RAW_FISH + amount: 3 + durability: 3 + vines: + material: VINE + amount: 6 + lore: + - Compacted Item + aether: + material: GOLD_NUGGET + amount: 120 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 + Ruby_Enrichment: + name: Ruby Enrichment + type: PRODUCTION + production_time: 1h + fuel_consumption_intervall: 6m + input: + potatoes: + material: POTATO_ITEM + amount: 25 + lore: + - Compacted Item + birchlogs: + material: LOG + amount: 6 + durability: 2 + lore: + - Compacted Item + oaksaplings: + material: SAPLING + amount: 1 + durability: 0 + lore: + - Compacted Item + sugarcane: + material: SUGAR_CANE + amount: 25 + lore: + - Compacted Item + pumpkins: + material: PUMPKIN + amount: 10 + lore: + - Compacted Item +# pork: +# material: PORK +# amount: 160 + salmon: + material: RAW_FISH + amount: 5 + durability: 1 + vines: + material: VINE + amount: 6 + lore: + - Compacted Item + aether: + material: GOLD_NUGGET + amount: 120 + lore: + - Aether + enchants: + dura: + enchant: DURABILITY + output: + xp: + material: EMERALD_BLOCK + amount: 140 +##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 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 10 + 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: 10 + 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: 10 + 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: 10 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 450 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 450 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 450 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 450 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 750 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 625 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 500 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: OXYGEN + level: 1 + enchant_item: + helmet: + material: DIAMOND_HELMET + Enchant_Respiration_II: + type: ENCHANT + name: Enchant Helmet with Respiration II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 100 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 300 + enchant: OXYGEN + level: 3 + enchant_item: + helmet: + material: DIAMOND_HELMET + enchants: + respiration2: + enchant: OXYGEN + level: 2 +#Frost Walker + + 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: + type: ENCHANT + name: Enchant Helmet with Aqua Affinity + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 15 + enchant: PROTECTION_FALL + level: 1 + enchant_item: + boots: + material: DIAMOND_BOOTS + Enchant_FeatherFalling_II: + type: ENCHANT + name: Enchant Boots with FeatherFalling II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 500 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 10 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 60 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 120 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 300 + 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 + type: ENCHANT + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 750 + enchant: ARROW_INFINITE + level: 1 + enchant_item: + bow: + material: BOW +#Silk Touch + + Enchant_Pickaxe_SilkTouch_I: + type: ENCHANT + name: Enchant Pickaxe with Silk Touch + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 500 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_PICKAXE + Enchant_Axe_SilkTouch_I: + type: ENCHANT + name: Enchant Axe with Silk Touch + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 500 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_AXE + Enchant_Shovel_SilkTouch_I: + name: Enchant Shovel with Silk Touch + type: ENCHANT + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 500 + enchant: SILK_TOUCH + level: 1 + enchant_item: + pickaxe: + material: DIAMOND_SPADE +#Protection + + Enchant_Helmet_Protection_I: + type: ENCHANT + name: Enchant Helmet with Protection I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 25 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 375 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 375 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 375 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 375 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15 + 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: 15 + 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: 15 + 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: 15 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + enchant: THORNS + level: 1 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + Enchant_Thorns_II: + type: ENCHANT + name: Enchant Chestplate with Thorns II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 75 + enchant: THORNS + level: 2 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + thorns1: + enchant: THORNS + level: 1 + Enchant_Thorns_III: + type: ENCHANT + name: Enchant Chestplate with Thorns III + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 225 + enchant: THORNS + level: 3 + enchant_item: + chestplate: + material: DIAMOND_CHESTPLATE + enchants: + thorns2: + enchant: THORNS + level: 2 +#Power + + Enchant_Power_I: + type: ENCHANT + name: Enchant Bow with Power I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: ARROW_DAMAGE + level: 1 + enchant_item: + bow: + material: BOW + Enchant_Power_II: + type: ENCHANT + name: Enchant Bow with Power II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 500 + enchant: ARROW_DAMAGE + level: 4 + enchant_item: + bow: + material: BOW + enchants: + power3: + enchant: ARROW_DAMAGE + level: 3 + Enchant_Power_V: + type: ENCHANT + name: Enchant Bow with Power V + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 1000 + enchant: ARROW_DAMAGE + level: 5 + enchant_item: + bow: + material: BOW + enchants: + power4: + enchant: ARROW_DAMAGE + level: 4 +#Projectile Protection + + Enchant_Helmet_ProjectileProtection_I: + type: ENCHANT + name: Enchant Helmet with Projectile Protection I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15 + 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: 15 + 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: 15 + 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: 15 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 125 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + enchant: ARROW_KNOCKBACK + level: 1 + enchant_item: + bow: + material: BOW + Enchant_Punch_II: + type: ENCHANT + name: Enchant Bow with Punch II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 400 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: DAMAGE_ALL + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Sharpness_II: + type: ENCHANT + name: Enchant Sword with Sharpness II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 500 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 1000 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DAMAGE_UNDEAD + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Smite_II: + type: ENCHANT + name: Enchant Sword with Smite II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 20 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 60 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 120 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 300 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 150 + enchant: KNOCKBACK + level: 1 + enchant_item: + sword: + material: DIAMOND_SWORD + Enchant_Knockback_II: + type: ENCHANT + name: Enchant Sword with Knockback II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 400 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 10 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 10 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 5 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 10 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 30 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_PICKAXE + Enchant_Pickaxe_Unbreaking_II: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_AXE + Enchant_Axe_Unbreaking_II: + type: ENCHANT + name: Enchant Axe with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_SPADE + Enchant_Shovel_Unbreaking_II: + type: ENCHANT + name: Enchant Shovel with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: DIAMOND_SWORD + Enchant_Sword_Unbreaking_II: + type: ENCHANT + name: Enchant Sword with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 100 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 25 + enchant: DURABILITY + level: 1 + enchant_item: + tool: + material: BOW + Enchant_Bow_Unbreaking_II: + type: ENCHANT + name: Enchant Bow with Unbreaking II + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 75 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 200 + enchant: DURABILITY + level: 3 + enchant_item: + tool: + material: BOW + enchants: + ub2: + enchant: DURABILITY + level: 2 +#Unbreaking Armour/Shield + + Enchant_Helmet_Unbreaking_I: + type: ENCHANT + name: Enchant Helmet with Unbreaking I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_HELMET + Enchant_Chestplate_Unbreaking_I: + type: ENCHANT + name: Enchant Chestplate with Unbreaking I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_CHESTPLATE + Enchant_Leggings_Unbreaking_I: + type: ENCHANT + name: Enchant Leggings with Unbreaking I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_LEGGINGS + Enchant_Boots_Unbreaking_I: + type: ENCHANT + name: Enchant Boots with Unbreaking I + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 38 + enchant: DURABILITY + level: 1 + 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 + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 100 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 100 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 100 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 100 + enchant: DURABILITY + level: 2 + enchant_item: + armor: + material: DIAMOND_BOOTS + enchants: + 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 + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 250 + 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: 15s + input: + emeralds: + material: EMERALD + amount: 250 + enchant: DURABILITY + level: 3 + enchant_item: + armor: + material: DIAMOND_BOOTS + enchants: + 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: + type: ENCHANT + name: Enchant Pickaxe with Efficiency + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_PICKAXE + Enchant_Efficiency_Axe_Basic: + type: ENCHANT + name: Enchant Axe with Efficiency + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_AXE + Enchant_Efficiency_Shovel_Basic: + type: ENCHANT + name: Enchant Shovel with Efficiency + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 10 + enchant: DIG_SPEED + level: 1 + enchant_item: + armor: + material: DIAMOND_SPADE + Enchant_Unbreaking_Pickaxe_Basic: + type: ENCHANT + name: Enchant Pickaxe with Unbreaking + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_PICKAXE + Enchant_Unbreaking_Axe_Basic: + type: ENCHANT + name: Enchant Axe with Unbreaking + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_AXE + Enchant_Unbreaking_Shovel_Basic: + type: ENCHANT + name: Enchant Shovel with Unbreaking + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_SPADE + Enchant_Unbreaking_Sword_Basic: + type: ENCHANT + name: Enchant Sword with Unbreaking + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DURABILITY + level: 1 + enchant_item: + armor: + material: DIAMOND_SWORD + Enchant_Sharpness_Basic: + type: ENCHANT + name: Enchant Sword with Sharpness + production_time: 15s + input: + emeralds: + material: EMERALD + amount: 50 + enchant: DAMAGE_ALL + level: 1 + enchant_item: + armor: + material: DIAMOND_SWORD + Enchant_Leaf_Burner_I: + type: LOREENCHANT + name: Enchant Shear with Leaf Burner + production_time: 15s + loredItem: + tool: + 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: SHEARS + appliedLore: + - Leaf Burner II + overwrittenLore: + - Leaf Burner + input: + emeralds: + material: EMERALD + amount: 80 + +#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: WATCH + 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: 4 + durability: 1500 + godbook1: + chance: 0.00120909 + power5book: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + power5: + enchant: ARROW_DAMAGE + level: 5 + godbook2: + chance: 0.00120909 + infinity: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + infinity: + enchant: ARROW_INFINITE + level: 1 + godbook3: + chance: 0.00120909 + eff5: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + eff5: + enchant: DIG_SPEED + level: 5 + godbook4: + chance: 0.00120909 + ub3: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + ub3: + enchant: DURABILITY + level: 3 + godbook5: + chance: 0.00120909 + sharpness5: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + sharpness5: + enchant: DAMAGE_ALL + level: 5 + godbook6: + chance: 0.00110909 + protection4: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + protection4: + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + godbook7: + chance: 0.00120909 + silktouch: + material: ENCHANTED_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: 16 + durability: 1 + lore: + - Compacted Item + high27: + chance: 0.0037012 + item: + material: COAL_ORE + amount: 2 + 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: 1 + 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: 1 + 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: WATCH + 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: 4 + durability: 1500 + godbook1: + chance: 0.00120909 + power5book: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + power5: + enchant: ARROW_DAMAGE + level: 5 + godbook2: + chance: 0.00120909 + infinity: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + infinity: + enchant: ARROW_INFINITE + level: 1 + godbook3: + chance: 0.00120909 + eff5: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + eff5: + enchant: DIG_SPEED + level: 5 + godbook4: + chance: 0.00120909 + ub3: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + ub3: + enchant: DURABILITY + level: 3 + godbook5: + chance: 0.00120909 + sharpness5: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + sharpness5: + enchant: DAMAGE_ALL + level: 5 + godbook6: + chance: 0.00110909 + protection4: + material: ENCHANTED_BOOK + amount: 1 + stored_enchants: + protection4: + enchant: PROTECTION_ENVIRONMENTAL + level: 4 + godbook7: + chance: 0.00120909 + silktouch: + material: ENCHANTED_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: 16 + durability: 1 + lore: + - Compacted Item + high27: + chance: 0.0037012 + item: + material: COAL_ORE + amount: 2 + 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: 1 + 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: 1 + 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 + +#Reinforcement recipes: + Produce_basic_granite_Miner_Component: + type: PRODUCTION + production_time: 2s + name: Produce basic Granite Miner Component + input: + stone: + material: STONE + amount: 64 + granite: + material: STONE + amount: 64 + durability: 1 + coalore: + material: COAL_ORE + amount: 16 + 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: 64 + granite: + material: STONE + amount: 64 + durability: 5 + coalore: + material: COAL_ORE + amount: 16 + 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: 64 + granite: + material: STONE + amount: 64 + durability: 3 + coalore: + material: COAL_ORE + amount: 16 + 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: 4 + bone: + material: BONE + amount: 6 + string: + material: STRING + amount: 8 + 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: 8 + bone: + material: ROTTEN_FLESH + amount: 16 + 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: 4 + bone: + material: ROTTEN_FLESH + amount: 8 + string: + material: STRING + amount: 8 + 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: 3 + + 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: 3 + 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: 2 + flint: + material: FLINT + amount: 8 + iron: + material: IRON_INGOT + amount: 8 + 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: 2 + redstone: + material: REDSTONE + amount: 8 + gold: + material: GOLD_INGOT + amount: 8 + 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: 2 + slime: + material: SLIME_BALL + amount: 8 + blazeRod: + material: BLAZE_ROD + amount: 8 + 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: 2 + magmaCream: + material: MAGMA_CREAM + amount: 8 + gunpowder: + material: SULPHUR + amount: 6 + 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: 3 + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + amount: 3 + 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: 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_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 + production_time: 4s + name: Produce strong Miner Component + input: + decentHunter: + material: SULPHUR + name: Hunter Component + lore: + - Decent Reinforcement Ingredient + amount: 2 + 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_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 + production_time: 10s + name: Produce good reinforcement + input: + strongMiner: + material: PRISMARINE + name: Miner Component + lore: + - Strong Reinforcement Ingredient + amount: 3 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 3 + 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: 3 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 3 + 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: 3 + strongHunter: + material: GHAST_TEAR + name: Hunter Component + lore: + - Strong Reinforcement Ingredient + amount: 3 + 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: + type: COSTRETURN + production_time: 10s + name: Destroy Factory + factor: 1.0 + input: + dirt: + material: DIRT + +renames: diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 00000000..f562a1a5 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,18 @@ +name: ${project.name} +main: com.github.igotyou.FactoryMod.FactoryMod +author: Maxopoly, igotyou +version: ${project.version} +depend: [CivModCore] +softdepend: [CivMenu, NameLayer, Citadel] +commands: + fm: + permission: fm.public + fmc: + permission: fm.op + fmsrc: + permission: fm.op +permissions: + fm.public: + default: true + fm.op: + default: op \ No newline at end of file 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