Record Class ServerQuest
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.quest.ServerQuest
- Record Components:
json- the file as written, sent to players for their books to show it
public record ServerQuest(net.minecraft.resources.Identifier id, @Nullable net.minecraft.resources.Identifier book, List<ServerObjective> requires, List<ServerObjective> objectives, boolean inOrder, @Nullable com.google.gson.JsonObject rewards, com.google.gson.JsonObject json)
extends Record
A quest a data pack gives (
data/<namespace>/folios/quests/<name>.json): its objectives, followed by the server,
and what it gives once done. A book shows it with a quest element naming it ("quest": "mymod:first_quest").
{
"book": "mymod:handbook",
"requires": {"quest": "mymod:first_steps"},
"objectives": [{"read": "basics/first_steps"}, {"obtained": "minecraft:diamond"}],
"in_order": false,
"rewards": {"items": ["minecraft:emerald*4"], "random": ["minecraft:gold_ingot*8", "minecraft:iron_ingot*16"]}
}
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerQuest(net.minecraft.resources.Identifier id, @Nullable net.minecraft.resources.Identifier book, List<ServerObjective> requires, List<ServerObjective> objectives, boolean inOrder, @Nullable com.google.gson.JsonObject rewards, com.google.gson.JsonObject json) Creates an instance of aServerQuestrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.resources.Identifierbook()Returns the value of thebookrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.Identifierid()Returns the value of theidrecord component.booleaninOrder()Returns the value of theinOrderrecord component.com.google.gson.JsonObjectjson()Returns the value of thejsonrecord component.Returns the value of theobjectivesrecord component.static ServerQuestread(net.minecraft.resources.Identifier id, com.google.gson.JsonObject json) requires()Returns the value of therequiresrecord component.@Nullable com.google.gson.JsonObjectrewards()Returns the value of therewardsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MOST
public static final int MOSTThe most objectives a quest has.- See Also:
-
-
Constructor Details
-
ServerQuest
public ServerQuest(net.minecraft.resources.Identifier id, @Nullable net.minecraft.resources.Identifier book, List<ServerObjective> requires, List<ServerObjective> objectives, boolean inOrder, @Nullable com.google.gson.JsonObject rewards, com.google.gson.JsonObject json) Creates an instance of aServerQuestrecord class.- Parameters:
id- the value for theidrecord componentbook- the value for thebookrecord componentrequires- the value for therequiresrecord componentobjectives- the value for theobjectivesrecord componentinOrder- the value for theinOrderrecord componentrewards- the value for therewardsrecord componentjson- the value for thejsonrecord component
-
-
Method Details
-
read
public static ServerQuest read(net.minecraft.resources.Identifier id, com.google.gson.JsonObject json) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
public net.minecraft.resources.Identifier id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
book
public @Nullable net.minecraft.resources.Identifier book()Returns the value of thebookrecord component.- Returns:
- the value of the
bookrecord component
-
requires
Returns the value of therequiresrecord component.- Returns:
- the value of the
requiresrecord component
-
objectives
Returns the value of theobjectivesrecord component.- Returns:
- the value of the
objectivesrecord component
-
inOrder
public boolean inOrder()Returns the value of theinOrderrecord component.- Returns:
- the value of the
inOrderrecord component
-
rewards
public @Nullable com.google.gson.JsonObject rewards()Returns the value of therewardsrecord component.- Returns:
- the value of the
rewardsrecord component
-
json
-