Skip to content

Commit

Permalink
win32move
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jul 1, 2016
1 parent b7e0e6c commit 6eaccd9
Show file tree
Hide file tree
Showing 26 changed files with 139 additions and 19 deletions.
Binary file modified 110/.gradle/2.7/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified 110/.gradle/2.7/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified 110/.gradle/2.7/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified 110/.gradle/2.7/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified 110/.gradle/2.7/taskArtifacts/taskArtifacts.bin
Binary file not shown.
9 changes: 5 additions & 4 deletions 110/.gradle/gradle.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ This mapping 'snapshot_20160618' was designed for MC 1.9.4! Use at your own peri
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava UP-TO-DATE
:sourceMainJava
:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

:processResources UP-TO-DATE
:processResources
:classes
:jar
:sourceTestJava UP-TO-DATE
Expand All @@ -39,12 +39,13 @@ Note: Recompile with -Xlint:unchecked for details.
:reobfJar
:extractRangemapReplacedMain
C:\Devel\mc\110\build\sources\main\java
:retromapReplacedMain UP-TO-DATE
:retromapReplacedMain
remapping source...
:sourceJar
:assemble
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 22.823 secs
Total time: 56.947 secs
2 changes: 1 addition & 1 deletion 110/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "0.73"
version = "0.74"
group= "mobi.omegacentauri.raspberryjammod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RaspberryJamMod"

Expand Down
3 changes: 3 additions & 0 deletions 110/fast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ rm build/libs/Raspberr*.jar
rm build/libs/Raspberry*ources.jar
mv build/libs/Raspberr* build/libs/RaspberryJamMod.jar
mkdir $APPDATA/.minecraft/mods/1.10
mkdir $APPDATA/.minecraft/mods/1.10.2
cp build/libs/RaspberryJamMod.jar $APPDATA/.minecraft/mods/1.10/
cp build/libs/RaspberryJamMod.jar $APPDATA/.minecraft/mods/1.10.2/


2 changes: 1 addition & 1 deletion 19/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "0.73"
version = "0.74"
group= "mobi.omegacentauri.raspberryjammod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RaspberryJamMod"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class APIHandler {
protected PrintWriter writer = null;
protected boolean includeNBTWithData = false;
protected boolean havePlayer;
protected int playerId;
protected int playerId = 0;
protected EntityPlayerMP playerMP;
protected List<String> usernames = null;
protected List<String> passwords = null;
Expand Down Expand Up @@ -227,15 +227,20 @@ protected boolean setup() {
if (playerMP == null || id < firstId) {
firstId = id;
playerMP = (EntityPlayerMP)p;
playerId = id;
}
}
}
}
if (playerMP == null) {
// This check could be removed, but a connection to a server while there is no
// player on the server is more likely to be a hacking attempt, and so we'll
// wait for a player.
fail("Player not found");
return false;
}
havePlayer = true;
if (playerMP != null)
havePlayer = true;
}
return true;
}
Expand Down Expand Up @@ -465,7 +470,10 @@ else if (cmd.equals(SETBLOCKS)) {
eventHandler.queueServerAction(setState);
}
else if (cmd.startsWith("player.")) {
entityCommand(playerId, cmd.substring(7), scan);
if (havePlayer)
entityCommand(playerId, cmd.substring(7), scan);
else
fail("Do not seem to have a player");
}
else if (cmd.startsWith("entity.")) {
entityCommand(scan.nextInt(), cmd.substring(7), scan);
Expand Down Expand Up @@ -505,7 +513,10 @@ else if (cmd.equals(WORLDGETPLAYERID)) {
}
else {
// unofficial API to get current player ID
sendLine(playerId);
if (havePlayer)
sendLine(playerId);
else
fail("Have not yet found a player.");
}
}
else if (cmd.equals(WORLDDELETEENTITY)) {
Expand Down Expand Up @@ -648,6 +659,8 @@ protected void spawnParticle(Scanner scan) {
}

protected void cameraCommand(String cmd, Scanner scan) {
if (! havePlayer)
fail("Do not have a player (yet?)");
if (cmd.equals(GETENTITYID)) {
sendLine(playerMP.getSpectatingEntity().getEntityId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
public class RaspberryJamMod
{
public static final String MODID = "raspberryjammod";
public static final String VERSION = "0.73";
public static final String VERSION = "0.74";
public static final String NAME = "Raspberry Jam Mod";
private APIServer fullAPIServer = null;
private PythonExternalCommand pythonExternalCommand = null;
Expand Down
Binary file modified 194/.gradle/2.7/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified 194/.gradle/2.7/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified 194/.gradle/2.7/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified 194/.gradle/2.7/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified 194/.gradle/2.7/taskArtifacts/taskArtifacts.bin
Binary file not shown.
9 changes: 5 additions & 4 deletions 194/.gradle/gradle.log
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava UP-TO-DATE
:sourceMainJava
:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

:processResources UP-TO-DATE
:processResources
:classes
:jar
:sourceTestJava UP-TO-DATE
Expand All @@ -37,12 +37,13 @@ Note: Recompile with -Xlint:unchecked for details.
:reobfJar
:extractRangemapReplacedMain
C:\Devel\mc\194\build\sources\main\java
:retromapReplacedMain UP-TO-DATE
:retromapReplacedMain
remapping source...
:sourceJar
:assemble
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 23.371 secs
Total time: 58.632 secs
2 changes: 1 addition & 1 deletion 194/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "0.73"
version = "0.74"
group= "mobi.omegacentauri.raspberryjammod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RaspberryJamMod"

Expand Down
3 changes: 2 additions & 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.73"
#define MyAppVersion "0.74"
#define MyAppPublisher "Omega Centauri Software"
#define MyAppURL "http://github.com/arpruss/raspberryjammod"

Expand Down Expand Up @@ -39,6 +39,7 @@ Source: "build\libs\RaspberryJamMod.jar"; DestDir: "{userappdata}\.minecraft\mod
Source: "19\build\libs\RaspberryJamMod.jar"; DestDir: "{userappdata}\.minecraft\mods\1.9\"
Source: "194\build\libs\RaspberryJamMod.jar"; DestDir: "{userappdata}\.minecraft\mods\1.9.4\"
Source: "110\build\libs\RaspberryJamMod.jar"; DestDir: "{userappdata}\.minecraft\mods\1.10\"
Source: "110\build\libs\RaspberryJamMod.jar"; DestDir: "{userappdata}\.minecraft\mods\1.10.2\"
Source: "py27\*"; DestDir: "{userappdata}\.minecraft\python27"; Flags: createallsubdirs recursesubdirs; Components: Python27

[Components]
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.73"
version = "0.74"
group= "mobi.omegacentauri.raspberryjammod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RaspberryJamMod"

Expand Down
2 changes: 2 additions & 0 deletions go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ mkdir build/out/1.8.9
mkdir build/out/1.9
mkdir build/out/1.9.4
mkdir build/out/1.10
mkdir build/out/1.10.2
cp build/libs/RaspberryJamMod.jar build/out/1.8/
cp build/libs/RaspberryJamMod.jar build/out/1.8.8/
cp build/libs/RaspberryJamMod.jar build/out/1.8.9/
cp 19/build/libs/RaspberryJamMod.jar build/out/1.9/
cp 194/build/libs/RaspberryJamMod.jar build/out/1.9.4/
cp 110/build/libs/RaspberryJamMod.jar build/out/1.10/
cp 110/build/libs/RaspberryJamMod.jar build/out/1.10.2/
(cd build/out && zip -9r ../mods *)
./makesetup.sh
Binary file modified python2-scripts.zip
Binary file not shown.
51 changes: 51 additions & 0 deletions python2-scripts/mcpipy/win32move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# (c) 2016 A. R. Pruss. MIT License.
#
from mc import *
from time import sleep
import win32con,win32api

mc = Minecraft()

lastPlatform = None
lastPlatformBlock = None

UNSOLID = set([WATER_FLOWING.id,WATER_STATIONARY.id,AIR.id,LAVA_FLOWING.id,LAVA_STATIONARY.id])

while True:
pos = mc.player.getTilePos()
move = False
if win32api.GetAsyncKeyState(win32con.VK_NEXT):
pos.y -= 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_PRIOR):
pos.y += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_LEFT):
pos.x += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_RIGHT):
pos.x -= 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_UP):
pos.z += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_DOWN):
pos.z -= 1
move = True
if move:
block = mc.getBlock(pos.x,pos.y-1,pos.z)
if block in UNSOLID:
drew = Vec3(pos.x,pos.y-1,pos.z)
mc.setBlock(drew,GLASS)
else:
drew = None
mc.player.setTilePos(pos)
if lastPlatform and (not drew or lastPlatform != drew):
mc.setBlock(lastPlatform,AIR)
lastPlatform = None
if drew:
lastPlatform = drew
lastPlatformBlock = block
sleep(0.2)

Binary file modified python3-scripts.zip
Binary file not shown.
48 changes: 48 additions & 0 deletions python3-scripts/mcpipy/win32move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from mc import *
from time import sleep
import win32con,win32api

mc = Minecraft()

lastPlatform = None
lastPlatformBlock = None

UNSOLID = set([WATER_FLOWING.id,WATER_STATIONARY.id,AIR.id,LAVA_FLOWING.id,LAVA_STATIONARY.id])

while True:
pos = mc.player.getTilePos()
move = False
if win32api.GetAsyncKeyState(win32con.VK_NEXT):
pos.y -= 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_PRIOR):
pos.y += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_LEFT):
pos.x += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_RIGHT):
pos.x -= 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_UP):
pos.z += 1
move = True
if win32api.GetAsyncKeyState(win32con.VK_DOWN):
pos.z -= 1
move = True
if move:
block = mc.getBlock(pos.x,pos.y-1,pos.z)
if block in UNSOLID:
drew = Vec3(pos.x,pos.y-1,pos.z)
mc.setBlock(drew,GLASS)
else:
drew = None
mc.player.setTilePos(pos)
if lastPlatform and (not drew or lastPlatform != drew):
mc.setBlock(lastPlatform,AIR)
lastPlatform = None
if drew:
lastPlatform = drew
lastPlatformBlock = block
sleep(0.2)

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

0 comments on commit 6eaccd9

Please sign in to comment.