源码,注意,这段源码仅供参考,不能复制粘贴弄成文件执行,因为这个插件有大量的缩进,很难调
from mcpi import minecraft
from time import sleep
from mcpi import block
mc=minecraft.Minecraft.create( )
print( '\033[1;37;40m' ),
print( "Super Flat World Creater V0.0.1" )
print( '\033[1;37;40m' ),
print( " by KirCute" )
mc.postToChat( "Super Flat World Creater" )
mc.postToChat( " by KirCute" )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;31;40m' ),
print( "Warning" ),
print( '\033[0m' ),
print( "] There is a bug in this version." )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;33;40m' ),
print( "Question" ),
print( '\033[0m' ),
firstYN = raw_input( "] Are you really want to create the flat world? [Y/N]" )
if not ( ( firstYN == "Y" ) or ( firstYN == "y" ) ) :
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Mission has been cancelled." )
mc.postToChat( "Mission has been cancelled." )
sleep( 0.1 )
exit( )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;33;40m' ),
print( "Question" ),
print( '\033[0m' ),
secondYN = raw_input( "] It's irreversible. Are you reallly want to continue? [Y/N]" )
if not ( ( secondYN == "Y" ) or ( secondYN == "y" ) ) :
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Mission has been cancelled." )
mc.postToChat( "Mission has been cancelled." )
sleep( 0.1 )
exit( )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Started." )
mc.postToChat( "Begin creating flat world." )
buildingHigh = 63
while buildingHigh >= 40 :
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Building " + str( buildingHigh ) + " layer." )
mc.postToChat( "Building " + str( buildingHigh ) + " layer." )
mc.setBlocks( -256, buildingHigh , -256 , 256 , buildingHigh , 256 , block.AIR )
buildingHigh = buildingHigh - 1
sleep( 1 )
mc.setBlock( 0 , 40 , 0 , block.STONE )
mc.player.setPos( 0 , 41 , 0 )
while buildingHigh >= -59 :
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Building " + str( buildingHigh ) + " layer." )
mc.postToChat( "Building " + str( buildingHigh ) + " layer." )
mc.setBlocks( -256, buildingHigh , -256 , 256 , buildingHigh , 256 , block.AIR )
buildingHigh = buildingHigh - 1
sleep( 1 )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Building " + str( buildingHigh ) + " layer." )
mc.postToChat( "Building " + str( buildingHigh ) + " layer." )
mc.setBlocks( -256, buildingHigh , -256 , 256 , buildingHigh , 256 , block.GRASS )
buildingHigh = buildingHigh - 1
sleep( 1 )
while buildingHigh >= -63 :
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Building " + str( buildingHigh ) + " layer." )
mc.postToChat( "Building " + str( buildingHigh ) + " layer." )
mc.setBlocks( -256, buildingHigh , -256 , 256 , buildingHigh , 256 , block.DIRT )
buildingHigh = buildingHigh - 1
sleep( 1 )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;36;40m' ),
print( "Info" ),
print( '\033[0m' ),
print( "] Building " + str( buildingHigh ) + " layer." )
mc.postToChat( "Building " + str( buildingHigh ) + " layer." )
mc.setBlocks( -256, buildingHigh , -256 , 256 , buildingHigh , 256 , block.BEDROCK )
sleep( 1 )
print( '\033[0m' ),
print( "[" ),
print( '\033[1;32;40m' ),
print( "OK" ),
print( '\033[0m' ),
print( "] Mission has been completed." )
mc.postToChat( "Mission has been completed." )
sleep( 0.1 )
mc.setBlock( 0 , 40 , 0 , block.AIR )
print( '\033[1;37;40m' ),
print( "Super Flat World Creater V0.0.1" )
print( '\033[1;37;40m' ),
print( " by KirCute" )
mc.postToChat( "Super Flat World Creater" )
mc.postToChat( " by KirCute" )
print( '\033[1;37;40m' ),
print( "Thanks for you use." )
mc.postToChat( "Thanks for you use." )
print( '\033[1;31;40m' ),
print( "DON'T REOPEN THIS WORLD! A BUG IS IN IT!" ),
print( '\033[0m' )
mc.postToChat( "DON'T REOPEN THIS WORLD! A BUG IS IN IT!" )
sleep( 0.1 )