-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from EHAT32/main
Example for DrawingDecorator
- Loading branch information
Showing
4 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from tagilmo.utils.vereya_wrapper import MCConnector | ||
import tagilmo.utils.mission_builder as mb | ||
|
||
block = mb.DrawBlock("-1", "-60", "4", "cobblestone") | ||
it = mb.DrawItem(0, -60, 0, "diamond") | ||
cuboid = mb.DrawCuboid("1", -60, "0", 3, -60, 3, "sandstone") | ||
line = mb.DrawLine(5, -60, 3, 9, -55, 8, "diamond_ore") | ||
draw = mb.DrawingDecorator([block, it, cuboid, line]) | ||
|
||
miss = mb.MissionXML(serverSection=mb.ServerSection(handlers=mb.ServerHandlers(drawingdecorator=draw))) | ||
miss.setWorld(mb.flatworld("", | ||
seed= '5', | ||
forceReset = "true")) | ||
miss.setObservations(mb.Observations()) | ||
# we typically don't need this for real Minecraft agents, but this example just checks the connection to Minecraft | ||
miss.setTimeLimit(5000) | ||
|
||
mc = MCConnector(miss) | ||
# Note that we need two instances of Minecraft running | ||
mc.safeStart() | ||
|
||
mc.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters