Skip to content

Commit 7532d4c

Browse files
0.31 20091231-2 (0.31.20091231-2)
1 parent 5189588 commit 7532d4c

Some content is hidden

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

83 files changed

+1554
-1099
lines changed

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

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

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
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 20091223-2**, the first version of Indev which was released on _**December 23, 2009**_.
8+
The latest version is **Indev 0.31 20091231-2** as released on _**December 31, 2009**_.
99

10-
This version is the last available version of Minecraft to be released in creative mode exclusively.
11-
However, the work-in-progress survival mode can be enabled by running the game with the argument `-survival`.
12-
This is the first version to feature one of the MD3 mobs of Indev, Rana.
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.
1312

14-
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_0.31_20091223-2).
13+
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_0.31_20091231-2)
1514

1615
### Organization
1716

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

2221
### General Usage
2322

24-
*Pyglet*, *Cython*, and *Pillow* are required dependencies and can easily be installed with *pip*. Use the versions specified in `requirements.txt`.
23+
*Pyglet*, *Cython*, *Pillow*, and *NumPy* are required dependencies and can easily be installed with *pip*. Use the versions specified in `requirements.txt`.
2524

2625
While the late Classic versions and later Indev versions feature audio, this version does not.
2726

28-
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.31.20091223-2`.
27+
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==0.31.20091231-2`.
2928

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

3231
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.
3332

34-
Run with the argument `-fullscreen` to open the window in fullscreen mode.
33+
Run with the argument `-fullscreen` to open the window in fullscreen mode. The argument `-creative` will force the game to be in creative mode.
3534

3635
### Gameplay
3736

38-
Press B to pick any of the ores and tiles that exist in this creative version.
39-
Press F5 to toggle rain. Other keys are listed in the regular options menu.
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.
38+
Press F7 to take a cool isometric screenshot and F5 to toggle rain. Other keys are listed in the regular options menu.
4039

41-
If you enable survival mode, you will spawn with some lava and water blocks for testing.
42-
You will be able to attack the Rana mobs, but items in general won't drop. Arrows and mushrooms are unusable.
40+
The only mobs around are the Rana mobs, but they don't drop anything when killed. Arrows and mushrooms are unusable.
4341

4442
### Additional Notes
4543

mc/CompatibilityShims.pyx

+6
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ cdef class ByteBuffer(Buffer):
334334
gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height,
335335
format, type, self.__getDataPtr())
336336

337+
def glReadPixels(self, int x, int y, int width, int height, int format, int type):
338+
gl.glReadPixels(x, y, width, height, format, type, self.__getDataPtr())
339+
337340
cdef class IntBuffer(Buffer):
338341

339342
def __init__(self, capacity):
@@ -491,6 +494,9 @@ cdef class FloatBuffer(Buffer):
491494
def glInterleavedArrays(self, int format, int stride):
492495
gl.glInterleavedArrays(format, stride, self.__getDataPtr())
493496

497+
def glMultMatrix(self):
498+
gl.glMultMatrixf(self.__getDataPtr())
499+
494500
cdef class BufferUtils:
495501

496502
def wrapByteBuffer(byteArray):

mc/Resources.py

+3-1
Large diffs are not rendered by default.

mc/net/minecraft/client/GameSettings.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,16 @@ def __init__(self, mc, file):
153153
self.keyBindBack = KeyBinding('Back', window.key.S)
154154
self.keyBindRight = KeyBinding('Right', window.key.D)
155155
self.keyBindJump = KeyBinding('Jump', window.key.SPACE)
156-
self.keyBindInventory = KeyBinding('Build', window.key.B)
156+
self.keyBindInventory = KeyBinding('Inventory', window.key.I)
157+
self.keyBindDrop = KeyBinding('Drop', window.key.Q)
157158
self.keyBindChat = KeyBinding('Chat', window.key.T)
158159
self.keyBindToggleFog = KeyBinding('Toggle fog', window.key.F)
159160
self.keyBindSave = KeyBinding('Save location', window.key.RETURN)
160161
self.keyBindLoad = KeyBinding('Load location', window.key.R)
161162
self.keyBindings = [self.keyBindForward, self.keyBindLeft, self.keyBindBack,
162-
self.keyBindRight, self.keyBindJump, self.keyBindInventory,
163-
self.keyBindChat, self.keyBindToggleFog, self.keyBindSave,
164-
self.keyBindLoad]
163+
self.keyBindRight, self.keyBindJump, self.keyBindDrop,
164+
self.keyBindInventory, self.keyBindChat, self.keyBindToggleFog,
165+
self.keyBindSave, self.keyBindLoad]
165166
self.__mc = mc
166167
self.__optionsFile = (pathlib.Path(file) / 'options.txt').resolve()
167168
self.__loadOptions()

