Giter Club home page Giter Club logo

picraft's Introduction

picraft

This package provides an alternate Python API for Minecraft Pi edition on the Raspberry Pi, or Raspberry Juice on the PC for Python 2.7 (or above), or Python 3.2 (or above).

  • The code is licensed under the BSD license
  • The source code can be obtained from GitHub, which also hosts the bug tracker
  • The documentation (which includes installation, quick-start examples, and lots of code recipes) can be read on ReadTheDocs
  • Packages can be downloaded from PyPI, but reading the installation instructions is more likely to be useful

picraft's People

Contributors

safehammad avatar waveform80 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

picraft's Issues

block_hit_events: no response received

from picraft import World
from os import environ

world = World(environ["ADDR"])
world.events.main_loop()

this code causes

Traceback (most recent call last):
  File "minimal.py", line 5, in <module>
    world.events.main_loop()
  File "/usr/local/lib/python3.5/site-packages/picraft/events.py", line 376, in main_loop
    self.process()
  File "/usr/local/lib/python3.5/site-packages/picraft/events.py", line 392, in process
    for event in self.poll():
  File "/usr/local/lib/python3.5/site-packages/picraft/events.py", line 352, in poll
    events = list(player_pos_events(self._track_players)) + list(block_hit_events())
  File "/usr/local/lib/python3.5/site-packages/picraft/events.py", line 347, in block_hit_events
    s = self._connection.transact('events.block.hits()')
  File "/usr/local/lib/python3.5/site-packages/picraft/connection.py", line 298, in transact
    return self._receive(required=True)
  File "/usr/local/lib/python3.5/site-packages/picraft/connection.py", line 250, in _receive
    raise NoResponse('no response received')
picraft.exc.NoResponse: no response received

tested with Python 3.5 and this server

blocks accepts slices with non-unit step

Getting and setting blocks accepts a slice with a step other than 1,1,1 but the underlying bulk functions don't permit this. Fallback on individually enumerated gets/sets in this case.

event decorators for classes?

Not entirely sure how we can extend the event decorators to work on methods in classes. This may require an additional decorator on the class itself plus some magic to register instantiations ... should investigate this for 0.6 though.

Test coverage

Test coverage is dropping as we add more bits. Need to figure out how to accurately test the multi-threaded event handling logic, and get test coverage back up to 99% for 1.0.

Filled polygons (and circles?)

Need to add a routine (or optional parameter to lines?) to generate filled polygons. The brute force method of sorting the vectors and filling all intervening points looks okay if we use a set to remove all the duplicates (the likely use-cases aren't enormous so the memory use is unlikely to be excessive).

vector_range closed?

The half-open nature of vector_range is resulting in an awful lot of "+1"s in code. This is the sort of thing that half-open ranges were meant to avoid. Before we go plunging into 1.0 (and frankly before the package becomes too popular (assuming it ever will!)), we should think about whether there's a good argument for using closed ranges instead. It might be that the vector use-case is sufficiently different to strings et al in Python that it's justified ...

Support for getBlocks

The Raspberry Juice mod supports getting multiple blocks at a time; we should support this implicitly in the blocks getter

Raspbian packaging

The Makefile already generates these - just got to check with the Raspbian maintainers that they're happy for me to include them in the repository. Ought to do this for 0.4 to enable people to test stuff a bit more easily (that might even make 0.4 ready enough to call it 1.0).

Moar recipes!

Need lots more recipes, including ones covering absolutely basic functionality (along the lines of the introductory recipes in the Basic chapter of picamera). Wouldn't hurt to have a lot more screenshots in there too (actually it would hurt the docs package which is already several hundred kb, but oh well).

Add rotation methods

Translation and scaling of vectors is already pretty simple, just need to add decent support for rotation now. I'm thinking something along the lines of a rotate method for rotation about an arbitrary (non-origin fixed) line, and maybe derivative methods for rotation about the three axes, and rotation about an origin-fixed direction vector. Alternatively, it might be enough to provide default args to the generic method... Need to have a play and see what performs well.

Allow movement direction to be ascertained in the pi version of the game

I know that the minecraft API doesn't allow this on pi's, but does on raspberry juice.

However I know direction of movement has been implemented here:

http://www.stuffaboutcode.com/p/adventures-in-minecraft-forum.html?place=msg%2Fadventures-in-minecraft-forum%2Fxj6_42BrBAY%2FrEuwnB5gv98J

I want to try write up an algorithm to find a players direction of movement and move it into this library.

I can't have the direction I'm facing on a pi but I'd settle for movement and know others would as well.

Let me know your opinion on it.

Circle drawing algorithm (ellipse?)

We've got an implementation of Bresenham for lines - now how about another one for circles, and if possible general ellipses? There's several good references for these but they all seem to be 2D. That's probably enough for starters, but it'd be nice to have a completely generic 3D one (that can draw an ellipse on an arbitrary plane), if such a thing exists.

Sphere generator

Create a routine (similar to lines et al) for construction of spheres.

Should we also add something for cube (based on vector_range) and possibly more obscure shapes? (cuboids, ellipsoids, etc.?)

Obj loader

We need to add something like Martin's obj loader for 0.5. Probably don't need all the rotation and scaling stuff - we can defer to Vector for that. Rather it should be something brutally simple: load the obj and present it as a dict mapping vectors to blocks. For the material mapping we might to provide something a little extra - maybe a function to query all the materials used by the file, or something?

Also need to provide recipes showing how to scale/translate/rotate the resulting dict of vectors (although that should be pretty obvious from the vector tutorial, but you can bet people who want obj loading will jump past that stuff).

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.