Skip to content

Commit f7fd32d

Browse files
0.31 20100104 (0.31.20100104)
1 parent 7532d4c commit f7fd32d

File tree

134 files changed

+2425
-1900
lines changed

Some content is hidden

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

134 files changed

+2425
-1900
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include screenshot.png
77
include LICENSE
88
include README.md
99

10-
recursive-include mc *.pyx *.pxd *.ogg *.png *.md3 *.MD3
10+
recursive-include mc *.pyx *.pxd *.ogg *.png *.md3 *.MD3 *.dll
1111
recursive-exclude * *.pyc
1212
recursive-exclude * *.pyd
1313
recursive-exclude * *.html

Makefile

+1-1
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.31.20091231.post2.tar.gz
15+
pip install dist/minecraft-python-0.31.20100104.tar.gz
1616

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

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
_**Minecraft: Python Edition**_ is a project that strives to recreate each and every old Minecraft version in Python 3 using the **Pyglet** multimedia library and **Cython** for performance.
66

77
The project is currently working on the Indev versions of Minecraft.
8-
The latest version is **Indev 0.31 20091231-2** as released on _**December 31, 2009**_.
8+
The latest version is **Indev 0.31 20100104** as released on _**January 4, 2010**_.
99

10-
This version is the last version of Minecraft released in 2009, and the first version of Indev released in survival mode.
11-
This version introduces the player inventory screen and isometric screenshots, the latter of which is exclusive to Indev versions as the world is not infinite.
10+
This version is the first version of Minecraft released in 2010, and it reintroduces sound and music to the game.
1211

13-
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_0.31_20091231-2)
12+
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.31.20100104`.
13+
14+
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_0.31_20100104)
1415

1516
### Organization
1617

@@ -20,21 +21,22 @@ To play any version, specify it in the `pip install` command as demonstrated bel
2021

2122
### General Usage
2223

23-
*Pyglet*, *Cython*, *Pillow*, and *NumPy* are required dependencies and can easily be installed with *pip*. Use the versions specified in `requirements.txt`.
24-
25-
While the late Classic versions and later Indev versions feature audio, this version does not.
24+
*Pyglet*, *Cython*, *Pillow*, *PyOgg*, and *NumPy* are required dependencies and can easily be installed with *pip*. Use the versions specified in `requirements.txt`.
2625

27-
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.31.20091231-2`.
26+
For audio to work you will either need *PyOgg* which is recommended, or *FFmpeg* which has to be installed on your system.
27+
*GStreamer* is also supported on Linux through the *gst-python* library.
28+
PyOgg requires that your system have one of the Opus, FLAC, or Vorbis codecs.
29+
*OpenAL* is required and comes bundled with the source on Windows.
2830

29-
Alternatively, for a manual Cython build, run `python setup.py build_ext --inplace`.
31+
For a manual Cython source build, run `python setup.py build_ext --inplace`.
3032

3133
Run `python -m mc.net.minecraft.Minecraft` to launch the game. *Minecraft: Python Edition* should be compatible with any modern platform that supports OpenGL and Cython.
3234

3335
Run with the argument `-fullscreen` to open the window in fullscreen mode. The argument `-creative` will force the game to be in creative mode.
3436

3537
### Gameplay
3638

37-
Press I to open your inventory. Tools which were newly added in this version will be in the inventory, but they serve no function yet.
39+
Press I to open your inventory. Early tools are in the inventory, but they serve no function yet.
3840
Press F7 to take a cool isometric screenshot and F5 to toggle rain. Other keys are listed in the regular options menu.
3941

4042
The only mobs around are the Rana mobs, but they don't drop anything when killed. Arrows and mushrooms are unusable.

mc/CompatibilityShims.pyx

+17-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ from libc.time cimport time
1010
from pyglet import gl
1111

1212
import ctypes
13+
import time as pytime
1314

1415
import numpy as np
1516
cimport numpy as np
1617

1718
cpdef unsigned long long getMillis():
18-
cdef double timestamp = time(NULL)
19-
cdef unsigned long long milliseconds = <unsigned long long>(timestamp * 1000)
20-
return milliseconds
19+
return <unsigned long long>(pytime.time() * 1000)
2120

2221
cdef bint Random_seeded = False
2322

@@ -452,6 +451,21 @@ cdef class FloatBuffer(Buffer):
452451
cpdef inline float getAt(self, int idx):
453452
return self[self.checkIndex(idx)]
454453

454+
def getBytes(self, b):
455+
cdef int rem
456+
457+
assert self.checkBounds(0, len(b), len(b))
458+
assert self._position <= self._limit
459+
rem = self._limit - self._position if self._position <= self._limit else 0
460+
if len(b) > rem:
461+
raise Exception
462+
463+
sliced = self[self._position:self._position + len(b)]
464+
b[:] = [<float>e for e in sliced]
465+
466+
self._position += len(b)
467+
return self
468+
455469
cdef getFloats(self, float* array, int size):
456470
cdef int rem, i
457471

mc/lib/soft_oal_32.dll

381 KB
Binary file not shown.

mc/lib/soft_oal_64.dll

374 KB
Binary file not shown.

mc/net/minecraft/client/GameSettings.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from mc.net.minecraft.client.KeyBinding import KeyBinding
2-
from mc.net.minecraft.client.render.RenderEngine import RenderEngine
3-
from mc import Resources
42
from pyglet import window
53

64
import pathlib
@@ -189,16 +187,7 @@ def setOptionValue(self, option, arg):
189187
self.viewBobbing = not self.viewBobbing
190188
elif option == 6:
191189
self.anaglyph = not self.anaglyph
192-
for id_, img in self.__mc.renderEngine.textureContentsMap.items():
193-
self.__mc.renderEngine.setupTexture(img, id_)
194-
195-
for string, id_ in self.__mc.renderEngine.textureMap.items():
196-
if string.startswith('##'):
197-
img = RenderEngine.unwrapImageByColumns(Resources.textures[string[2:]])
198-
else:
199-
img = Resources.textures[string]
200-
201-
self.__mc.renderEngine.setupTexture(img, id_)
190+
self.__mc.renderEngine.refreshTextures()
202191
elif option == 7:
203192
self.limitFramerate = not self.limitFramerate
204193

0 commit comments

Comments
 (0)