Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jun 21, 2015
1 parent ffff16a commit 6d5e205
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion RaspberryJamMod.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "RaspberryJamMod"
#define MyAppVersion "0.29"
#define MyAppVersion "0.30"
#define MyAppPublisher "Omega Centauri Software"
#define MyAppURL "http://github.com/arpruss/raspberryjammod"

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "0.29"
version = "0.30"
group= "mobi.omegacentauri.raspberryjammod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RaspberryJamMod"

Expand Down
Binary file modified python2-scripts.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions python2-scripts/mcpipy/mcpi/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ def getBlockWithNBT(self, *args):
"""
@TODO
"""
# must have no NBT tags in any Block instances
def getBlocks(self, *args):
"""Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]"""
return int(self.conn.sendReceive_flat("world.getBlocks", floorFlatten(args)))

# must have no NBT tags in any Block instances
def setBlock(self, *args):
"""Set block (x,y,z,id,[data])"""
self.conn.send_flat("world.setBlock", floorFlatten(args))
Expand Down
2 changes: 1 addition & 1 deletion python2-scripts/mcpipy/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def translate(base,x,y,z):
if curBlock == block:
del todo[pos]
saved[pos] = curBlock
for pos in todo:
for pos in sorted(todo):
setBlockWithData(pos,todo[pos])
oldVehicle = newVehicle
oldPos = vehiclePos
Expand Down
Binary file modified python3-scripts.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions python3-scripts/mcpipy/mcpi/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ def getBlockWithNBT(self, *args):
"""
@TODO
"""
# must have no NBT tags in any Block instances
def getBlocks(self, *args):
"""Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]"""
return int(self.conn.sendReceive_flat("world.getBlocks", floorFlatten(args)))

# must have no NBT tags in any Block instances
def setBlock(self, *args):
"""Set block (x,y,z,id,[data])"""
self.conn.send_flat("world.setBlock", floorFlatten(args))
Expand Down
17 changes: 9 additions & 8 deletions python3-scripts/mcpipy/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#

"""
Make a moving vehicle out of whatever blocks the player is standing near.
Make a moving vehicle out of whatever blocks the player is standing near.
Add a 'b' argument if you have and want an airtight bubble in the vehicle for going underwater
Add an 'n' argument if you want (somewhat) non-destructive mode
Add an 'q' argument if you don't want the vehicle to flash red as it is scanned
The vehicle detection algorithm works as follows:
first, search for nearest non-terrain block within distance SCAN_DISTANCE of the player
second, get the largest connected set of non-terrain blocks, including diagonal connections, up to
second, get the largest connected set of non-terrain blocks, including diagonal connections, up to
distance MAX_DISTANCE in each coordinate
in bubble mode, add the largest set of air blocks, excluding diagonal connections, or a small bubble about the
player if the the vehicle is not airtight
Expand All @@ -22,7 +22,7 @@
import sys

SCAN_DISTANCE = 5
MAX_DISTANCE = 25
MAX_DISTANCE = 30

bubble = False
nondestructive = False
Expand Down Expand Up @@ -69,11 +69,11 @@ def scan(x0,y0,z0):
positions = {seed:block}
if flash:
mc.setBlock(seed,WOOL_RED)
foundAny = True
newlyAdded = set(positions.keys())

while foundAny:
foundAny = False
for q in list(positions.keys()):
while len(newlyAdded)>0:
adding = set()
for q in newlyAdded:
for x,y,z in box(-1,-1,-1,1,1,1):
pos = (x+q[0],y+q[1],z+q[2])
if pos not in positions:
Expand All @@ -86,8 +86,9 @@ def scan(x0,y0,z0):
highWater = pos[1]
else:
positions[pos] = block
adding.add(pos)
mc.setBlock(pos,WOOL_RED)
foundAny = True
newlyAdded = adding

offsets = {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class RaspberryJamMod
{
public static final String MODID = "raspberryjammod";
public static final String VERSION = "0.29";
public static final String VERSION = "0.30";
public static final String NAME = "Raspberry Jam Mod";
private APIServer mcc;
private PythonExternalCommand pythonExternalCommand = null;
Expand Down

0 comments on commit 6d5e205

Please sign in to comment.