Giter Club home page Giter Club logo

minecraft's Introduction

Minecraft

Simple Minecraft-inspired demo written in Python and Pyglet.

http://www.youtube.com/watch?v=kC3lwK631X8

Like this project?

You might also like my other Minecraft clone written in C using modern OpenGL (GL shader language). It performs better, has better terrain generation and saves state to a sqlite database. See here:

https://github.com/fogleman/Craft

Goals and Vision

I would like to see this project turn into an educational tool. Kids love Minecraft and Python is a great first language. This is a good opportunity to get children excited about programming.

The code should become well commented and more easily configurable. It should be easy to make some simple changes and see the results quickly.

I think it would be great to turn the project into more of a library / API... a Python package that you import and then use / configure to setup a world and run it. Something along these lines...

import mc

world = mc.World(...)
world.set_block(x, y, z, mc.DIRT)
mc.run(world)

The API could contain functionality for the following:

  • Easily configurable parameters like gravity, jump velocity, walking speed, etc.
  • Hooks for terrain generation.

How to Run

pip install pyglet
git clone https://github.com/fogleman/Minecraft.git
cd Minecraft
python main.py

Mac

On Mac OS X, you may have an issue with running Pyglet in 64-bit mode. Try running Python in 32-bit mode first:

arch -i386 python main.py

If that doesn't work, set Python to run in 32-bit mode by default:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes 

This assumes you are using the OS X default Python. Works on Lion 10.7 with the default Python 2.7, and may work on other versions too. Please raise an issue if not.

Or try Pyglet 1.2 alpha, which supports 64-bit mode:

pip install https://pyglet.googlecode.com/files/pyglet-1.2alpha1.tar.gz 

If you don't have pip or git

For pip:

  • Mac or Linux: install with sudo easy_install pip (Mac or Linux) - or (Linux) find a package called something like 'python-pip' in your package manager.
  • Windows: install Distribute then Pip using the linked .MSI installers.

For git:

  • Mac: install Homebrew first, then brew install git.
  • Windows or Linux: see Installing Git from the Pro Git book.

See the wiki for this project to install Python, and other tips.

How to Play

Moving

  • W: forward
  • S: back
  • A: strafe left
  • D: strafe right
  • Mouse: look around
  • Space: jump
  • Tab: toggle flying mode

Building

  • Selecting type of block to create:
    • 1: brick
    • 2: grass
    • 3: sand
  • Mouse left-click: remove block
  • Mouse right-click: create block

Quitting

  • ESC: release mouse, then close window

minecraft's People

Contributors

alexjmu avatar blainmaguire avatar fogleman avatar geppettodivacin avatar jesstess avatar marco97pa avatar onesharpace avatar progval avatar richvel avatar rmariuzzo avatar silent1mezzo avatar timgates42 avatar ubershmekel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraft's Issues

Keyboard-only support

I'm not sure if other minecraft clones do this, but it has always bugged me that you seemingly have to use a mouse. What do other people think of adding keyboard controls for changing the view axes (look/turn up, down, left, right) plus create and remove blocks (left/right mouse)?

Library "GLU" not found

I have installed pyglet, when running the main.py, a error came up saying

Traceback (most recent call last):
File "main.py", line 7, in
from pyglet.gl import *
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/init.py", line 99, in
from pyglet.gl.lib import GLException
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/lib.py", line 143, in
from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
File "/usr/local/lib/python2.7/dist-packages/pyglet/gl/lib_glx.py", line 49, in
glu_lib = pyglet.lib.load_library('GLU')
File "/usr/local/lib/python2.7/dist-packages/pyglet/lib.py", line 122, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "GLU" not found.

But I can't use pip to install the GLU library, where is the GLU library ?

Clone the code

Hello @fogleman, I'm Jason Zheng, one of the owners of Minecraft-in-python organization.

I have cloned this repository and added a lot of things.

The above all were ok, but I chose the GPLv3 as license, not MIT for the game.

This may need your permission.

But all was too late, We have created about 300 commits and added many things that it didn't have.

