mirror of
https://e.coding.net/circlecloud/RocketJump.git
synced 2025-11-24 23:56:06 +00:00
19
.classpath
19
.classpath
@@ -1,7 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src/main/java"/>
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
<classpathentry kind="src" path="src/main/resources"/>
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
@@ -12,5 +21,11 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
56
pom.xml
56
pom.xml
@@ -22,17 +22,65 @@
|
|||||||
<target>1.7</target>
|
<target>1.7</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>2.3</version>
|
||||||
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
<minimizeJar>true</minimizeJar>
|
||||||
|
<artifactSet>
|
||||||
|
<includes>
|
||||||
|
<include>cn.citycraft:PluginHelper</include>
|
||||||
|
</includes>
|
||||||
|
</artifactSet>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>cn.citycraft.PluginHelper</pattern>
|
||||||
|
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
<properties>
|
||||||
|
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
|
||||||
|
<update.description></update.description>
|
||||||
|
<update.changes></update.changes>
|
||||||
|
<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>spigot-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>citycraft-repo</id>
|
||||||
|
<url>${jenkins.url}/plugin/repository/everything/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<version>1.8.3-R0.1-SNAPSHOT</version>
|
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.citycraft</groupId>
|
||||||
|
<artifactId>PluginHelper</artifactId>
|
||||||
|
<type>jar</type>
|
||||||
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
</project>
|
</project>
|
||||||
@@ -23,59 +23,54 @@ public class Listen implements Listener {
|
|||||||
List<String> efc = new ArrayList<String>();
|
List<String> efc = new ArrayList<String>();
|
||||||
int trng;
|
int trng;
|
||||||
|
|
||||||
public Listen(RocketJump main) {
|
public Listen(final RocketJump main) {
|
||||||
plugin = main;
|
plugin = main;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(String p) {
|
public void add(final String p) {
|
||||||
if (!fall.contains(p))
|
if (!fall.contains(p)) {
|
||||||
fall.add(p);
|
fall.add(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void efcadd(String p) {
|
public void efcadd(final String p) {
|
||||||
if (!efc.contains(p))
|
if (!efc.contains(p)) {
|
||||||
efc.add(p);
|
efc.add(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void MoveEvent(PlayerMoveEvent e) {
|
public void MoveEvent(final PlayerMoveEvent e) {
|
||||||
Player p = e.getPlayer();
|
final Player p = e.getPlayer();
|
||||||
if (efc.contains(p.getName())) {
|
if (efc.contains(p.getName())) {
|
||||||
trng -= 1;
|
trng -= 1;
|
||||||
pEffect(p.getLocation(), trng);
|
pEffect(p.getLocation(), trng);
|
||||||
}
|
}
|
||||||
if (p.getLocation().add(0, -1, 0).getBlock().getType() != (Material.AIR))
|
if (p.getLocation().add(0, -1, 0).getBlock().getType() != (Material.AIR)) {
|
||||||
if (plugin.Dante.contains(p.getName())) {
|
if (plugin.Dante.contains(p.getName())) {
|
||||||
p.setAllowFlight(true);
|
p.setAllowFlight(true);
|
||||||
if (fall.contains(p.getName()))
|
if (fall.contains(p.getName())) {
|
||||||
fall.remove(p.getName());
|
fall.remove(p.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onFallDamage(EntityDamageEvent e) {
|
public void onFallDamage(final EntityDamageEvent e) {
|
||||||
if (e.getEntity() instanceof Player) {
|
if (e.getEntity() instanceof Player) {
|
||||||
Player p = (Player) e.getEntity();
|
final Player p = (Player) e.getEntity();
|
||||||
if (e.getCause() == DamageCause.FALL)
|
if (e.getCause() == DamageCause.FALL) {
|
||||||
if (fall.contains(p.getName())) {
|
if (fall.contains(p.getName())) {
|
||||||
fall.remove(p.getName());
|
fall.remove(p.getName());
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pEffect(Location loc, int range) {
|
|
||||||
int i;
|
|
||||||
if (range < 2)
|
|
||||||
range = 2;
|
|
||||||
for (i = 0; i < range; i++) {
|
|
||||||
loc.getWorld().playEffect(loc, Effect.LAVA_POP, 10, 100);
|
|
||||||
loc.getWorld().playEffect(loc, Effect.PORTAL, 10, 100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void ToggleFlightEvent(PlayerToggleFlightEvent e) {
|
public void ToggleFlightEvent(final PlayerToggleFlightEvent e) {
|
||||||
final Player p = e.getPlayer();
|
final Player p = e.getPlayer();
|
||||||
if (plugin.Dante.contains(p.getName())) {
|
if (plugin.Dante.contains(p.getName())) {
|
||||||
if (p.getLocation().add(0, -1, 0).getBlock().getType() == (Material.AIR) && p.getLocation().add(0, -2, 0).getBlock().getType() == (Material.AIR)) {
|
if (p.getLocation().add(0, -1, 0).getBlock().getType() == (Material.AIR) && p.getLocation().add(0, -2, 0).getBlock().getType() == (Material.AIR)) {
|
||||||
@@ -98,9 +93,10 @@ public class Listen implements Listener {
|
|||||||
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (efc.contains(name))
|
if (efc.contains(name)) {
|
||||||
efc.remove(name);
|
efc.remove(name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 30);
|
}, 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,4 +105,15 @@ public class Listen implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pEffect(final Location loc, int range) {
|
||||||
|
int i;
|
||||||
|
if (range < 2) {
|
||||||
|
range = 2;
|
||||||
|
}
|
||||||
|
for (i = 0; i < range; i++) {
|
||||||
|
loc.getWorld().playEffect(loc, Effect.LAVA_POP, 10, 100);
|
||||||
|
loc.getWorld().playEffect(loc, Effect.PORTAL, 10, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,51 +3,57 @@ package cn.citycraft.RocketJump;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import cn.citycraft.PluginHelper.commands.HandlerCommand;
|
||||||
|
import cn.citycraft.PluginHelper.commands.HandlerCommands;
|
||||||
|
import cn.citycraft.PluginHelper.commands.HandlerSubCommand;
|
||||||
|
import cn.citycraft.PluginHelper.utils.VersionChecker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by a08381 on 15-3-28.
|
* 火箭跳跃主类
|
||||||
|
*
|
||||||
|
* @author 喵♂呜
|
||||||
|
* @since 2016年2月9日 下午8:50:50
|
||||||
*/
|
*/
|
||||||
public class RocketJump extends JavaPlugin {
|
public class RocketJump extends JavaPlugin implements HandlerCommands {
|
||||||
|
|
||||||
List<String> Dante = new ArrayList<String>() ;
|
List<String> Dante = new ArrayList<String>();
|
||||||
|
|
||||||
@Override
|
@HandlerCommand(name = "off", description = "§a开启火箭跳跃", permission = "rj.use", onlyPlayerExecutable = true)
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String string,
|
public void off(final CommandSender sender, final Command cmd, final String string, final String[] args) {
|
||||||
String[] args) {
|
final Player p = (Player) sender;
|
||||||
Player p = (Player) sender;
|
|
||||||
if (args.length == 1) {
|
|
||||||
if (args[0].equalsIgnoreCase("on")) {
|
|
||||||
this.Dante.add(p.getName());
|
|
||||||
sender.sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
|
|
||||||
p.setAllowFlight(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (args[0].equalsIgnoreCase("off")) {
|
|
||||||
this.Dante.remove(p.getName());
|
this.Dante.remove(p.getName());
|
||||||
sender.sendMessage("§6[RocketJump]§4已关闭...");
|
sender.sendMessage("§6[RocketJump]§4已关闭...");
|
||||||
if (p.getGameMode() == GameMode.SURVIVAL) {
|
if (p.getGameMode() == GameMode.SURVIVAL) {
|
||||||
p.setAllowFlight(false);
|
p.setAllowFlight(false);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
@HandlerCommand(name = "on", description = "§c关闭火箭跳跃", permission = "rj.use", onlyPlayerExecutable = true)
|
||||||
|
public void on(final CommandSender sender, final Command cmd, final String string, final String[] args) {
|
||||||
|
final Player p = (Player) sender;
|
||||||
|
this.Dante.add(p.getName());
|
||||||
|
sender.sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
|
||||||
|
p.setAllowFlight(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
getLogger().info( "§4RocketJump已卸载...");
|
Bukkit.getConsoleSender().sendMessage("§4RocketJump已卸载...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
new HandlerSubCommand(this, "rj").registerCommands(this);
|
||||||
getServer().getPluginManager().registerEvents(new Listen(this), this);
|
getServer().getPluginManager().registerEvents(new Listen(this), this);
|
||||||
getLogger().info("§aRocketJump已加载...");
|
Bukkit.getConsoleSender().sendMessage("§aRocketJump已加载...");
|
||||||
|
new VersionChecker(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user