Merge pull request #49 from TBMCPlugins/development
Adjusted fireworks and dungeon
This commit is contained in:
commit
6b53cc00ed
2 changed files with 131 additions and 91 deletions
|
@ -77,10 +77,14 @@ public class GenericDungeonA1 extends Dungeon{
|
||||||
}
|
}
|
||||||
private Location loadLocation(JavaPlugin plugin, String path){
|
private Location loadLocation(JavaPlugin plugin, String path){
|
||||||
try{
|
try{
|
||||||
World world = plugin.getServer().getWorld(plugin.getConfig().getString(path+".world"));
|
String worldname = plugin.getConfig().getString(path+".world");
|
||||||
|
if(worldname == null) return null;
|
||||||
|
|
||||||
|
World world = plugin.getServer().getWorld(worldname);
|
||||||
double x = plugin.getConfig().getDouble(path+".x");
|
double x = plugin.getConfig().getDouble(path+".x");
|
||||||
double y = plugin.getConfig().getDouble(path+".y");
|
double y = plugin.getConfig().getDouble(path+".y");
|
||||||
double z = plugin.getConfig().getDouble(path+".z");
|
double z = plugin.getConfig().getDouble(path+".z");
|
||||||
|
if (world == null) return null;
|
||||||
|
|
||||||
return new Location(world, x, y, z);
|
return new Location(world, x, y, z);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package buttondevteam.alipresents.components.hotfix.hotfixes;
|
||||||
|
|
||||||
|
import org.bukkit.FireworkEffect;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.FireworkMeta;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
public class ElytraFireworks implements Listener {
|
||||||
|
JavaPlugin plugin;
|
||||||
|
public ElytraFireworks(JavaPlugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
public void onRightClick(PlayerInteractEvent event){
|
||||||
|
//ACTION SANITATION
|
||||||
|
if(!(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) return;
|
||||||
|
if(!(event.getPlayer().isGliding())) return;
|
||||||
|
if(!(event.getMaterial() == Material.FIREWORK)) return;
|
||||||
|
|
||||||
|
//BOW SANITATION
|
||||||
|
ItemStack firework = event.getItem();
|
||||||
|
FireworkMeta fireworkMeta= (FireworkMeta) firework.getItemMeta();
|
||||||
|
for (FireworkEffect effect : fireworkMeta.getEffects()){
|
||||||
|
event.getPlayer().sendMessage(effect.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//PLAYER SANITATION
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if(player.getGameMode().equals(GameMode.SPECTATOR))return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue