Created
July 14, 2013 15:35
-
-
Save tehbeard/5994636 to your computer and use it in GitHub Desktop.
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
public class PasteCommand extends CommandBase { | |
private final SchematicFile schFile; | |
public PasteCommand(SchematicFile schFile) { | |
this.schFile = schFile; | |
} | |
@Override | |
public String getCommandName() { | |
return "paste"; | |
} | |
@Override | |
public void processCommand(ICommandSender icommandsender, String[] args) { | |
if(!(icommandsender instanceof EntityPlayer)){return;} | |
EntityPlayerMP player = (EntityPlayerMP) icommandsender; | |
PasteToWorld paste = new PasteToWorld(player.worldObj); | |
//PasteAsSand paste = new PasteAsSand(player.worldObj); | |
paste.setWorldVec(new SchVector((int)Math.floor(player.posX),(int) Math.floor(player.posY),(int) Math.floor(player.posZ))); | |
paste.setRotations(Integer.parseInt(args[0])); | |
new SchematicFactory().loadWorkers(new VectorOffsetWorker(new SchVector(-1,-1,-1))).loadSchematic(schFile).produce(paste); | |
Set<ItemData> data = GameData.buildWorldItemData(null); | |
player.addChatMessage("pasted"); | |
} | |
@Override | |
public String getCommandUsage(ICommandSender icommandsender) { | |
return "/paste [rotation]"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment