Added maven support, removed camera subcommand

This commit is contained in:
Sauilitired 2014-10-28 10:20:52 +01:00
parent 595db4a51f
commit 3c5eead8c7
147 changed files with 116 additions and 102 deletions

View File

@ -1,16 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="bukkit-1.7.9-R0.2" level="project" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="simple-xml" level="project" />
<orderEntry type="library" name="WorldGuard" level="project" />
<orderEntry type="library" name="Maven: net.milkbowl.vault:Vault:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.7.10-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:10.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: me.confuser:BarAPI:2.0" level="project" />
<orderEntry type="library" name="Maven: com.sk89q:worldguard:5.9" level="project" />
<orderEntry type="library" name="Maven: com.worldcretornica:PlotMe-Core:0.14-SNAPSHOT" level="project" />
</component>
</module>

96
PlotSquared/pom.xml Normal file
View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.intellectualcrafters</groupId>
<artifactId>PlotSquared</artifactId>
<version>2.2.0</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>
<finalName>PlotSquared</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>
plugin.yml
</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>confuser-repo</id>
<url>http://ci.frostcast.net/plugin/repository/everything</url>
</repository>
<repository>
<id>hawkfalcon-repo</id>
<url>http://ci.hawkfalcon.com/plugin/repository/everything/</url>
</repository>
<repository>
<id>sk80q</id>
<url>http://maven.sk89q.com/artifactory/repo/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>6.0.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.confuser</groupId>
<artifactId>BarAPI</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>5.9</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.worldcretornica</groupId>
<artifactId>PlotMe-Core</artifactId>
<version>0.14-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -1,91 +0,0 @@
package com.intellectualcrafters.plot.commands;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import ca.mera.CameraAPI;
import ca.mera.CameraController;
import ca.mera.events.TravelEndEvent;
import com.intellectualcrafters.plot.C;
import com.intellectualcrafters.plot.PlayerFunctions;
import com.intellectualcrafters.plot.Plot;
import com.intellectualcrafters.plot.PlotHelper;
/**
* Created by Citymonstret on 2014-08-15.
*/
public class Camera extends SubCommand implements Listener {
private CameraAPI api;
public Camera() {
super("camera", "plots.camera", "Go into camera mode", "camera", "c", CommandCategory.TELEPORT, true);
this.api = CameraAPI.getInstance();
this.travelers = new ArrayList<String>();
}
private ArrayList<String> travelers;
@Override
public boolean execute(Player player, String... args) {
if (!PlayerFunctions.isInPlot(player)) {
PlayerFunctions.sendMessage(player, C.NOT_IN_PLOT);
return false;
}
this.api = CameraAPI.getInstance();
Plot plot = PlotHelper.getCurrentPlot(player.getLocation());
if (this.api.isTravelling(player)) {
this.api.stopTravel(player);
PlayerFunctions.sendMessage(player, C.CAMERA_STOPPED);
return true;
}
this.api.travel(getController(player, plot));
PlayerFunctions.sendMessage(player, C.CAMERA_STARTED, plot.getId().x + ";" + plot.getId().y);
this.travelers.add(player.getName());
return true;
}
@EventHandler
public void onTravelEnded(TravelEndEvent event) {
if (this.travelers.contains(event.getPlayer().getName())) {
this.travelers.remove(event.getPlayer().getName());
PlayerFunctions.sendMessage(event.getPlayer(), C.CAMERA_STOPPED);
}
if (this.travelers.contains(event.getPlayer().getName())) {
event.getHandlers().bake();
}
}
public CameraController getController(Player player, Plot plot) {
World w = Bukkit.getWorld(plot.world);
int seconds = PlotHelper.getPlotWidth(w, plot.id) * 5;
Location loc1, loc2, loc3, loc4, loc5;
double y = player.getLocation().getY();
Location bottomLoc = PlotHelper.getPlotBottomLoc(w, plot.id);
Location topLoc = PlotHelper.getPlotTopLoc(w, plot.id);
World world = bottomLoc.getWorld();
int maxX = Math.max(bottomLoc.getBlockX(), topLoc.getBlockX());
int maxZ = Math.max(bottomLoc.getBlockZ(), topLoc.getBlockZ());
int minX = Math.min(bottomLoc.getBlockX(), topLoc.getBlockX());
int minZ = Math.min(bottomLoc.getBlockZ(), topLoc.getBlockZ());
loc1 = new Location(world, maxX, y, maxZ);
loc2 = new Location(world, maxX, y, minZ);
loc3 = new Location(world, minX, y, minZ);
loc4 = new Location(world, minX, y, maxZ);
loc1.setYaw(((3 / 4.0F) * 360.0F) - 0.5F);
loc3.setYaw(((1 / 4.0F) * 360.0F) - 0.5F);
loc4.setYaw(((2 / 4.0F) * 360.0F) - 0.5F);
loc2.setYaw(((0 / 4.0F) * 360.0F) - 0.5F);
loc5 = loc1.clone();
CameraController controller = this.api.createController(player, seconds, loc1, loc2, loc3, loc4, loc5);
return controller;
}
}

View File

@ -1,10 +1,9 @@
package com.intellectualcrafters.plot;
import java.util.Arrays;
import com.intellectualcrafters.plot.Configuration.SettingValue;
import org.apache.commons.lang.StringUtils;
import com.intellectualcrafters.plot.Configuration.SettingValue;
import java.util.Arrays;
public class ConfigurationNode {
private String constant;

Some files were not shown because too many files have changed in this diff Show More