Classes/API
If you would like, to make your own classes, you can use the Class-API:
WARNING: It's not yet finished. And If you 're using a second Java-Class, you have multiply .class files at the end!!!
1) Reference the CTF-Classes-API
Add the CTF.jar file as an external jar file.
2) Create a new Class
Create a new (Java-)Class with the name of your "new" (CTF-)Class.
(You don't need a package)
3) Class-Template
Here is the most imported source (For a Class with no Listener):
public class archer extends CtFClass implements Listener{ private String version = "1.0"; private String name = "Test-Class"; private String description = ""; private String command = "test"; private List<String> authors = new ArrayList<String>(); @Override public void disable() { } @Override public void enable() { authors.add("Your_Name"); } @Override public List<String> getAuthors() { return authors; } @Override public String getCommand() { return command; } @Override public String getDescription() { return description; } @Override public String getName() { return name; } @Override public String getVersion() { return version; } @Override public boolean givekit(Player p) { PlayerInventory inv = p.getInventory(); ItemStack item; //Armor //Helmet item = new ItemStack(302, 1); inv.setHelmet(item); //ChestPlate item = new ItemStack(303, 1); inv.setChestplate(item); //Leggins item = new ItemStack(304, 1); inv.setLeggings(item); //Boots item = new ItemStack(305, 1); inv.setBoots(item); //Items //Stonesword item = new ItemStack(272,1); inv.addItem(item); //Steak item = new ItemStack(364,4); inv.addItem(item); // ... return true; } @Override public boolean saytime(Player p, int time) { p.setLevel(time); return true; } }
If you would like to use Listeners and Timer, you can look here for the source of my Classes. [Link 'll come later]
4) Export that Project. Inside you new generated .jar File, you 'll have all CTF-Classes, that you've coded.
Or you can go to Workspace_Folder/Your_Project/bin/. You'll see also all of your .class files.
what do you mean by multiply class files at the end?
@Renaud444
Ninja class: ninja.class and ninja$1.class
Oh, thats automatic
Ok I had 1 big question. I had made lots off classes but there are problems. I want that ninjas had all the time a Potion effect of Speed 2. I had search in all of Mister Erwins classes but in no class is an Potion effect that hold all the time. My question is how I can code this. I hope you can answer this . Sorry for my very bad english. I am not very long member of this site.
@Klausi452
You can use a thread to set it every 10 sec - or set the duration very hight (e.g. 8000 * 20 [8000 Seconds])
@Mistererwin Könntest du mir einen guten Compiler empfehlen. Der von Eclipse spinnt bei der neu überarbeiteten ninja.class. ( Error Bericht wird mitcompielt. Irgendein Fehler bei Variable super). Und der normale mag keine großen C`s. Wäre nett Danke im Voraus. Ps.: Hab mir aus der assasn File etwas zusammengedichtete. Danke.
@Klausi452
error bericht mitkompiliert? - Wie geht denn das? - Vielleicht der JavaEditor
Is it possible to add colored armor
@matsvr99
yes: With itemmeta (just google ;) )
Hi.
Regarding adding listeners, how would you do it. I've tried to do it, but the CtFClass import doesn't work, so I get all these errors with the super.plugin variable. Any ideas to fix it?
Thanks, Rick
@RickRaider
Like I said in skype: do you have the CTF.jar set as an external jar?