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
class DummyQuest { | |
class Simple() : SimpleQuest("simpleDummyQuest", 1) { | |
init { | |
this name Text.of("Dummy Quest") | |
this description Text.of("A dummy quest to prove that SimpleQuest works. Kill some things, reach a point, and get a magical anvil!") | |
val world = Sponge.getServer().getWorld(Sponge.getServer().defaultWorldName) |
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
package com.atherys.addon | |
import com.atherys.quests.quest.SimpleQuest | |
import com.atherys.quests.quest.Stage | |
import com.atherys.quests.quest.StagedQuest | |
import com.atherys.quests.quest.objective.Objectives | |
import com.atherys.quests.quest.requirement.Requirements | |
import com.atherys.quests.quest.reward.Rewards | |
import com.atherys.quests.quester.Quester | |
import com.flowpowered.math.vector.Vector3d |
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
@Listener | |
public void onKeyRegistration( GameRegistryEvent.Register<Key<?>> event ) { | |
QuestKeys.DIALOG = Key.builder() | |
.type( new TypeToken<Value<String>>() {} ) | |
.id( "dialog" ) | |
.name( "Dialog" ) | |
.query( DataQuery.of( "atherysquests", "Dialog" ) ) | |
.build(); | |
} |
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
public abstract class AbstractConfigurateAdapter<T> extends TypeAdapter<T> { | |
private Class<T> clazz; | |
private JsonParser parser = new JsonParser(); | |
protected AbstractConfigurateAdapter ( Class<T> clazz ) { | |
this.clazz = clazz; | |
} |
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
import java.util.Arrays; | |
public class Main { | |
private static Point2D[] points = { | |
Point2D.of( 0.0, 4.0), | |
Point2D.of( 4.0, 0.0), | |
Point2D.of(-4.0, -4.0), | |
Point2D.of(-4.0, 0.0) | |
}; |
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
import com.google.inject.Inject; | |
import org.slf4j.Logger; | |
import org.spongepowered.api.Game; | |
import org.spongepowered.api.event.Listener; | |
import org.spongepowered.api.event.game.state.GameInitializationEvent; | |
import org.spongepowered.api.event.game.state.GameStartingServerEvent; | |
import org.spongepowered.api.event.game.state.GameStoppingServerEvent; | |
import org.spongepowered.api.plugin.Plugin; | |
@Plugin( id = YourPlugin.ID, name = YourPlugin.NAME, description = YourPlugin.DESCRIPTION, version = YourPlugin.VERSION ) |
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
public final class ExampleConfig extends PluginConfig { | |
@Setting( value = "defaultConfig", comment = "Whether or not this is the default config. If this is set to true, the plugin will not start.") | |
public boolean DEFAULT = true; | |
@Setting( value = "database" ) | |
public DatabaseConfig DATABASE = new DatabaseConfig(); | |
@ConfigSerializable | |
public static class DatabaseConfig { |
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
/** | |
* A utility for polling players with arbitrary questions, and offering an arbitrary amount of answers with various actions attached.<br> | |
* The questions may be sent to the player either in the form of a chat message ( {@link #pollChat(Player)} ), | |
* a book view ( {@link #pollBook(Player)} ), | |
* or a combination of the two in the form of a chat-based view button ( {@link #pollViewButton(Player, Text)} ). | |
*/ | |
public class Question { | |
public static Text QUESTION_DECORATION_TOP = Text.of(TextColors.DARK_AQUA, "{", TextColors.AQUA, "Question", TextColors.DARK_AQUA, "}\n"); | |
public static Text QUESTION_DECORATION_BOT = Text.of(TextColors.DARK_AQUA, "\n"); |