forked from Upstream/CommandPanels
Added open-on-first-login
This commit is contained in:
parent
04d344eef2
commit
b91ba6403e
@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,5 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>ADVENTURE</platformType>
|
||||
<platformType>SPIGOT</platformType>
|
||||
<platformType>BUKKIT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.rockyhawk.commandpanels.classresources.placeholders;
|
||||
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import me.realized.tokenmanager.api.TokenManager;
|
||||
@ -378,7 +379,7 @@ public class Placeholders {
|
||||
}
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("VotingPlugin")) {
|
||||
if(identifier.equals("votingplugin-points")) {
|
||||
return String.valueOf(UserManager.getInstance().getVotingPluginUser(p).getPoints());
|
||||
return String.valueOf(VotingPluginMain.plugin.getVotingPluginUserManager().getVotingPluginUser(p).getPoints());
|
||||
}
|
||||
}
|
||||
//end nodes with PlaceHolders
|
||||
|
@ -19,7 +19,7 @@ public class CommandPanelImport implements CommandExecutor {
|
||||
CommandPanels plugin;
|
||||
public CommandPanelImport(CommandPanels pl) { this.plugin = pl; }
|
||||
|
||||
@EventHandler
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (sender.hasPermission("commandpanel.import")) {
|
||||
if (args.length == 2) {
|
||||
|
@ -17,7 +17,7 @@ public class Commandpanel implements CommandExecutor {
|
||||
this.plugin = pl;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
//below is going to go through the files and find the right one
|
||||
Panel panel = null;
|
||||
|
@ -15,19 +15,29 @@ public class OpenOnJoin implements Listener {
|
||||
}
|
||||
@EventHandler
|
||||
public void onWorldLogin(PlayerJoinEvent e){
|
||||
//only opens when the player first logins
|
||||
openOnJoin(e.getPlayer(),"open-on-login.");
|
||||
if (!e.getPlayer().hasPlayedBefore()) {
|
||||
openOnJoin(e.getPlayer(),"open-on-first-login");
|
||||
return;
|
||||
}
|
||||
//only opens when the player logs into the server
|
||||
openOnJoin(e.getPlayer(),"open-on-login");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWorldJoin(PlayerChangedWorldEvent e){
|
||||
//only opens when the player changes the world internally
|
||||
openOnJoin(e.getPlayer(),"open-on-join.");
|
||||
openOnJoin(e.getPlayer(),"open-on-join");
|
||||
}
|
||||
|
||||
private void openOnJoin(Player p, String joinType){
|
||||
if(plugin.config.contains(joinType + p.getWorld().getName())){
|
||||
String command = "open= " + plugin.config.getString(joinType + p.getWorld().getName());
|
||||
String world = p.getWorld().getName();
|
||||
// Limited to '1' panel as you can only have '1' inventory open
|
||||
// pass the world as "" to tell the code to not use world
|
||||
if (joinType.equalsIgnoreCase("open-on-first-login")) world="";
|
||||
|
||||
String joinString = joinType + (world.equals("") ? "" : "."+ world);
|
||||
if(plugin.config.contains(joinString)){
|
||||
String command = "open= " + plugin.config.getString(joinString);
|
||||
plugin.commandTags.runCommand(null, PanelPosition.Top,p, command);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -75,7 +75,3 @@ purchase:
|
||||
enable: true
|
||||
success: '&aSuccessfully Bought For %cp-args% Experience.'
|
||||
failure: '&cInsufficient Experience!'
|
||||
permission:
|
||||
enable: true
|
||||
success: "&aYou have successfully passed the permission check for '%cp-args%'"
|
||||
failure: '&cInefficient Permissions'
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
version: 3.19.0.4
|
||||
version: 3.18.6.2
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -0,0 +1,6 @@
|
||||
me\rockyhawk\commandpanels\classresources\ItemCreation$1.class
|
||||
me\rockyhawk\commandpanels\editor\EditorSettings.class
|
||||
me\rockyhawk\commandpanels\editor\CommandPanelsEditorTabComplete.class
|
||||
me\rockyhawk\commandpanels\editor\CommandPanelsEditorCommand.class
|
||||
me\rockyhawk\commandpanels\editor\CPEventHandler.class
|
||||
me\rockyhawk\commandpanels\editor\CommandPanelsEditorMain.class
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user