This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
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.
Move vote type registration. Remove custom votifier vote event and re…
…gister exiting event. Modify several syntaxes. Increase plugin version.
- Loading branch information
Showing
7 changed files
with
71 additions
and
93 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 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 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 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 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 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
56 changes: 56 additions & 0 deletions
56
src/main/java/com/rezzedup/skriptvotifierhook/types/VoteType.java
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,56 @@ | ||
package com.rezzedup.skriptvotifierhook.types; | ||
|
||
import ch.njol.skript.classes.ClassInfo; | ||
import ch.njol.skript.classes.Parser; | ||
import ch.njol.skript.expressions.base.EventValueExpression; | ||
import ch.njol.skript.lang.ParseContext; | ||
import ch.njol.skript.registrations.Classes; | ||
import com.vexsoftware.votifier.model.Vote; | ||
|
||
public class VoteType | ||
{ | ||
static | ||
{ | ||
Classes.registerClass | ||
( | ||
new ClassInfo<>(Vote.class, "vote") | ||
.user("vote") | ||
.name("Vote") | ||
.description("A vote from votifier.") | ||
.since("1.0.0") | ||
.defaultExpression(new EventValueExpression<Vote>(Vote.class)) | ||
.parser(new Parser<Vote>() | ||
{ | ||
@Override | ||
public Vote parse(String s, ParseContext context) | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean canParse(ParseContext context) | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public String toString(Vote vote, int i) | ||
{ | ||
return vote.toString(); | ||
} | ||
|
||
@Override | ||
public String toVariableNameString(Vote vote) | ||
{ | ||
return toString(vote, 0); | ||
} | ||
|
||
@Override | ||
public String getVariableNamePattern() | ||
{ | ||
return ".+"; | ||
} | ||
}) | ||
); | ||
} | ||
} |