Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'TastesLikeBleach'
- class NVA():
- array = None
- def __init__(self, array):
- self.array = array
- def hasElement(self, value):
- i = 0
- while i < len(self.array):
- if self.array[i] == value:
- return True
- i += 1
- return False
- def append(self, o):
- self.array.append(o)
- def remove(self, o):
- self.array.remove(o)
- def genoreblockstate(uN, domain, hi = False):
- if hi:
- uN = input("What is the ore's unlocalized name?: ")
- file = open(uN + '.json', 'w')
- file.write('{\n "variants": {\n')
- file.write(' "type=overworld": {"model": "' + domain + ':' + uN + '_overworld"},\n')
- file.write(' "type=nether": {"model": "' + domain + ':' + uN + '_nether"},\n')
- file.write(' "type=end": {"model": "' + domain + ':' + uN + '_end"},\n')
- file.close()
- def genoreblockmodel(uN, d, hi=False):
- if hi:
- uN = input('enter the unlocalized name: ')
- file = open(uN + '_overworld.json', 'w')
- file.write('{\n "parent": "block/cube_all",\n "textures": {\n "all": "'+d+':blocks/'+uN+'_overworld"\n')
- file.write(' }\n}')
- file.close()
- file = open(uN + '_nether.json', 'w')
- file.write('{\n "parent": "block/cube_all",\n "textures": {\n "all": "'+d+':blocks/'+uN+'_nether"\n')
- file.write(' }\n}')
- file.close()
- file = open(uN + '_end.json', 'w')
- file.write('{\n "parent": "block/cube_all",\n "textures": {\n "all": "'+d+':blocks/'+uN+'_end"\n')
- file.write(' }\n}')
- file.close()
- def genoreitemmodel(uN, d, hi=False):
- if hi:
- uN = input('enter the (ORENAME): ')
- file = open(uN + '_overworld.json', 'w')
- file.write('{\n "parent": "' + d + ':block/' + uN + '_overworld"\n}')
- file.close()
- file = open(uN + '_nether.json', 'w')
- file.write('{\n "parent": "' + d + ':block/' + uN + '_nether"\n}')
- file.close()
- file = open(uN + '_end.json', 'w')
- file.write('{\n "parent": "' + d + ':block/' + uN + '_end"\n}')
- file.close()
- def genarmoritemmodel(uN, d, hi=False):
- if hi:
- uN = input("please enter the (METALNAME): ")
- file = open(uN + 'helmet.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/'+uN+'helmet"')
- file.write('\n }\n}')
- file.close()
- file = open(uN + 'chestplate.json', 'w')
- file.write(
- '{\n "parent": "item/generated",\n "textures": {\n "layer0": "' + d + ':items/' + uN + 'chestpl')
- file.write('ate"\n }\n}')
- file.close()
- file = open(uN + 'leggings.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/'+uN+'leggings"')
- file.write('\n }\n}')
- file.close()
- file = open(uN + 'boots.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/'+uN+'boots"')
- file.write('\n }\n}')
- file.close()
- def gentoolmodel(uN, d, hi=False):
- if hi:
- uN = input("please enter the (METALNAME): ")
- file = open(uN + 'pickaxe.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/' + uN)
- file.write('pickaxe"\n' + ' }\n}')
- file.close()
- file = open(uN + 'axe.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/' + uN + 'axe"')
- file.write('\n }\n}')
- file.close()
- file = open(uN + 'hoe.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/' + uN + 'hoe"')
- file.write('\n }\n}')
- file.close()
- file = open(uN + 'shovel.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "'+d+':items/')
- file.write(uN + 'shovel"' + '\n }\n}')
- file = open(uN + 'sword.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "tcm:items/' + uN + 'sword"')
- file.write('\n }\n}')
- file.close()
- def genTALang(uN, n, hi = False):
- if hi:
- uN = input('please enter the (METALNAME) for the tools and armor: ')
- n = input('Please enter (METALDISPLAYNAME): ')
- file = open('langfragment.txt', 'w')
- file.write('item.' + uN + 'pickaxe.name=' + n + ' Pickaxe\n')
- file.write('item.' + uN + 'sword.name=' + n + ' Sword\n')
- file.write('item.' + uN + 'hoe.name=' + n + ' Hoe\n')
- file.write('item.' + uN + 'axe.name=' + n + ' Axe\n')
- file.write('item.' + uN + 'shovel.name=' + n + ' Shovel\n')
- file.write('item.' + uN + 'helmet.name=' + n + ' Helmet\n')
- file.write('item.' + uN + 'chestplate.name=' + n + ' Chestplate\n')
- file.write('item.' + uN + 'leggings.name=' + n + ' Leggings\n')
- file.write('item.' + uN + 'boots.name=' + n + ' Boots\n')
- file.close()
- def MakeItemModel(uN, d):
- file = open(uN + '.json', 'w')
- file.write('{\n "parent": "item/generated",\n "textures": {\n "layer0": "' + d + ':items/' + uN + '"')
- file.write('\n }\n}')
- file.close()
- def MakeBlockState(uN, d):
- file = open(uN + '.json', 'w')
- file.write('{ "variants": { "normal": { "model": "' + domain + ':' + uN + '" } } }')
- file.close()
- def MakeBlockModel(uN, d):
- file = open(uN + '.json', 'w')
- file.write('{ "parent": "block/cube_all", "textures": { "all": "' + d + ':blocks/' + uN + '" } }')
- file.close()
- def MakeItemBlockModel(uN, d):
- file = open(uN + '.json', 'w')
- file.write('{ "parent": "' + d + ':block/' + uN + '" }')
- file.close()
- closed = False
- domain = input("please enter your mod's (DOMAIN) / id: ")
- while not closed:
- gen = input('What do you want to generate?: ')
- if gen == 'close':
- closed = True
- if gen == 'tim':
- gentoolmodel('', domain, True)
- if gen == 'aim':
- genarmoritemmodel('', domain, True)
- if gen == 'obs':
- genoreblockstate('', domain, True)
- if gen == 'obm':
- genoreblockmodel('', domain, True)
- if gen == 'oim':
- genoreitemmodel('', domain, True)
- if gen == 'tal':
- genTALang('', '', True)
- if gen == 'im':
- MakeItemModel(input("Enter the (UNLOCALIZEDNAME) please: "), domain)
- if gen == 'bs':
- MakeBlockState(input("Enter the (UNLOCALIZEDNAME) please: "), domain)
- if gen == 'bm':
- MakeBlockModel(input("Enter the (UNLOCALIZEDNAME) please: "), domain)
- if gen == 'ibm':
- MakeItemBlockModel(input("Enter the (UNLOCALIZEDNAME) please: "), domain)
- # PLEASE READ THIS FOR A HOW TO GUIDE!
- #
- # The interface for this is text-based and is only intuitive if you've used python for file making before.
- # In order to enter input when requested type respective input and hit ENTER.
- #
- # The file name will always be (UNLOCALIZEDNAME).json and if previously generated files with the same name
- # are not moved they will be overwritten.
- #
- # Block Models: enter 'bm' (excluding quotes)
- # Any generated model should something look like this after being but through a json verifier:
- #
- # {
- # "parent": "block/cube_all",
- # "textures": {
- # "all": "(DOMAIN):blocks/(UNLOCALIZEDNAME)"
- # }
- # }
- #
- # Basic Block States: enter 'bs'
- #
- # {
- # "variants": {
- # "normal": {
- # "model": "(DOMAIN):(UNLOCALIZEDNAME)"
- # }
- # }
- # }
- #
- #
- #
- # Basic ItemBlock Model: enter 'ibm'
- #
- # {
- # "parent": "(DOMAIN):block/(UNLOCALIZEDNAME)"
- # }
- #
- #
- # Basic Item Model: enter 'im'
- #
- # {
- # "parent": "item/generated",
- # "textures": {
- # "layer0": "(DOMAIN):items/(UNLOCALIZEDNAME)"
- # }
- # }
- #
- # Generated .lang file fragments for tools and armor: enter 'tal', in file 'langfragment.txt'
- #
- # item.(METALNAME)pickaxe.name=(METALDISPLAYNAME) Pickaxe
- # item.(METALNAME)axe.name=(METALDISPLAYNAME) Axe
- # item.(METALNAME)sword.name=(METALDISPLAYNAME) Sword
- # item.(METALNAME)shovel.name=(METALDISPLAYNAME) Shovel
- # item.(METALNAME)hoe.name=(METALDISPLAYNAME) Hoe
- # item.(METALNAME)helmet.name=(METALDISPLAYNAME) Helmet
- # item.(METALNAME)chestplate.name=(METALDISPLAYNAME) Chestplate
- # item.(METALNAME)leggings.name=(METALDISPLAYNAME) Leggings
- # item.(METALNAME)boots.name=(METALDISPLAYNAME) Boots
- #
- #
- # Generated tool item models: 'tim'
- # should look something like this and will generate several files like this, '(METALNAME)(ARMORPIECENAME).json'
- # {
- # "parent": "item/generated",
- # "textures": {
- # "layer0": "(DOMAIN):items/(METALNAME)(TOOLNAME)"
- # }
- # }
- #
- # Generated armor item models: 'aim'
- # {
- # "parent": "item/generated",
- # "textures": {
- # "layer0": "(DOMAIN):items/(METALNAME)(ARMORPIECENAME)"
- # }
- # }
- #
Advertisement
Add Comment
Please, Sign In to add comment