Skip to content

Commit

Permalink
flushing fix improved
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jun 26, 2016
1 parent 4954f0a commit b7e0e6c
Show file tree
Hide file tree
Showing 18 changed files with 9 additions and 6 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.
2 changes: 1 addition & 1 deletion 110/.gradle/gradle.log
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ C:\Devel\mc\110\build\sources\main\java

BUILD SUCCESSFUL

Total time: 34.344 secs
Total time: 22.823 secs
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.
2 changes: 1 addition & 1 deletion 194/.gradle/gradle.log
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ C:\Devel\mc\194\build\sources\main\java

BUILD SUCCESSFUL

Total time: 42.83 secs
Total time: 23.371 secs
Binary file modified python2-scripts.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion python2-scripts/mcpipy/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import mcpi.block as block
import server
import sys
mc = minecraft.Minecraft.create(server.address)
mc = minecraft.Minecraft()
mc.postToChat("Hello world!")
playerPos = mc.player.getPos()
mc.setBlock(playerPos.x,playerPos.y-1,playerPos.z,block.DIAMOND_ORE)
2 changes: 1 addition & 1 deletion python2-scripts/mcpipy/mcpi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Connection:
RequestFailed = "Fail"

def __init__(self, address=None, port=None):
self.windows = (platform.system() == "Windows" or platform.system().startswith("CYGWIN_NT"))
if address==None:
try:
address = os.environ['MINECRAFT_API_HOST']
Expand All @@ -35,7 +36,6 @@ def __init__(self, address=None, port=None):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((address, port))
self.readFile = self.socket.makefile("r")
self.windows = (platform.system() == "Windows" or platform.system().startswith("CYGWIN_NT"))
self.lastSent = ""
if self.windows:
atexit.register(self.close)
Expand Down
Binary file modified python3-scripts.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion python3-scripts/mcpipy/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import mcpi.block as block
import server
import sys
mc = minecraft.Minecraft.create(server.address)
mc = minecraft.Minecraft()
mc.postToChat("Hello world!")
playerPos = mc.player.getPos()
mc.setBlock(playerPos.x,playerPos.y-1,playerPos.z,block.DIAMOND_ORE)
5 changes: 4 additions & 1 deletion python3-scripts/mcpipy/mcpi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Connection:
RequestFailed = "Fail"

def __init__(self, address=None, port=None):
self.windows = (platform.system() == "Windows" or platform.system().startswith("CYGWIN_NT"))
if address==None:
try:
address = os.environ['MINECRAFT_API_HOST']
Expand All @@ -35,7 +36,6 @@ def __init__(self, address=None, port=None):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((address, port))
self.readFile = self.socket.makefile("r")
self.windows = (platform.system() == "Windows" or platform.system().startswith("CYGWIN_NT"))
self.lastSent = ""
if self.windows:
atexit.register(self.close)
Expand All @@ -53,6 +53,9 @@ def close(self):
if self.windows:
# ugly hack to block until all sending is completed
self.sendReceive("world.getBlock",0,0,0)
except:
pass
try:
self.socket.close()
except:
pass
Expand Down

0 comments on commit b7e0e6c

Please sign in to comment.