Skip to content

Commit

Permalink
working on making python3 be on equal footing with 27
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Aug 3, 2016
1 parent ca228cc commit 7d1af3b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
Binary file modified python2-scripts.zip
Binary file not shown.
Binary file modified python3-scripts.zip
Binary file not shown.
12 changes: 8 additions & 4 deletions python3-scripts/mcpipy/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

from mc import *
from sys import argv
from sys import argv,version
import mcpi.nbt as nbt
import json

Expand Down Expand Up @@ -111,9 +111,13 @@ def offset(x,y,z):
if len(argv) >= 2:
path = argv[1]
else:
import Tkinter
from tkFileDialog import askopenfilename
master = Tkinter.Tk()
if int(version[0]) < 3:
from tkFileDialog import askopenfilename
from Tkinter import *
else:
from tkinter.filedialog import askopenfilename
from tkinter import *
master = Tk()
master.attributes("-topmost", True)
path = askopenfilename(filetypes=['schematic {*.schematic}'],title="Open")
master.destroy()
Expand Down
3 changes: 2 additions & 1 deletion python3-scripts/mcpipy/render.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#www.stuffaboutcode.com

#www.stuffaboutcode.com
#Raspberry Pi, Minecraft - Create 3D Model from Obj file
# Version 2 - draws complete faces rather than wireframes and uses materials
"""
Expand Down
24 changes: 16 additions & 8 deletions python3-scripts/mcpipy/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,32 @@
from mcpi.minecraft import *
from mcpi.block import *
from math import *
from sys import maxsize
import sys
from copy import copy
from ast import literal_eval
import re

def getSavePath(directory, extension):
import Tkinter
from tkFileDialog import asksaveasfilename
master = Tkinter.Tk()
if int(sys.version[0]) < 3:
from tkFileDialog import asksaveasfilename
from Tkinter import *
else:
from tkinter.filedialog import asksaveasfilename
from tkinter import *
master = Tk()
master.attributes("-topmost", True)
path = asksaveasfilename(initialdir=directory,filetypes=['vehicle {*.'+extension+'}'],defaultextension="."+extension,title="Save")
master.destroy()
return path

def getLoadPath(directory, extension):
import Tkinter
from tkFileDialog import askopenfilename
master = Tkinter.Tk()
if int(sys.version[0]) < 3:
from tkFileDialog import askopenfilename
from Tkinter import *
else:
from tkinter.filedialog import askopenfilename
from tkinter import *
master = Tk()
master.attributes("-topmost", True)
path = askopenfilename(initialdir=directory,filetypes=['vehicle {*.'+extension+'}'],title="Open")
master.destroy()
Expand Down Expand Up @@ -76,7 +84,7 @@ class Vehicle():
def __init__(self,mc,nondestructive=False):
self.mc = mc
self.nondestructive = nondestructive
self.highWater = -maxsize-1
self.highWater = -sys.maxsize-1
self.baseVehicle = {}
if hasattr(Minecraft, 'getBlockWithNBT'):
self.getBlockWithData = self.mc.getBlockWithNBT
Expand Down

0 comments on commit 7d1af3b

Please sign in to comment.