mirror of
https://github.com/Leahnaya/VIP-Welcome-Plugin.git
synced 2026-04-25 23:37:55 -05:00
Added Files
Added the source files to the repo.
This commit is contained in:
parent
58cf63f006
commit
7f3ff3303f
7
.classpath
Normal file
7
.classpath
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||||
|
<classpathentry kind="lib" path="C:/Users/Joel/Desktop/My Plugins/craftbukkit-1.7.2-R0.3.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
17
.project
Normal file
17
.project
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>VIPWelcome</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
11
.settings/org.eclipse.jdt.core.prefs
Normal file
11
.settings/org.eclipse.jdt.core.prefs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
1
bin/config.yml
Normal file
1
bin/config.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Message: Replace me with a message!
|
||||||
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome$1.class
Normal file
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome$1.class
Normal file
Binary file not shown.
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome$2.class
Normal file
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome$2.class
Normal file
Binary file not shown.
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome.class
Normal file
BIN
bin/me/cockatoo2x/plugins/vipwelcome/VIPWelcome.class
Normal file
Binary file not shown.
11
plugin.yml
Normal file
11
plugin.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
main: me.cockatoo2x.plugins.vipwelcome.VIPWelcome
|
||||||
|
name: VIPWelcome
|
||||||
|
version: 2.1
|
||||||
|
author: Cockatoo2X
|
||||||
|
description: Sends a message and a fire work when VIP's join the server!
|
||||||
|
prefix: VIP Welcome
|
||||||
|
permissions:
|
||||||
|
vip.join.firework:
|
||||||
|
description: Sends a firework on vip join!
|
||||||
|
vip.join.message:
|
||||||
|
description: Sends a message on vip join!
|
||||||
1
src/config.yml
Normal file
1
src/config.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Message: Replace me with a message!
|
||||||
71
src/me/cockatoo2x/plugins/vipwelcome/VIPWelcome.java
Normal file
71
src/me/cockatoo2x/plugins/vipwelcome/VIPWelcome.java
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
package me.cockatoo2x.plugins.vipwelcome;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.FireworkEffect;
|
||||||
|
import org.bukkit.FireworkEffect.Type;
|
||||||
|
import org.bukkit.entity.Firework;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.inventory.meta.FireworkMeta;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
public class VIPWelcome extends JavaPlugin implements Listener{
|
||||||
|
|
||||||
|
public void onEnable(){
|
||||||
|
getLogger().info("VIP Welcome Now Enabled!");
|
||||||
|
Bukkit.getServer().getPluginManager().registerEvents(this, this);
|
||||||
|
getConfig().options().copyDefaults(true);
|
||||||
|
saveConfig();
|
||||||
|
if(getConfig().contains("Message")){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
getConfig().createSection("Message");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void onDisable(){
|
||||||
|
getLogger().info("VIP Welcome Now Disabled!");
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin (final PlayerJoinEvent pje) {
|
||||||
|
final Player player = pje.getPlayer();
|
||||||
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
if(player.hasPermission("vip.join.firework")){
|
||||||
|
Firework f = (Firework) pje.getPlayer().getWorld().spawn(pje.getPlayer().getLocation(), Firework.class);
|
||||||
|
FireworkMeta fm = f.getFireworkMeta();
|
||||||
|
fm.addEffect(FireworkEffect.builder()
|
||||||
|
.flicker(false)
|
||||||
|
.trail(true)
|
||||||
|
.with(Type.BALL)
|
||||||
|
.with(Type.BALL_LARGE)
|
||||||
|
.with(Type.STAR)
|
||||||
|
.withColor(Color.ORANGE)
|
||||||
|
.withColor(Color.YELLOW)
|
||||||
|
.withFade(Color.PURPLE)
|
||||||
|
.withFade(Color.RED)
|
||||||
|
.build());
|
||||||
|
fm.setPower(2);
|
||||||
|
f.setFireworkMeta(fm);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}, 20);
|
||||||
|
}
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin2(PlayerJoinEvent pje){
|
||||||
|
final Player player = pje.getPlayer();
|
||||||
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
if(player.hasPermission("vip.join.message")){
|
||||||
|
Bukkit.broadcastMessage(ChatColor.GREEN + getConfig().getString("Message") + " " + player.getName() + "!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user