Remove submodules in favor of deployments

This commit is contained in:
Eric Stokes 2011-11-25 22:45:27 -07:00
parent 4b2152a05c
commit 71bfd2a1ad
5 changed files with 71 additions and 94 deletions

7
.gitmodules vendored
View File

@ -1,7 +0,0 @@
[submodule "lib/allpay"]
path = lib/allpay
url = git://github.com/FernFerret/AllPay.git
[submodule "lib/commandhandler"]
path = lib/commandhandler
url = git://github.com/PneumatiCraft/CommandHandler.git
branch = notrie

@ -1 +0,0 @@
Subproject commit 18c55a9070a5e64b2cb0737940290643f324fa7d

@ -1 +0,0 @@
Subproject commit 50ecf6af450d138a9bc562c1c5664b31be6ffd2f

102
pom.xml
View File

@ -47,28 +47,6 @@
<target>1.6</target>
</configuration>
</plugin>
<!-- Build Helper - Additional Source Folders -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-wsdl-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/lib/allpay/src</source>
<source>${project.basedir}/lib/commandhandler/src</source>
<source>${project.basedir}/lib/commandhandler/lib/ShellParser/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
@ -122,6 +100,24 @@
<scope>compile</scope>
</dependency>
<!-- Bukkit Dependency -->
<!-- CommandHandler Dependency -->
<dependency>
<groupId>com.pneumaticraft</groupId>
<artifactId>CommandHandler</artifactId>
<version>3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- CommandHandler Dependency -->
<!-- AllPay Dependency -->
<dependency>
<groupId>com.fernferret.allpay</groupId>
<artifactId>AllPay</artifactId>
<version>3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AllPay Dependency -->
<!-- Start of Spout -->
<dependency>
<groupId>org.getspout</groupId>
@ -129,68 +125,11 @@
<version>dev-SNAPSHOT</version>
</dependency>
<!-- End of Spout -->
<!-- Start of Economy Dependencies -->
<dependency>
<groupId>cosine.boseconomy</groupId>
<artifactId>BOSEconomy</artifactId>
<version>0.6.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>fr.crafter.tickleman.RealShop</groupId>
<artifactId>RealShop</artifactId>
<version>0.63</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.iCo6</groupId>
<artifactId>iConomy</artifactId>
<version>6.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>5.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nijiko.coelho.iConomy</groupId>
<artifactId>iConomy</artifactId>
<version>4.65</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.earth2me.essentials</groupId>
<artifactId>Essentials</artifactId>
<version>2.4.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.ashtheking.currency</groupId>
<artifactId>MultiCurrency</artifactId>
<version>0.09</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- End of Economy Dependencies -->
<!-- Start of Test Dependencies -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
@ -219,11 +158,6 @@
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
</dependency>
<!-- End of Test Dependencies -->
</dependencies>
</project>

View File

@ -16,6 +16,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
import java.io.File;
import java.io.FilenameFilter;
import java.util.List;
public class ImportCommand extends MultiverseCommand {
@ -25,7 +26,7 @@ public class ImportCommand extends MultiverseCommand {
super(plugin);
this.setName("Import World");
this.setCommandUsage("/mv import" + ChatColor.GREEN + " {NAME} {ENV} " + ChatColor.GOLD + "[GENERATOR[:ID]]");
this.setArgRange(2, 3);
this.setArgRange(1, 3);
this.addKey("mvimport");
this.addKey("mvim");
this.addKey("mv import");
@ -36,9 +37,60 @@ public class ImportCommand extends MultiverseCommand {
this.worldManager = this.plugin.getMVWorldManager();
}
/**
* A very basic check to see if a folder has a level.dat file.
* If it does, we can safely assume it's a world folder.
*
* @param worldFolder The File that may be a world.
*
* @return True if it looks like a world, false if not.
*/
private boolean checkIfIsWorld(File worldFolder) {
if (worldFolder.isDirectory()) {
File[] files = worldFolder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File file, String name) {
return name.equalsIgnoreCase("level.dat");
}
});
if (files.length > 0) {
return true;
}
}
return false;
}
private String getPotentialWorlds() {
File worldFolder = this.plugin.getServer().getWorldContainer();
File[] files = worldFolder.listFiles();
String worldList = "";
ChatColor currColor = ChatColor.WHITE;
for (File file : files) {
if (file.isDirectory() && checkIfIsWorld(file)) {
worldList += currColor + file.getName() + " ";
if (currColor == ChatColor.WHITE) {
currColor = ChatColor.YELLOW;
} else {
currColor = ChatColor.WHITE;
}
}
}
return worldList;
}
@Override
public void runCommand(CommandSender sender, List<String> args) {
String worldName = args.get(0);
if (worldName.toLowerCase().equals("--list") || worldName.toLowerCase().equals("-l")) {
String worldList = this.getPotentialWorlds();
sender.sendMessage(worldList);
return;
}
// Since we made an exception for the list, we have to make sure they have at least 2 params:
if(args.size() == 1) {
return;
}
File worldFile = new File(this.plugin.getServerFolder(), worldName);
if (this.worldManager.isMVWorld(worldName) && worldFile.exists()) {
sender.sendMessage(ChatColor.RED + "Multiverse already knows about this world!");