Skip to content

Commit

Permalink
option to detect left click
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Sep 10, 2015
1 parent 5d96f6f commit 1443850
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 4 deletions.
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.42"
version = "0.43"
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.
1 change: 1 addition & 0 deletions python2-scripts/mcpipy/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def err():
# mc.conn.send("world.spawnParticle", "footstep", center, 0.0,0.0,0.0, 0, 1)

mc.conn.send("events.setting","restrict_to_sword",0)
mc.conn.send("events.setting","detect_left_click",1)

mc.postToChat("Will be drawing {} copies".format(1+len(transforms)))

Expand Down
Binary file modified python3-scripts.zip
Binary file not shown.
1 change: 1 addition & 0 deletions python3-scripts/mcpipy/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def err():
# mc.conn.send("world.spawnParticle", "footstep", center, 0.0,0.0,0.0, 0, 1)

mc.conn.send("events.setting","restrict_to_sword",0)
mc.conn.send("events.setting","detect_left_click",1)

mc.postToChat("Will be drawing {} copies".format(1+len(transforms)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,11 @@ else if (setting.equals("pause_drawing")) // across connections
// name_tags not supported
}
else if (cmd.equals(EVENTSSETTING)) {
if (scan.next().equals("restrict_to_sword")) // across connections
String setting = scan.next();
if (setting.equals("restrict_to_sword")) // across connections
eventHandler.setRestrictToSword(scan.nextInt() != 0);
else if (setting.equals("detect_left_click")) // across connections
eventHandler.setDetectLeftClick(scan.nextInt() != 0);
}
else if (cmd.startsWith("camera.")) {
cameraCommand(cmd.substring(7), scan);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ abstract public class MCEventHandler {
private static final int MAX_HITS = 512;
private volatile boolean stopChanges = false;
private volatile boolean restrictToSword = true;
private volatile boolean detectLeftClick = false;
protected volatile boolean pause = false;
private ServerChatEvent chatEvents;
protected static final int MAX_CHATS = 512;
protected boolean doRemote;

public MCEventHandler() {
detectLeftClick = RaspberryJamMod.leftClickToo;
}

public void setStopChanges(boolean stopChanges) {
this.stopChanges = stopChanges;
Expand All @@ -77,7 +82,7 @@ public void onPlayerInteractEvent(PlayerInteractEvent event) {
return;

if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK ||
(RaspberryJamMod.leftClickToo && event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK)) {
(detectLeftClick && event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK)) {
if (! restrictToSword || holdingSword(event.entityPlayer)) {
synchronized(hits) {
if (hits.size() >= MAX_HITS)
Expand Down Expand Up @@ -296,4 +301,8 @@ public String getDescription() {
public void setPause(boolean b) {
pause = b;
}

public void setDetectLeftClick(boolean b) {
detectLeftClick = b;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
public class RaspberryJamMod
{
public static final String MODID = "raspberryjammod";
public static final String VERSION = "0.42";
public static final String VERSION = "0.43";
public static final String NAME = "Raspberry Jam Mod";
private APIServer fullAPIServer = null;
private PythonExternalCommand pythonExternalCommand = null;
Expand Down

0 comments on commit 1443850

Please sign in to comment.