Skip to content

Commit 8c6cd9f

Browse files
0.0.13a_03
1 parent 985e56f commit 8c6cd9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1134
-1080
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
dist
12
build
3+
minecraft_python.egg-info
24
*.pyc
35
*.pyd
46
*.dat

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install:
1212
CYTHONIZE=1 pip install .
1313

1414
install-from-source: dist
15-
pip install dist/minecraft-python-0.0.13.tar.gz
15+
pip install dist/minecraft-python-0.0.13a3.tar.gz
1616

1717
clean:
1818
$(RM) -r build dist src/*.egg-info

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
_**Minecraft: Python Edition**_ is a project that strives to recreate each and every old Minecraft version in Python using the **Pyglet** multimedia library and **Cython** for performance.
66

7-
This project is currently recreating the **Classic** versions of Minecraft. The latest version is **Classic 0.0.13a** as released on _**May 22, 2009**_.
7+
This project is currently recreating the **Classic** versions of Minecraft. The latest version is **Classic 0.0.13a_03** as released on _**May 22, 2009**_.
88

9-
Learn more about this version [here](https://minecraft.fandom.com/wiki/Java_Edition_Classic_0.0.13a).
9+
Learn more about this version [here](https://minecraft.fandom.com/wiki/Java_Edition_Classic_0.0.13a_03).
1010

1111
### General Usage
1212

1313
*Pyglet* and *Cython* are required dependencies and can easily be installed with *pip*. Use the versions specified in `requirements.txt`.
1414

15-
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.0.13`.
15+
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.0.13a_03`.
1616

1717
Alternatively, for a manual Cython build, run `python setup.py build_ext --inplace`.
1818

@@ -22,9 +22,9 @@ Run with the argument `-fullscreen` to open the window in fullscreen mode.
2222

2323
### Gameplay
2424

25-
Basic terrain and caves, block picking and placing, level saving, and human mobs are featured in this version. There are five different blocks you can place.
25+
This version features more advanced terrain (including caves and expanding water tiles), level saving, and human mobs. There are five different tiles you can place.
2626

27-
Press *Esc* to pause. Press *R* to reset your position, *G* to spawn a mob, *F* to toggle render distance, *Y* to invert mouse, *Enter* to save the level, and numbers *1-4* (*6* for sapling) to switch blocks.
27+
Press *Esc* to pause. Press *R* to reset your position, *Y* to invert the mouse, *G* to spawn a mob, *F* to toggle render distance, *Enter* to save the level, and numbers *1-4* (*6* for sapling) to switch blocks.
2828

2929
### Additional Notes
3030

mc/net/minecraft/Entity.py

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,33 @@ class Entity:
1515
yRotO = 0.0
1616
xRotO = 0.0
1717
onGround = False
18-
18+
horizontalCollision = False
1919
removed = False
20-
_heightOffset = 0.0
2120

22-
_bbWidth = 0.6
23-
_bbHeight = 1.8
21+
heightOffset = 0.0
22+
__bbWidth = 0.6
23+
bbHeight = 1.8
2424

2525
def __init__(self, level):
26-
self._level = level
26+
self.__level = level
2727
self.resetPos()
2828

2929
def resetPos(self):
30-
x = random.random() * self._level.width
31-
y = self._level.depth + 10.
32-
z = random.random() * self._level.height
30+
x = random.random() * self.__level.width
31+
y = self.__level.depth + 10.
32+
z = random.random() * self.__level.height
3333
self.setPos(x, y, z)
3434

35-
def remove(self):
36-
self.removed = True
37-
3835
def setSize(self, w, h):
39-
self._bbWidth = w
40-
self._bbHeight = h
36+
self.__bbWidth = w
37+
self.bbHeight = h
4138

4239
def setPos(self, x, y, z):
4340
self.x = x
4441
self.y = y
4542
self.z = z
46-
w = self._bbWidth / 2.0
47-
h = self._bbHeight / 2.0
43+
w = self.__bbWidth / 2.0
44+
h = self.bbHeight / 2.0
4845
self.bb = AABB(x - w, y - h, z - w, x + w, y + h, z + w)
4946

5047
def turn(self, xo, yo):
@@ -66,21 +63,15 @@ def tick(self):
6663
self.zo = self.z
6764

6865
def isFree(self, xa, ya, za):
69-
box = self.bb.cloneMove(xa, ya, za)
70-
aABBs = self._level.getCubes(box)
71-
if len(aABBs) > 0:
72-
return False
73-
if self._level.containsAnyLiquid(box):
74-
return False
75-
76-
return True
66+
aABB = self.bb.cloneMove(xa, ya, za)
67+
return False if len(self.__level.getCubes(aABB)) > 0 else not self.__level.containsAnyLiquid(aABB)
7768

7869
def move(self, xa, ya, za):
7970
xaOrg = xa
8071
yaOrg = ya
8172
zaOrg = za
8273

83-
aABBs = self._level.getCubes(self.bb.expand(xa, ya, za))
74+
aABBs = self.__level.getCubes(self.bb.expand(xa, ya, za))
8475
for aABB in aABBs:
8576
ya = aABB.clipYCollide(self.bb, ya)
8677

@@ -107,14 +98,14 @@ def move(self, xa, ya, za):
10798
self.zd = 0.0
10899

109100
self.x = (self.bb.x0 + self.bb.x1) / 2.0
110-
self.y = self.bb.y0 + self._heightOffset
101+
self.y = self.bb.y0 + self.heightOffset
111102
self.z = (self.bb.z0 + self.bb.z1) / 2.0
112103

113104
def isInWater(self):
114-
return self._level.containsLiquid(self.bb.grow(0.0, -0.4, 0.0), 1)
105+
return self.__level.containsLiquid(self.bb.grow(0.0, -0.4, 0.0), 1)
115106

116107
def isInLava(self):
117-
return self._level.containsLiquid(self.bb, 2)
108+
return self.__level.containsLiquid(self.bb, 2)
118109

119110
def moveRelative(self, xa, za, speed):
120111
dist = xa * xa + za * za
@@ -132,7 +123,7 @@ def moveRelative(self, xa, za, speed):
132123
self.zd += za * cos + xa * sin
133124

134125
def isLit(self):
135-
return self._level.isLit(int(self.x), int(self.y), int(self.z))
126+
return self.__level.isLit(int(self.x), int(self.y), int(self.z))
136127

137128
def render(self, a):
138129
pass

mc/net/minecraft/HitResult.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,7 @@ def __init__(self, type_, x, y, z, f):
66
self.z = z
77
self.f = f
88

9-
def isCloserThan(self, player, o, editMode):
10-
dist = self.__distanceTo(player, 0)
11-
dist2 = o.__distanceTo(player, 0)
12-
if dist < dist2:
13-
return True
14-
dist = self.__distanceTo(player, editMode)
15-
dist2 = o.__distanceTo(player, editMode)
16-
if dist < dist2:
17-
return True
18-
return False
19-
20-
def __distanceTo(self, player, editMode):
9+
def distanceTo(self, player, editMode):
2110
xx = self.x
2211
yy = self.y
2312
zz = self.z

0 commit comments

Comments
 (0)