mc/net/minecraft/client/LoadingScreenRenderer.py

+27-20
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
class LoadingScreenRenderer:
66

77
def __init__(self, minecraft):
8-
self.minecraft = minecraft
8+
self.__mc = minecraft
99
self.__text = ''
10-
self.title = ''
10+
self.__title = ''
1111

12-
def beginLevelLoading(self, title):
13-
if not self.minecraft.running:
12+
def displayProgressMessage(self, title):
13+
if not self.__mc.running:
1414
raise MinecraftError
1515
else:
16-
self.title = title
17-
screenWidth = self.minecraft.width * 240 / self.minecraft.height
18-
screenHeight = self.minecraft.height * 240 / self.minecraft.height
16+
self.__title = title
17+
screenWidth = self.__mc.width * 240 / self.__mc.height
18+
screenHeight = self.__mc.height * 240 / self.__mc.height
1919

2020
gl.glClear(gl.GL_DEPTH_BUFFER_BIT)
2121
gl.glMatrixMode(gl.GL_PROJECTION)
@@ -25,24 +25,31 @@ def beginLevelLoading(self, title):
2525
gl.glLoadIdentity()
2626
gl.glTranslatef(0.0, 0.0, -200.0)
2727

28-
def displayProgressMessage(self, text):
29-
if not self.minecraft.running:
28+
def displayLoadingString(self, text):
29+
if not self.__mc.running:
3030
raise MinecraftError
3131
else:
3232
self.__text = text
3333
self.setLoadingProgress()
3434

3535
def setLoadingProgress(self):
36-
if not self.minecraft.running:
36+
if not self.__mc.running:
3737
raise MinecraftError
3838
else:
39-
screenWidth = self.minecraft.width * 240 // self.minecraft.height
40-
screenHeight = self.minecraft.height * 240 // self.minecraft.height
39+
screenWidth = self.__mc.width * 240 // self.__mc.height
40+
screenHeight = self.__mc.height * 240 // self.__mc.height
4141

42-
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
42+
gl.glClear(gl.GL_DEPTH_BUFFER_BIT)
43+
gl.glMatrixMode(gl.GL_PROJECTION)
44+
gl.glLoadIdentity()
45+
gl.glOrtho(0.0, screenWidth, screenHeight, 0.0, 100.0, 300.0)
46+
gl.glMatrixMode(gl.GL_MODELVIEW)
47+
gl.glLoadIdentity()
48+
gl.glTranslatef(0.0, 0.0, -200.0)
49+
gl.glClear(gl.GL_DEPTH_BUFFER_BIT | gl.GL_COLOR_BUFFER_BIT)
4350

4451
t = tessellator
45-
id_ = self.minecraft.renderEngine.getTexture('dirt.png')
52+
id_ = self.__mc.renderEngine.getTexture('dirt.png')
4653
gl.glBindTexture(gl.GL_TEXTURE_2D, id_)
4754
s = 32.0
4855
t.startDrawingQuads()
@@ -53,16 +60,16 @@ def setLoadingProgress(self):
5360
t.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0)
5461
t.draw()
5562

56-
self.minecraft.fontRenderer.drawStringWithShadow(
57-
self.title,
58-
(screenWidth - self.minecraft.fontRenderer.getWidth(self.title)) // 2,
63+
self.__mc.fontRenderer.drawStringWithShadow(
64+
self.__title,
65+
(screenWidth - self.__mc.fontRenderer.getStringWidth(self.__title)) // 2,
5966
screenHeight // 2 - 4 - 16, 0xFFFFFF
6067
)
61-
self.minecraft.fontRenderer.drawStringWithShadow(
68+
self.__mc.fontRenderer.drawStringWithShadow(
6269
self.__text,
63-
(screenWidth - self.minecraft.fontRenderer.getWidth(self.__text)) // 2,
70+
(screenWidth - self.__mc.fontRenderer.getStringWidth(self.__text)) // 2,
6471
screenHeight // 2 - 4 + 8, 0xFFFFFF
6572
)
6673

6774
clock.tick()
68-
self.minecraft.flip()
75+
self.__mc.flip()

0 commit comments

Comments
 (0)