Skip to content

Commit d1ad24c

Browse files
Indev 20100214 (20100214)
1 parent f14c0f5 commit d1ad24c

Some content is hidden

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

69 files changed

+659
-442
lines changed

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

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

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
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 20100212-2** as released on _**February 12, 2010**_.
8+
The latest version is **Indev 20100214** as released on _**February 14, 2010**_.
99

10-
This version adds the day and night cycle and craftable armor (not yet functional).
11-
This is the first version where hostile mobs only spawn at night and in dark areas.
10+
This version readds audio and adds the visible player hand, the Paradise and Woods map themes, and mobs burning in daylight.
1211

1312
Features from previous Indev versions include the Indev mossy cobblestone spawn house, NBT level file saving, mobs and animals, farming,
14-
durable tools, difficulty, torches, advanced liquid spread, TNT explosives, chests, the main menu, workbench crafting, and soup.
13+
durable tools, day and night cycle, difficulty, torches, advanced liquid spread, TNT explosives, chests, the main menu, workbench crafting, and soup.
1514

16-
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==20100212-2`.
15+
To easily install this version of *Minecraft: Python Edition*, just run `python -m pip install minecraft-python==20100214`.
1716

18-
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_20100212-2)
17+
You can learn more about this version [on the Minecraft wiki.](https://minecraft.wiki/w/Java_Edition_Indev_20100214)
1918

2019
### Organization
2120

@@ -48,7 +47,8 @@ Press I to open your inventory, F5 to toggle rain and F7 to take a cool isometri
4847
Smelting is unique in early Indev: to get iron or gold ingots, light the dropped ores on fire or throw them in lava.
4948

5049
The Indev level generator is customizable and you can choose between the *Inland*, *Island*, *Floating*, and *Flat* level types.
51-
You can specify the world theme as *Normal* or *Hell* (lava and dirt instead of water and grass), world size, and world shape (*Square*, *Long*, *Deep*).
50+
You can specify the world theme as *Normal*, *Hell* (lava and dirt instead of water and grass), *Paradise* (always daylight), or *Woods*.
51+
World size and world shape (*Square*, *Long*, *Deep*) may also be selected.
5252

5353
Levels can be saved to a single *.mclevel* NBT file in the pause menu. The level files are perfectly compatible with Java and vice versa.
5454

@@ -58,7 +58,7 @@ Mushroom bowl soup and bread will restore health. Check the Wiki for crafting re
5858

5959
![Isometric screenshot](/map.png?raw=true)
6060

61-
*An isometric screenshot of a Floating map generated by the game, showcasing mobs and farming.*
61+
*An isometric screenshot of a normal Woods map generated by the game.*
6262

6363
### Additional Notes
6464

map.png

12.4 MB
Loading

mc/Resources.py

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

mc/net/minecraft/client/Minecraft.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ def setLevel(self, world):
669669
if not self.thePlayer:
670670
self.thePlayer = EntityPlayerSP(self, world, self.session)
671671
self.thePlayer.preparePlayerToSpawn()
672-
self.playerController.flipPlayer(self.thePlayer)
673672
if world:
674673
world.spawnEntityInWorld(self.thePlayer)
675674
world.playerEntity = self.thePlayer

mc/net/minecraft/client/controller/PlayerController.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ def setPartialTime(self, damageTime):
4040
def getBlockReachDistance(self):
4141
return 5.0
4242

43-
def flipPlayer(self, player):
44-
pass
45-
4643
def onUpdate(self):
4744
pass
4845

mc/net/minecraft/client/controller/PlayerControllerSP.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@ def __init__(self, mc):
1818
self.__blockHitWait = 0
1919
self.__mobSpawner = None
2020

21-
def flipPlayer(self, player):
22-
x = int(player.posX)
23-
y = int(player.posY)
24-
z = int(player.posZ)
25-
for xx in range(x - 3, x + 4):
26-
for yy in range(y - 2, y + 3):
27-
for zz in range(z - 3, z + 4):
28-
blockId = blocks.obsidian.blockID if yy < y - 1 else 0
29-
if xx == x - 3 or zz == z - 3 or xx == x + 3 or zz == z + 3 or yy == y - 2 or yy == y + 2:
30-
blockId = blocks.cobblestoneMossy.blockID
31-
if zz == z - 3 and xx == x and yy >= y - 1 and yy <= y:
32-
blockId = 0
33-
34-
self._mc.theWorld.setBlockWithNotify(xx, yy, zz, blockId)
35-
36-
self._mc.theWorld.setBlockWithNotify(x - 3 + 1, y, z, blocks.torch.blockID)
37-
self._mc.theWorld.setBlockWithNotify(x + 3 - 1, y, z, blocks.torch.blockID)
38-
3921
def sendBlockRemoved(self, x, y, z):
4022
block = self._mc.theWorld.getBlockId(x, y, z)
4123
metadata = self._mc.theWorld.getBlockMetadata(x, y, z)

mc/net/minecraft/client/gui/GuiNewLevel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def __init__(self, screen):
99
self.__worldType = ('Inland', 'Island', 'Floating', 'Flat')
1010
self.__worldShape = ('Square', 'Long', 'Deep')
1111
self.__worldSize = ('Small', 'Normal', 'Huge')
12-
self.__worldTheme = ('Normal', 'Hell')
12+
self.__worldTheme = ('Normal', 'Hell', 'Paradise', 'Woods')
1313
self.__selectedWorldType = 1
1414
self.__selectedWorldShape = 0
1515
self.__selectedWorldSize = 1

mc/net/minecraft/client/render/EntityRenderer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ def __render(self, alpha):
366366
gl.glTranslatef(-x, -y, -z)
367367

368368
self.__setupFog()
369+
gl.glEnable(gl.GL_FOG)
369370
self.__mc.renderGlobal.renderSky(alpha)
370371
self.__setupFog()
371372

mc/net/minecraft/client/render/ItemRenderer.py

Lines changed: 74 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from mc.net.minecraft.client.render.entity.RenderManager import RenderManager
12
from mc.net.minecraft.client.render.RenderBlocks import RenderBlocks
23
from mc.net.minecraft.client.render.Tessellator import tessellator
34
from mc.net.minecraft.client.RenderHelper import RenderHelper
@@ -18,45 +19,48 @@ def __init__(self, minecraft):
1819
self.__renderBlocksInstance = RenderBlocks()
1920

2021
def renderItemInFirstPerson(self, alpha):
21-
progress = self.__prevEquippedProgress + (self.__equippedProgress - self.__prevEquippedProgress) * alpha
22+
progress = self.__prevEquippedProgress + \
23+
(self.__equippedProgress - self.__prevEquippedProgress) * alpha
2224
gl.glPushMatrix()
2325
gl.glRotatef(
24-
self.__mc.thePlayer.prevRotationPitch + (self.__mc.thePlayer.rotationPitch - self.__mc.thePlayer.prevRotationPitch) * alpha,
26+
self.__mc.thePlayer.prevRotationPitch + \
27+
(self.__mc.thePlayer.rotationPitch - self.__mc.thePlayer.prevRotationPitch) * alpha,
2528
1.0, 0.0, 0.0
2629
)
2730
gl.glRotatef(
28-
self.__mc.thePlayer.prevRotationYaw + (self.__mc.thePlayer.rotationYaw - self.__mc.thePlayer.prevRotationYaw) * alpha,
31+
self.__mc.thePlayer.prevRotationYaw + \
32+
(self.__mc.thePlayer.rotationYaw - self.__mc.thePlayer.prevRotationYaw) * alpha,
2933
0.0, 1.0, 0.0
3034
)
3135
RenderHelper.enableStandardItemLighting()
3236
gl.glPopMatrix()
33-
gl.glPushMatrix()
34-
if self.__swingProgress == -1:
35-
self.__swingProgress += 1
36-
if self.__itemSwingState:
37-
slot = (self.__swingProgress + alpha) / 8.0
38-
swingY = math.sin(slot * math.pi)
39-
swingX = math.sin(math.sqrt(slot) * math.pi)
40-
gl.glTranslatef(-swingX * 0.4,
41-
math.sin(math.sqrt(slot) * math.pi * 2.0) * 0.2,
42-
-swingY * 0.2)
43-
44-
gl.glTranslatef(0.56, -0.52 - (1.0 - progress) * 0.6, -0.71999997)
45-
gl.glRotatef(45.0, 0.0, 1.0, 0.0)
46-
gl.glEnable(gl.GL_NORMALIZE)
47-
if self.__itemSwingState:
48-
slot = (self.__swingProgress + alpha) / 8.0
49-
swingY = math.sin((slot * slot) * math.pi)
50-
swingX = math.sin(math.sqrt(slot) * math.pi)
51-
gl.glRotatef(-swingY * 20.0, 0.0, 1.0, 0.0)
52-
gl.glRotatef(-swingX * 20.0, 0.0, 0.0, 1.0)
53-
gl.glRotatef(-swingX * 80.0, 1.0, 0.0, 0.0)
54-
55-
brightness = self.__mc.theWorld.getBrightness(int(self.__mc.thePlayer.posX),
56-
int(self.__mc.thePlayer.posY),
57-
int(self.__mc.thePlayer.posZ))
58-
gl.glColor4f(brightness, brightness, brightness, 1.0)
37+
br = self.__mc.theWorld.getBrightness(int(self.__mc.thePlayer.posX),
38+
int(self.__mc.thePlayer.posY),
39+
int(self.__mc.thePlayer.posZ))
40+
gl.glColor4f(br, br, br, 1.0)
5941
if self.__itemToRender:
42+
gl.glPushMatrix()
43+
if self.__swingProgress == -1:
44+
self.__swingProgress += 1
45+
if self.__itemSwingState:
46+
slot = (self.__swingProgress + alpha) / 8.0
47+
swingY = math.sin(slot * math.pi)
48+
swingX = math.sin(math.sqrt(slot) * math.pi)
49+
gl.glTranslatef(-swingX * 0.4,
50+
math.sin(math.sqrt(slot) * math.pi * 2.0) * 0.2,
51+
-swingY * 0.2)
52+
53+
gl.glTranslatef(0.56, -0.52 - (1.0 - progress) * 0.6, -0.71999997)
54+
gl.glRotatef(45.0, 0.0, 1.0, 0.0)
55+
gl.glEnable(gl.GL_NORMALIZE)
56+
if self.__itemSwingState:
57+
slot = (self.__swingProgress + alpha) / 8.0
58+
swingY = math.sin((slot * slot) * math.pi)
59+
swingX = math.sin(math.sqrt(slot) * math.pi)
60+
gl.glRotatef(-swingY * 20.0, 0.0, 1.0, 0.0)
61+
gl.glRotatef(-swingX * 20.0, 0.0, 0.0, 1.0)
62+
gl.glRotatef(-swingX * 80.0, 1.0, 0.0, 0.0)
63+
6064
gl.glScalef(0.4, 0.4, 0.4)
6165
gl.glBindTexture(gl.GL_TEXTURE_2D,
6266
self.__mc.renderEngine.getTexture('terrain.png'))
@@ -67,9 +71,11 @@ def renderItemInFirstPerson(self, alpha):
6771
)
6872
else:
6973
if self.__itemToRender.itemID < 256:
70-
gl.glBindTexture(gl.GL_TEXTURE_2D, self.__mc.renderEngine.getTexture('terrain.png'))
74+
gl.glBindTexture(gl.GL_TEXTURE_2D,
75+
self.__mc.renderEngine.getTexture('terrain.png'))
7176
else:
72-
gl.glBindTexture(gl.GL_TEXTURE_2D, self.__mc.renderEngine.getTexture('gui/items.png'))
77+
gl.glBindTexture(gl.GL_TEXTURE_2D,
78+
self.__mc.renderEngine.getTexture('gui/items.png'))
7379

7480
t = tessellator
7581
u0 = (self.__itemToRender.getItem().getIconIndex() % 16 << 4) / 256.0
@@ -145,14 +151,46 @@ def renderItemInFirstPerson(self, alpha):
145151

146152
t.draw()
147153
gl.glDisable(gl.GL_NORMALIZE)
154+
155+
gl.glPopMatrix()
148156
else:
149-
gl.glScalef(1.0, -1.0, -1.0)
150-
gl.glTranslatef(0.0, 0.2, 0.0)
151-
gl.glRotatef(-120.0, 0.0, 0.0, 1.0)
152-
gl.glScalef(1.0, 1.0, 1.0)
157+
gl.glPushMatrix()
158+
if self.__swingProgress == -1:
159+
self.__swingProgress += 1
160+
if self.__itemSwingState:
161+
slot = (self.__swingProgress + alpha) / 8.0
162+
swingY = math.sin(slot * math.pi)
163+
swingX = math.sin(math.sqrt(slot) * math.pi)
164+
gl.glTranslatef(-swingX * 0.3,
165+
math.sin(math.sqrt(slot) * math.pi * 2.0) * 0.4,
166+
-swingY * 0.4)
167+
168+
gl.glTranslatef(0.64000005, -0.6 - (1.0 - progress) * 0.6, -0.71999997)
169+
gl.glRotatef(45.0, 0.0, 1.0, 0.0)
170+
gl.glEnable(gl.GL_NORMALIZE)
171+
if self.__itemSwingState:
172+
slot = (self.__swingProgress + alpha) / 8.0
173+
swingY = math.sin(slot * slot * math.pi)
174+
swingX = math.sin(math.sqrt(slot) * math.pi)
175+
gl.glRotatef(swingX * 70.0, 0.0, 1.0, 0.0)
176+
gl.glRotatef(-swingY * 20.0, 0.0, 0.0, 1.0)
177+
178+
gl.glBindTexture(
179+
gl.GL_TEXTURE_2D,
180+
self.__mc.renderEngine.getTextureForDownloadableImage(
181+
self.__mc.thePlayer.skinUrl, self.__mc.thePlayer.getTexture()
182+
)
183+
)
184+
gl.glTranslatef(-0.2, -0.3, 0.1)
185+
gl.glRotatef(120.0, 0.0, 0.0, 1.0)
186+
gl.glRotatef(200.0, 1.0, 0.0, 0.0)
187+
gl.glRotatef(-135.0, 0.0, 1.0, 0.0)
188+
gl.glScalef(1.0 / 16.0, 1.0 / 16.0, 1.0 / 16.0)
189+
gl.glTranslatef(6.0, 0.0, 0.0)
190+
RenderManager.instance.getEntityRenderObject(self.__mc.thePlayer).drawFirstPersonHand()
191+
gl.glPopMatrix()
153192

154193
gl.glDisable(gl.GL_NORMALIZE)
155-
gl.glPopMatrix()
156194
RenderHelper.disableStandardItemLighting()
157195

158196
def renderOverlays(self, alpha):

0 commit comments

Comments
 (0)