-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
374 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package com.normarthehero.plugin; | ||
|
||
import java.util.HashSet; | ||
|
||
import mkremins.fanciful.FancyMessage; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.CommandSender; | ||
|
||
public class RolePlayChat { | ||
|
||
private HashSet<String> roleplayers = new HashSet<String>(); | ||
private boolean locked = false; | ||
private String rpname; | ||
private final String CREATOR; | ||
private FancyMessage button; | ||
|
||
public RolePlayChat(String name, String CREATOR) { | ||
this.rpname = name; | ||
button = new FancyMessage(name).color(ChatColor.YELLOW).command("/roleplay join " + name); | ||
this.CREATOR = CREATOR; | ||
|
||
roleplayers.add(CREATOR); | ||
|
||
} | ||
|
||
// should not exist | ||
@Deprecated | ||
public void chat(String msg) { | ||
|
||
} | ||
|
||
public void chatRaw(String msg) { | ||
for (String player : roleplayers) { | ||
Bukkit.getPlayer(player).sendMessage(msg); | ||
} | ||
|
||
} | ||
|
||
public boolean isLocked() { | ||
return locked; | ||
|
||
} | ||
|
||
public String getCreator() { | ||
return CREATOR; | ||
|
||
} | ||
|
||
public void add(String name) { | ||
roleplayers.add(name); | ||
|
||
} | ||
|
||
public void remove(String name) { | ||
roleplayers.remove(name); | ||
|
||
if (name.equals(CREATOR)) { | ||
locked = false; | ||
|
||
} | ||
|
||
} | ||
|
||
public String getName() { | ||
return rpname; | ||
|
||
} | ||
|
||
public void lock() { | ||
locked = true; | ||
|
||
} | ||
|
||
public void unlock() { | ||
locked = false; | ||
|
||
} | ||
|
||
public boolean isRP(String name) { | ||
return roleplayers.contains(name); | ||
|
||
} | ||
|
||
public void sendButton(CommandSender sender) { | ||
button.send(sender); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.