v3.1
This commit is contained in:
parent
12112bc94e
commit
040127d26e
|
@ -37,6 +37,24 @@ public class Region {
|
|||
return new Location(world,x,(y+5),z,-90,90);
|
||||
}
|
||||
|
||||
|
||||
public Location getHub(BackPointType backPointType){
|
||||
double z = (min.getZ() + max.getZ()) / 2;
|
||||
double y = min.getY();
|
||||
if(max.getY() > y){
|
||||
y = max.getY();
|
||||
}
|
||||
if(backPointType == BackPointType.初始){
|
||||
double x = (min.getX() + 1);
|
||||
return new Location(world,x,(y+5),z,-90,45);
|
||||
}else if(backPointType == BackPointType.尽头){
|
||||
double x = (max.getX() - 1);
|
||||
return new Location(world,x,(y+5),z,90,45);
|
||||
}
|
||||
double x = (min.getX() + max.getX()) / 2;
|
||||
return new Location(world,x,(y+5),z,-90,90);
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ public class GiftEventHandler {
|
|||
BigWindill.apply(game,zhubo,5);
|
||||
}else if (eventName.equalsIgnoreCase("大风车60秒")) {
|
||||
BigWindill.apply(game,zhubo,60);
|
||||
}else if (eventName.equalsIgnoreCase("场地重置")) {
|
||||
game.reset();
|
||||
} else if (eventName.equalsIgnoreCase("关灯100秒")) {
|
||||
PotionBlindness.apply(game,zhubo,100);
|
||||
} else if (eventName.contains("羊羊")) {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.yaohun.farmingwar.liveevent;
|
||||
|
||||
import com.io.yutian.pixelliveplugin.event.KeyInputEvent;
|
||||
import com.yaohun.farmingwar.FarmingWar;
|
||||
import com.yaohun.farmingwar.game.Game;
|
||||
import com.yaohun.farmingwar.util.BackPointType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
@ -10,6 +13,13 @@ public class KeyInputListener implements Listener {
|
|||
@EventHandler//点赞
|
||||
public void onDianZan(KeyInputEvent e) {
|
||||
Player zhubo = e.getPlayer();
|
||||
zhubo.sendMessage("RawCode = "+e.getRawCode()+" KeyCode = "+e.getKeyCode());
|
||||
if(e.getRawCode() == 71 && e.getKeyCode() == 34){
|
||||
Game game = FarmingWar.getGame();
|
||||
zhubo.teleport(game.getRegion().getHub(BackPointType.中间));
|
||||
}
|
||||
if(e.getRawCode() == 72 && e.getKeyCode() == 35){
|
||||
Game game = FarmingWar.getGame();
|
||||
zhubo.teleport(game.getRegion().getHub(BackPointType.尽头));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user