Wrong architecture - OS X

Running on 10.8.2 I get this error
Macbook Pro:Minecraft tibbon$ arch -i386 python main.py Traceback (most recent call last): File "main.py", line 1, in <module> from pyglet.gl import * File "/Library/Python/2.7/site-packages/pyglet/gl/__init__.py", line 510, in <module> import pyglet.window File "/Library/Python/2.7/site-packages/pyglet/window/__init__.py", line 1669, in <module> from pyglet.window.carbon import CarbonPlatform, CarbonWindow File "/Library/Python/2.7/site-packages/pyglet/window/carbon/__init__.py", line 69, in <module> framework='/System/Library/Frameworks/QuickTime.framework') File "/Library/Python/2.7/site-packages/pyglet/lib.py", line 90, in load_library return self.load_framework(kwargs['framework']) File "/Library/Python/2.7/site-packages/pyglet/lib.py", line 226, in load_framework lib = ctypes.cdll.LoadLibrary(realpath) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary return self._dlltype(name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime, 6): no suitable image found. Did find: /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture

Line 150 xrange error

Whenever I run main.py, I get an error at line 150
NameError: name 'xrange' is not defined

Unable to install pyglet

Receiving the following messages:

Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, _args, *_kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber
os.makedirs(destdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pyglet'

Storing debug log for failure in /Users/Karbon62/Library/Logs/pip.log

Not working on python 3.4 and pyglet development

Failing with:

Traceback (most recent call last):
  File "main.py", line 894, in <module>
    main()
  File "main.py", line 886, in main
    window = Window(width=800, height=600, caption='Pyglet', resizable=True)
  File "main.py", line 480, in __init__
    self.model = Model()
  File "main.py", line 150, in __init__
    self._initialize()
  File "main.py", line 159, in _initialize
    for x in xrange(-n, n + 1, s):
NameError: name 'xrange' is not defined

Mouse control works weird way

Hello Sir I love your Minecraft . Thank you for making this game.
one thing i have problem with your game.
the mouse controller doesn't move in the way that i intended to.
so i tried in different computer it has same problem how can i solve it.
please help me i really love your game.!

terrain options by commandline

No an issue, just a suggest.

added terrain option by command line params and global values. feel free to have a look, may benefit all, especially with world saving in place. (see my fork)

it all takes place in def initialize(self):

AttributeError: 'Window' object has no attribute 'get_viewport_size' on Ubuntu 18.04 LTS (64-Bit) with system-provided pyglet package

While trying to run the game in Ubuntu Linux 18.04 (64-bit) with system-provided pyglet package (python-pyglet), game fails with the following error:

$ python main.py 
Traceback (most recent call last):
  File "main.py", line 902, in <module>
    main()
  File "main.py", line 898, in main
    pyglet.app.run()
  File "/usr/lib/python2.7/dist-packages/pyglet/app/__init__.py", line 138, in run
    event_loop.run()
  File "/usr/lib/python2.7/dist-packages/pyglet/app/base.py", line 142, in run
    self._run()
  File "/usr/lib/python2.7/dist-packages/pyglet/app/base.py", line 154, in _run
    timeout = self.idle()
  File "/usr/lib/python2.7/dist-packages/pyglet/app/base.py", line 281, in idle
    window.dispatch_event('on_draw')
  File "/usr/lib/python2.7/dist-packages/pyglet/window/__init__.py", line 1220, in dispatch_event
    if EventDispatcher.dispatch_event(self, *args) != False:
  File "/usr/lib/python2.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
    if getattr(self, event_type)(*args):
  File "main.py", line 814, in on_draw
    self.set_3d()
  File "main.py", line 796, in set_3d
    viewport = self.get_viewport_size()
AttributeError: 'Window' object has no attribute 'get_viewport_size'

Pyglet and other package versions to be installed in ubuntu

libjs-underscore 1.8.3~dfsg-1
libjs-sphinxdoc 1.6.7-1ubuntu1
python-configparser 3.5.0-1
python-future 0.15.2-4ubuntu2
python-pyglet 1.3.0-1

After uninstalling system-provided pyglet package and installing pyglet through pip game works fine, also pip provides newer versions (pyglet-1.4.1 and future-0.17.1) instead.

Manager file and division between code and resources

Guys, I am writing a script to manage some tasks (compile, clean, commit and etc.). I am also seprating code and resources.

My idea is to put into this form:

Minecraft/
LICENSE
TODO.md
README.md
manager.py
src/
--all .py files here
resources/
image/
--all image files here
sound/
--al sound files here

So, what do you think? I thinked about this because I still have a lot of difficult to use the Pyglet. So I'll try to contribute with something different (and need to present a project in the university about it =D).

Python 3.5 not rendering all blocks

After a quick run of 2to3 and fixing some float/int issues, this works great on my machine!

The main issue is that not all the blocks render correctly at first. I think the logic around what's exposed is NQR somehow. When I add a block, that works fine. If I remove a block, the adjacent ones become visibly. I'm happy to put some time into debugging this, but I thought maybe it would be work contributing to a Python 3 compatibility branch or something similar. I also thought that perhaps others had run across the issue before and might have some advice for me.

Is there interest in me working on Python 3 compatibility for a potential merge later, or should I continue to just noodle around on my own machine?

Cheers! :)
-T

