mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 04:57:18 +00:00
Add option for enabling costumes on trial avatars
This commit is contained in:
parent
deaa13c2af
commit
2c7c8bf4fd
@ -27,9 +27,11 @@ public class ConfigContainer {
|
|||||||
* Version 8 - 'server' is being added for enforcing handbook server
|
* Version 8 - 'server' is being added for enforcing handbook server
|
||||||
* addresses.
|
* addresses.
|
||||||
* Version 9 - 'limits' was added for handbook requests.
|
* Version 9 - 'limits' was added for handbook requests.
|
||||||
|
* Version 10 - 'trialCostumes' was added for enabling costumes
|
||||||
|
* on trial avatars.
|
||||||
*/
|
*/
|
||||||
private static int version() {
|
private static int version() {
|
||||||
return 9;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -255,6 +257,8 @@ public class ConfigContainer {
|
|||||||
public boolean staminaUsage = true;
|
public boolean staminaUsage = true;
|
||||||
public boolean energyUsage = true;
|
public boolean energyUsage = true;
|
||||||
public boolean fishhookTeleport = true;
|
public boolean fishhookTeleport = true;
|
||||||
|
public boolean trialCostumes = false;
|
||||||
|
|
||||||
@SerializedName(value = "questing", alternate = "questOptions")
|
@SerializedName(value = "questing", alternate = "questOptions")
|
||||||
public Questing questing = new Questing();
|
public Questing questing = new Questing();
|
||||||
public ResinOptions resinOptions = new ResinOptions();
|
public ResinOptions resinOptions = new ResinOptions();
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package emu.grasscutter.game.avatar;
|
package emu.grasscutter.game.avatar;
|
||||||
|
|
||||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
|
||||||
|
|
||||||
import dev.morphia.annotations.*;
|
import dev.morphia.annotations.*;
|
||||||
import emu.grasscutter.GameConstants;
|
import emu.grasscutter.GameConstants;
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
@ -32,12 +30,15 @@ import emu.grasscutter.net.proto.TrialAvatarInfoOuterClass.TrialAvatarInfo;
|
|||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import emu.grasscutter.utils.helpers.ProtoHelper;
|
import emu.grasscutter.utils.helpers.ProtoHelper;
|
||||||
import it.unimi.dsi.fastutil.ints.*;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
import javax.annotation.*;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.bson.types.ObjectId;
|
import org.bson.types.ObjectId;
|
||||||
|
|
||||||
|
import javax.annotation.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||||
|
|
||||||
@Entity(value = "avatars", useDiscriminator = false)
|
@Entity(value = "avatars", useDiscriminator = false)
|
||||||
public class Avatar {
|
public class Avatar {
|
||||||
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
||||||
@ -1243,6 +1244,7 @@ public class Avatar {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add costume if avatar has a costume.
|
// Add costume if avatar has a costume.
|
||||||
|
if (GAME_OPTIONS.trialCostumes) {
|
||||||
GameData.getAvatarCostumeDataItemIdMap()
|
GameData.getAvatarCostumeDataItemIdMap()
|
||||||
.values()
|
.values()
|
||||||
.forEach(
|
.forEach(
|
||||||
@ -1251,6 +1253,7 @@ public class Avatar {
|
|||||||
this.setCostume(costumeData.getId());
|
this.setCostume(costumeData.getId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Equips the items applied from {@link Avatar#applyTrialItems()}. */
|
/** Equips the items applied from {@link Avatar#applyTrialItems()}. */
|
||||||
public void equipTrialItems() {
|
public void equipTrialItems() {
|
||||||
|
Loading…
Reference in New Issue
Block a user