Link to traverseda/PyCraft

https://github.com/traverseda/PyCraft

A lot of people are interested in your project, and there are a lot of forks.

I've cloned your repo, with the intent of being a lot more accepting of pull requests. We've already got the start of an object-oriented block system and a perlin noise based terrain generator.

There's a lot of interesting stuff people could do with this project, but most of them would hurt the intent. Would make it less useful as a teaching tool, and obviously would push the line count waay higher.

I don't mind submitting a pull request, but I wanted to make sure you're amenable to this kind of thing before doing it.

ConfigParser.NoSectionError: No section: 'Controls'

Does anyone else got this error? Aparently this section 'Controls' is being used but don't exist. Below is the terminal message:

Traceback (most recent call last):
File "main.py", line 1207, in
main(options)
File "main.py", line 1171, in main
resizable=True, save=save_object, vsync=False)
File "main.py", line 633, in init
self.key_move_forward = config.getint('Controls', 'move_forward')
File "/usr/lib/python2.7/ConfigParser.py", line 359, in getint
return self._get(section, int, option)
File "/usr/lib/python2.7/ConfigParser.py", line 356, in _get
return conv(self.get(section, option))
File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'Controls'

Server Support

Hello!

I was wondering if you'd consider porting the server.py file from your Craft repo to support this. I think it would be useful for learning how networking works with python, and it could be cool to play this with friends, given how it can easily be modified.

Connecting to servers could be done via command line arguments (py main.py -S <IP>).

Thanks!

EDIT: For reference: https://github.com/fogleman/Craft/blob/master/server.py

Command Line Arguments

As this repository's goal is to turn into an educational tool, I believe that command line arguments are essential for students to learn about. By recognizing how to allow users to interact with our programs, we push to develop a programmer's sense of community and empathy. Let me know what you think. For reference, see #77.

Chris

Game freeze Linux Mint 64bit Oracle JVM

I am running Linux Mint (fork of Ubuntu) 64bit v14 with Java Oracle v1.7.0_11 installed. I installed Pyglet from source without issues. Game starts no problem with "python main.py" command. I see a blue screen for about 3 seconds then I see the whole environment. I begin to move my character around for about 2 steps and then the screen locks up on me. I have also tried the arch -i386 command with no luck. I have to end up killing process through terminal.

I know most of you are all running on OSX, but not sure if anyone else tried it with my configuration and got game running?

Dual License MIT and GPLv3?

Hi Michael,

I am working on a fork (https://github.com/spillz/minepy) that for now I want to license as GPL v3. I don't think that anything in the original MIT license precludes licensing my contributions this way, but to prevent confusion I would prefer to just list the license as GPL v3 rather than list both licenses. Are you willing to allow me to license your parts of my fork as GPL v3 instead of the MIT license? (I will continue to list you as one of the copyright holders, of course)

Thanks.

PS: In case its confusing why I would want to do this:
http://stackoverflow.com/questions/4035702/can-i-relicense-someones-mit-code-under-gpl
PPS: GPLv3 isn't a religious issue for me, just currently how I choose to license most of my open source code.

ImportError: No module named 'future' -Python 3.5

Error cut and pasted:

Failed to get python-future
Traceback (most recent call last):
  File "C:\Python3.5\lib\site-packages\pyglet\__init__.py", line 44, in <module>
    import future
ImportError: No module named 'future'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\mfonner12\Downloads\Minecraft-master\main.py", line 6, in <module>
    from pyglet import image
  File "C:\Python3.5\lib\site-packages\pyglet\__init__.py", line 56, in <module>
    import future
ImportError: No module named 'future'`

Umm IDK how do i fix

---- Minecraft Crash Report ----
// Ooh. Shiny.

Time: 3/14/16 6:54 PM
Description: Rendering entity in world

java.lang.ClassCastException: net.minecraft.client.model.ModelBiped cannot be cast to noppes.mpm.client.model.ModelMPM
at noppes.mpm.client.RenderMPM.setEntity(RenderMPM.java:420)
at noppes.mpm.client.RenderEvent.pre(RenderEvent.java:78)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_240_RenderEvent_pre_Pre.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraft.client.renderer.entity.RenderPlayer.func_76986_a(RenderPlayer.java:131)
at net.minecraft.client.renderer.entity.RenderPlayer.func_76986_a(RenderPlayer.java:521)
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:293)
at net.minecraft.client.renderer.entity.RenderManager.func_147940_a(RenderManager.java:276)
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(SourceFile:91)
at net.aetherteam.aether.client.gui.inventory.GuiContainerAccessories.func_73863_a(GuiContainerAccessories.java:89)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
at noppes.mpm.client.EntityRendererAlt.func_78480_b(EntityRendererAlt.java:34)
at net.minecraft.client.Minecraft.func_71411_J(Unknown Source)
at net.minecraft.client.Minecraft.func_99999_d(Unknown Source)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head --
Stacktrace:
at noppes.mpm.client.RenderMPM.setEntity(RenderMPM.java:420)
at noppes.mpm.client.RenderEvent.pre(RenderEvent.java:78)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_240_RenderEvent_pre_Pre.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraft.client.renderer.entity.RenderPlayer.func_76986_a(RenderPlayer.java:131)
at net.minecraft.client.renderer.entity.RenderPlayer.func_76986_a(RenderPlayer.java:521)

-- Entity being rendered --
Details:
Entity Type: null (micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP)
Entity ID: 159
Entity Name: TheButterKing354
Entity's Exact location: -87.33, 65.62, 294.45
Entity's Block location: World: (-88,65,294), Chunk: (at 8,4,6 in -6,18; contains blocks -96,0,288 to -81,255,303), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Entity's Momentum: 0.00, -0.08, 0.00

-- Renderer details --
Details:
Assigned renderer: stevekung.mods.moreplanets.core.todo.RenderPlayerMP@2cb2c09
Location: 0.00,0.00,0.00 - World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Rotation: 0.0
Delta: 1.0
Stacktrace:
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:293)
at net.minecraft.client.renderer.entity.RenderManager.func_147940_a(RenderManager.java:276)
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(SourceFile:91)
at net.aetherteam.aether.client.gui.inventory.GuiContainerAccessories.func_73863_a(GuiContainerAccessories.java:89)

-- Screen render details --
Details:
Screen name: net.aetherteam.aether.client.gui.inventory.GuiContainerAccessories
Mouse location: Scaled: (360, 19). Absolute: (720, 662)
Screen size: Scaled: (683, 351). Absolute: (1366, 702). Scale factor of 2
Stacktrace:
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [GCEntityClientPlayerMP['TheButterKing354'/159, l='MpServer', x=-87.33, y=65.62, z=294.45]]
Chunk stats: MultiplayerChunkCache: 438, 438
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options:
Level spawn location: World: (125,4,105), Chunk: (at 13,0,9 in 7,6; contains blocks 112,0,96 to 127,255,111), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 24061 game time, 24061 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 26 total; [EntityHuman['Alisa the Shepherd'/88709, l='MpServer', x=-112.16, y=65.00, z=290.38], EntityHuman['Diego the Farmer'/88711, l='MpServer', x=-119.63, y=64.00, z=291.94], EntityHuman['Mara the Shepherd'/88712, l='MpServer', x=-110.44, y=65.00, z=300.31], EntityHuman['Britt the Baker'/88971, l='MpServer', x=-135.75, y=64.00, z=295.69], EntityHuman['Jaiden the Fisherman'/88714, l='MpServer', x=-118.41, y=65.00, z=300.25], EntityHuman['Ted the Guard'/90125, l='MpServer', x=-110.50, y=65.00, z=302.75], EntityGoron['Goron'/88972, l='MpServer', x=-150.50, y=65.00, z=303.00], EntityHuman['Wilson the Guard'/90127, l='MpServer', x=-137.25, y=65.00, z=312.28], EntityHuman['Zac the Guard'/90126, l='MpServer', x=-122.33, y=64.00, z=286.70], EntityHuman['Lily the Shepherd'/88723, l='MpServer', x=-115.22, y=64.00, z=294.50], EntityHuman['Yvette the Shepherd'/88725, l='MpServer', x=-124.25, y=64.00, z=283.59], EntityHuman['Talitha the Shepherd'/88727, l='MpServer', x=-119.28, y=64.00, z=284.50], EntityHuman['Aaron the Miner'/88734, l='MpServer', x=-126.63, y=65.00, z=314.72], EntityHuman['Drew the Fisherman'/88738, l='MpServer', x=-125.34, y=64.00, z=308.00], EntityHuman['Carly the Farmer'/88740, l='MpServer', x=-127.34, y=65.00, z=310.84], EntityHuman['Abrielle the Baker'/88742, l='MpServer', x=-124.63, y=65.00, z=298.09], EntityHuman['Teri the Shepherd'/88744, l='MpServer', x=-124.50, y=65.00, z=296.94], EntityHuman['Brisa the Shepherd'/88746, l='MpServer', x=-128.50, y=64.00, z=295.03], EntityHuman['Emmy the Guard'/88755, l='MpServer', x=-113.50, y=65.00, z=288.72], EntityHuman['Troy the Guard'/88754, l='MpServer', x=-123.13, y=65.00, z=303.50], EntityHuman['Ira the Toolsmith'/88759, l='MpServer', x=-124.34, y=64.00, z=307.30], EntityHuman['Dixie the Shepherd'/88761, l='MpServer', x=-128.72, y=65.00, z=293.06], EntityHuman['Toby the Fisherman'/88764, l='MpServer', x=-139.09, y=66.00, z=307.54], GCEntityClientPlayerMP['TheButterKing354'/159, l='MpServer', x=-87.33, y=65.62, z=294.45], EntityHuman['Paolo the Guard'/90591, l='MpServer', x=-125.00, y=64.00, z=285.00], EntityTrail['unknown'/502, l='MpServer', x=-87.33, y=65.62, z=294.45]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373)
at net.minecraft.client.Minecraft.func_71396_d(Unknown Source)
at net.minecraft.client.Minecraft.func_99999_d(Unknown Source)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 2865488056 bytes (2732 MB) / 5086642176 bytes (4851 MB) up to 5086642176 bytes (4851 MB)
JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx5000M -Xms5000M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 49 mods loaded, 49 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA mcp{9.05} Minecraft Coder Pack
UCHIJAAAA FML{7.10.99.99} Forge Mod Loader
UCHIJAAAA Forge{10.13.4.1614} Minecraft Forge
UCHIJAAAA Micdoodlecore{} Micdoodle8 Core
UCHIJAAAA MorePlanetsASM{} More Planets Core
UCHIJAAAA TooManyItems{1.7.10} TooManyItems
UCHIJAAAA mod_ThreadedLighting{1.7.10-1.0} Threaded Lighting
UCHIJAAAA gilded-games-util{1.7.10-1.2} Gilded Games Utility
UCHIJAAAA OreSpawn{1.7.10.20.3} [OreSpawn](1.7.10 orespawn)
UCHIJAAAA battlegear2{1.7.10} [Mine & Blade Battlegear 2 - Bullseye](1.7.10-MB_Battlegear2-Bullseye-1.0.8.2 %281%29.jar)
UCHIJAAAA zeldaswordskills{1.7.10-2.3.1} Zelda Sword Skills
UCHIJAAAA grim3212core{V0.2 - 1.7.10} [Grim3212 Core](Grim3212 Core-V0.2 - 1.7.10.jar)
UCHIJAAAA superslopes{V0.1 - 1.7.10} Super Slopes
UCHIJAAAA lightsabers{0.7.1} Advanced Lightsabers Mod
UCHIJAAAA Baubles{1.0.1.10} Baubles
UCHIJAAAA adventurebackpack{1.7.10-0.8b} Adventure Backpack
UCHIJAAAA aether{1.7.10-1.6} Aether II
UCHIJAAAA MovingWorld{1.7.10-1.8} [Moving World](movingworld-1.7.10-1.8 %282%29.jar)
UCHIJAAAA ArchimedesShipsPlus{1.7.10-1.8} [Archimedes' Ships Plus](archimedesshipsplus-1.7.10-1.8 %282%29.jar)
UCHIJAAAA BiblioCraft{1.11.4} BiblioCraft
UCHIJAAAA ComputerCraft{1.75} ComputerCraft
UCHIJAAAA CosmeticArmor{1.0.5} Cosmetic Armor
UCHIJAAAA customnpcs{1.7.10d} CustomNpcs
UCHIJAAAA DamageIndicatorsMod{3.2.0} Damage Indicators
UCHIJAAAA PTRModelLib{1.0.0} [PTRModelLib](Decocraft-2.2.1_1.7.10 %281%29.jar)
UCHIJAAAA props{2.2.1} [Decocraft](Decocraft-2.2.1_1.7.10 %281%29.jar)
UCHIJAAAA DragonMounts{r39} [Dragon Mounts](Dragon-Mounts-Mod-1.7.10 %281%29.jar)
UCHIJAAAA fairylights{1.4.0} Fairy Lights
UCHIJAAAA GalacticraftCore{3.0.12} Galacticraft Core
UCHIJAAAA GalacticraftMars{3.0.12} Galacticraft Planets
UCHIJAAAA iChunUtil{4.2.2} [iChunUtil](iChunUtil-4.2.2 %281%29.jar)
UCHIJAAAA GraviGun{4.0.0-beta} [GraviGun](GravityGun-4.0.0-beta %281%29.jar)
UCHIJAAAA SlimevoidLib{2.0.4.7} [Slimevoid Library](SlimevoidLibrary-2.0.4.7 %281%29.jar)
UCHIJAAAA LittleBlocks{2.2.4.4} [Little Blocks](LittleBlocks-2.2.4.4 %281%29.jar)
UCHIJAAAA RadixCore{2.1.1} RadixCore
UCHIJAAAA MCA{1.7.10-5.1.1.1} Minecraft Comes Alive
UCHIJAAAA numina{0.4.0.131} Numina
UCHIJAAAA powersuits{0.11.0.294} MachineMuse's Modular Powersuits
UCHIJAAAA MorePlanet{1.3.0} More Planets
UCHIJAAAA moreplayermodels{1.7.10} MorePlayerModels
UCHIJAAAA openmodularturrets{2.1.8-199} Open Modular Turrets
UCHIJAAAA harvestcraft{1.7.10j} [Pam's HarvestCraft](Pam's HarvestCraft 1.7.10Lb.jar)
UCHIJAAAA PortalGun{4.0.0-beta-6} [PortalGun](PortalGun-4.0.0-beta-6 %281%29.jar)
UCHIJAAAA ReiMinimap{1.7.10} Rei's Minimap
UCHIJAAAA corerm{1.0c} [RikMuld's Core](RikMuldsCore_1.0c %281%29.jar)
UCHIJAAAA secretroomsmod{4.7.1} The SecretRoomsMod
UCHIJAAAA SC0_SpaceCore{0.7.8} SpaceCore
UCHIJAAAA universalcoins{1.7.10-1.5.4} Universal Coins
UCHIJAAAA weaponmod{v1.14.3} [Balkon's WeaponMod](weaponmod-1.14.3 %281%29.jar)
GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4331' Renderer: 'Intel(R) HD Graphics 4400'
Launched Version: 1.7.10-Forge10.13.4.1614-1.7.10
LWJGL: 2.9.1
OpenGL: Intel(R) HD Graphics 4400 GL version 4.3.0 - Build 20.19.15.4331, Intel
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

Screen rotation bug

In one of tests, the mouse was "locked", so I couldn't rotate the character. It happened after I quit the game in a hole and return (used the save file).

Forge server closes

when i open the forge universal.jar file it loads up but then crashes again after a few seconds. i have changed the eula but still doesnt work

STUPID

STUPID, but good for a beginner who is trying to code! Good job even though I can't run it

Use numpy for terrain generation.

Numpy is fast. Numpy is perfect for calculus on large multi-dimensional arrays.

To avoid getting terrain generation as slow as in the original Minecraft, we have to get rid of such nested loops as in Model.initialize.

This could also speedup gravity calculation in the future.

Failed to create drawable

Hi,

Minecraft won't start and gives the following blurb:

[bert@draaikolk Minecraft]$ python main.py
failed to create drawable
Traceback (most recent call last):
File "main.py", line 7, in
from pyglet.gl import *
File "/usr/lib/python2.6/site-packages/pyglet/gl/init.py", line 510, in
import pyglet.window
File "/usr/lib/python2.6/site-packages/pyglet/window/init.py", line 1684, in
gl._create_shadow_window()
File "/usr/lib/python2.6/site-packages/pyglet/gl/init.py", line 494, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/init.py", line 474, in init
super(XlibWindow, self).init(_args, *_kwargs)
File "/usr/lib/python2.6/site-packages/pyglet/window/init.py", line 686, in init
self._create()
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/init.py", line 683, in _create
self.switch_to()
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/init.py", line 781, in switch_to
self._context.set_current()
File "/usr/lib/python2.6/site-packages/pyglet/gl/init.py", line 345, in set_current
self._info.set_active_context()
File "/usr/lib/python2.6/site-packages/pyglet/gl/gl_info.py", line 91, in set_active_context
self.vendor = cast(glGetString(GL_VENDOR), c_char_p).value
File "/usr/lib/python2.6/site-packages/pyglet/gl/lib.py", line 105, in errcheck
raise GLException(msg)
pyglet.gl.lib.GLException: invalid value

Running on Fedora 13 with:
python-2.6.4-27.fc13.i686
python-pip-0.8-1.fc13.noarch
pyglet-1.1.4-1.fc13.noarch

Doesn't work using Mac

I have tried to get the game working on mac but using your suggestion it wasn't work.
It worked instead installing pyglet as follows:

pip install pyobjc
pip install hg+https://pyglet.googlecode.com/hg/

pyglet.gl.ContextException: Could not create GL context on Python3.4

Works flawlessly with python2, but with python3 this error appears:

> python3 main.py
Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from pyglet.gl import *
  File "/usr/lib/python3.4/site-packages/pyglet/gl/__init__.py", line 236, in <module>
    import pyglet.window
  File "/usr/lib/python3.4/site-packages/pyglet/window/__init__.py", line 1816, in <module>
    gl._create_shadow_window()
  File "/usr/lib/python3.4/site-packages/pyglet/gl/__init__.py", line 205, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "/usr/lib/python3.4/site-packages/pyglet/window/xlib/__init__.py", line 163, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/pyglet/window/__init__.py", line 515, in __init__
    context = config.create_context(gl.current_context)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 186, in create_context
    return XlibContextARB(self, share)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 300, in __init__
    super(XlibContext13, self).__init__(config, share)
  File "/usr/lib/python3.4/site-packages/pyglet/gl/xlib.py", line 203, in __init__
    raise gl.ContextException('Could not create GL context') 
pyglet.gl.ContextException: Could not create GL context
> uname -a 
Linux 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux

Framerate Ticker

I believe this repository would benefit from a framerate ticker. I've implemented and made a pull request that includes this feature. It will help gauge our changes and how they affect functionality and performance. Let me know if you believe this can be implemented in a better way. See #77 for details.

Chris

Can't lunch main.py

I am trying to run this app on OS X with python 2.7 and got these errors:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from pyglet.gl import *
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/__init__.py", line 97, in <module>
    from pyglet.gl.lib import GLException
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/lib.py", line 140, in <module>
    from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
  File "/usr/local/lib/python2.7/site-packages/pyglet/gl/lib_agl.py", line 43, in <module>
    import pyglet.lib
  File "/usr/local/lib/python2.7/site-packages/pyglet/lib.py", line 57, in <module>
    script_path = pyglet.resource.get_script_home()
  File "/usr/local/lib/python2.7/site-packages/pyglet/__init__.py", line 357, in __getattr__
    __import__(import_name)
  File "/usr/local/lib/python2.7/site-packages/pyglet/resource.py", line 93, in <module>
    import zipfile
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

When I started it with python3 I got this

2016-06-26 15:56:25.690 Python[22764:645602] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/w1/1bjqb5zs3c9b9dv397qw91qh0000gn/T/org.python.python.savedState
Traceback (most recent call last):
  File "main.py", line 894, in <module>
    main()
  File "main.py", line 886, in main
    window = Window(width=800, height=600, caption='Pyglet', resizable=True)
  File "main.py", line 480, in __init__
    self.model = Model()
  File "main.py", line 150, in __init__
    self._initialize()
  File "main.py", line 159, in _initialize
    for x in xrange(-n, n + 1, s):
NameError: name 'xrange' is not defined

Any ideas what can be wrong?

Re-structure the project tree

Guys, what do you think about re-structure the project tree? I am reading the code and I believe it is very confusing (class Player defined in main.py, for example).

Whatching some Python projects, I saw people doing something like:

project_name/
bin/
docs/
project_name/ #this is the equivalent to the src/ package in Java projects
setup.py
main.py
README.md
...

So, what do you think?

Can not run main.py

As i followed the steps, i got stuck when running the main.py
[root@ip-10-0-7-118 Minecraft]# python main.py
Traceback (most recent call last):
File "main.py", line 7, in
from pyglet.gl import *
File "/usr/lib/python2.7/site-packages/pyglet/gl/init.py", line 97, in
from pyglet.gl.lib import GLException
File "/usr/lib/python2.7/site-packages/pyglet/gl/lib.py", line 142, in
from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
File "/usr/lib/python2.7/site-packages/pyglet/gl/lib_glx.py", line 50, in
gl_lib = pyglet.lib.load_library('GL')
File "/usr/lib/python2.7/site-packages/pyglet/lib.py", line 160, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "GL" not found.
Can you tell me how to fix it please?
I'm running python 2.7.5 on Centos 7.2

Python version?

What version of python is recommended for running this?

I just tried Python 3.2 and got this:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from pyglet.gl import *
  File "/usr/lib64/python3.2/site-packages/pyglet/__init__.py", line 249
    print '%s%s %s' % (indent, name, location)
                  ^
SyntaxError: invalid syntax

Trademark issues?

I really like this project, and I'm wondering if we should give it a different name, as Minecraft is trademarked. (Notch might be ok with it, but I'd rather we not wait for him to tell us)

Support for liquids

How would you handle water and lava? To make water translucent and allow blocks to be placed through both?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.