mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 15:22:16 +00:00
Format code [skip actions]
This commit is contained in:
parent
815ba3e3e3
commit
36dee424ee
@ -1,5 +1,8 @@
|
||||
package emu.grasscutter.auth;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.utils.lang.Language.translate;
|
||||
|
||||
import at.favre.lib.crypto.bcrypt.BCrypt;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.Grasscutter.ServerRunMode;
|
||||
@ -10,16 +13,12 @@ import emu.grasscutter.server.dispatch.*;
|
||||
import emu.grasscutter.server.http.objects.*;
|
||||
import emu.grasscutter.utils.*;
|
||||
import io.javalin.http.ContentType;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.utils.lang.Language.translate;
|
||||
import javax.crypto.Cipher;
|
||||
|
||||
/** A class containing default authenticators. */
|
||||
public final class DefaultAuthenticators {
|
||||
|
@ -4,9 +4,8 @@ import emu.grasscutter.data.excels.ProudSkillData;
|
||||
import emu.grasscutter.game.ability.Ability;
|
||||
import it.unimi.dsi.fastutil.floats.FloatArrayList;
|
||||
import it.unimi.dsi.fastutil.objects.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
public class DynamicFloat {
|
||||
|
@ -17,11 +17,10 @@ import emu.grasscutter.net.proto.AbilityScalarTypeOuterClass.AbilityScalarType;
|
||||
import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry;
|
||||
import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction;
|
||||
import io.netty.util.concurrent.FastThreadLocalThread;
|
||||
import lombok.Getter;
|
||||
import org.reflections.Reflections;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.*;
|
||||
import lombok.Getter;
|
||||
import org.reflections.Reflections;
|
||||
|
||||
public final class AbilityManager extends BasePlayerManager {
|
||||
|
||||
|
@ -463,9 +463,14 @@ public class Avatar {
|
||||
this.getEquips().put(itemEquipType.getValue(), item);
|
||||
|
||||
if (itemEquipType == EquipType.EQUIP_WEAPON && getPlayer().getWorld() != null) {
|
||||
if (!(item.getWeaponEntity() != null && item.getWeaponEntity().getScene() == getPlayer().getScene())) {
|
||||
item.setWeaponEntity(new EntityWeapon(this.getPlayer().getScene(), item.getItemData().getGadgetId()));
|
||||
this.getPlayer().getScene().getWeaponEntities().put(item.getWeaponEntity().getId(), item.getWeaponEntity());
|
||||
if (!(item.getWeaponEntity() != null
|
||||
&& item.getWeaponEntity().getScene() == getPlayer().getScene())) {
|
||||
item.setWeaponEntity(
|
||||
new EntityWeapon(this.getPlayer().getScene(), item.getItemData().getGadgetId()));
|
||||
this.getPlayer()
|
||||
.getScene()
|
||||
.getWeaponEntities()
|
||||
.put(item.getWeaponEntity().getId(), item.getWeaponEntity());
|
||||
}
|
||||
// item.setWeaponEntityId(this.getPlayer().getWorld().getNextEntityId(EntityIdType.WEAPON));
|
||||
}
|
||||
@ -1262,9 +1267,14 @@ public class Avatar {
|
||||
item.setEquipCharacter(this.getAvatarId());
|
||||
item.setOwner(player);
|
||||
if (item.getItemData().getEquipType() == EquipType.EQUIP_WEAPON) {
|
||||
if (!(item.getWeaponEntity() != null && item.getWeaponEntity().getScene() == player.getScene())) {
|
||||
item.setWeaponEntity(new EntityWeapon(player.getScene(), item.getItemData().getGadgetId()));
|
||||
player.getScene().getWeaponEntities().put(item.getWeaponEntity().getId(), item.getWeaponEntity());
|
||||
if (!(item.getWeaponEntity() != null
|
||||
&& item.getWeaponEntity().getScene() == player.getScene())) {
|
||||
item.setWeaponEntity(
|
||||
new EntityWeapon(player.getScene(), item.getItemData().getGadgetId()));
|
||||
player
|
||||
.getScene()
|
||||
.getWeaponEntities()
|
||||
.put(item.getWeaponEntity().getId(), item.getWeaponEntity());
|
||||
}
|
||||
|
||||
player.sendPacket(new PacketAvatarEquipChangeNotify(this, item));
|
||||
|
@ -64,7 +64,8 @@ public class EntityAvatar extends GameEntity {
|
||||
var weapon = this.getAvatar().getWeapon();
|
||||
if (weapon != null) {
|
||||
if (!(weapon.getWeaponEntity() != null && weapon.getWeaponEntity().getScene() == scene)) {
|
||||
weapon.setWeaponEntity(new EntityWeapon(this.getPlayer().getScene(), weapon.getItemData().getGadgetId()));
|
||||
weapon.setWeaponEntity(
|
||||
new EntityWeapon(this.getPlayer().getScene(), weapon.getItemData().getGadgetId()));
|
||||
scene.getWeaponEntities().put(weapon.getWeaponEntity().getId(), weapon.getWeaponEntity());
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,11 @@
|
||||
package emu.grasscutter.game.entity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.binout.AbilityData;
|
||||
import emu.grasscutter.data.binout.config.ConfigEntityGadget;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
|
||||
import emu.grasscutter.data.excels.GadgetData;
|
||||
import emu.grasscutter.game.entity.gadget.GadgetContent;
|
||||
import emu.grasscutter.game.props.EntityIdType;
|
||||
import emu.grasscutter.game.world.Scene;
|
||||
import emu.grasscutter.net.proto.SceneEntityInfoOuterClass.SceneEntityInfo;
|
||||
@ -16,6 +13,7 @@ import emu.grasscutter.scripts.EntityControllerScriptManager;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
@ -23,10 +21,12 @@ import lombok.ToString;
|
||||
@ToString(callSuper = true)
|
||||
public class EntityWeapon extends EntityBaseGadget {
|
||||
@Getter private final GadgetData gadgetData;
|
||||
@Getter(onMethod = @__(@Override)) @Setter
|
||||
|
||||
@Getter(onMethod = @__(@Override))
|
||||
@Setter
|
||||
private int gadgetId;
|
||||
@Nullable @Getter
|
||||
private ConfigEntityGadget configGadget;
|
||||
|
||||
@Nullable @Getter private ConfigEntityGadget configGadget;
|
||||
|
||||
@Getter(onMethod = @__(@Override), lazy = true)
|
||||
private final Int2FloatMap fightProperties = new Int2FloatOpenHashMap();
|
||||
@ -56,7 +56,8 @@ public class EntityWeapon extends EntityBaseGadget {
|
||||
}
|
||||
|
||||
this.id = scene.getWorld().getNextEntityId(EntityIdType.WEAPON);
|
||||
Grasscutter.getLogger().warn("New weapon entity id {} at scene {}", this.id, this.getScene().getId());
|
||||
Grasscutter.getLogger()
|
||||
.warn("New weapon entity id {} at scene {}", this.id, this.getScene().getId());
|
||||
|
||||
initAbilities();
|
||||
}
|
||||
@ -64,8 +65,7 @@ public class EntityWeapon extends EntityBaseGadget {
|
||||
private void addConfigAbility(ConfigAbilityData abilityData) {
|
||||
AbilityData data = GameData.getAbilityData(abilityData.getAbilityName());
|
||||
if (data != null)
|
||||
getScene().getWorld().getHost().getAbilityManager().addAbilityToEntity(
|
||||
this, data);
|
||||
getScene().getWorld().getHost().getAbilityManager().addAbilityToEntity(this, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -276,7 +276,8 @@ public class GameItem {
|
||||
}
|
||||
|
||||
public SceneWeaponInfo createSceneWeaponInfo() {
|
||||
var weaponInfo = SceneWeaponInfo.newBuilder()
|
||||
var weaponInfo =
|
||||
SceneWeaponInfo.newBuilder()
|
||||
.setEntityId(this.getWeaponEntity() != null ? this.getWeaponEntity().getId() : 0)
|
||||
.setItemId(this.getItemId())
|
||||
.setGuid(this.getGuid())
|
||||
|
@ -800,7 +800,9 @@ public final class Scene {
|
||||
|
||||
for (GameEntity entity : this.getEntities().values()) {
|
||||
var spawnEntry = entity.getSpawnEntry();
|
||||
if (spawnEntry != null && !(entity instanceof EntityWeapon) && !visible.contains(spawnEntry)) {
|
||||
if (spawnEntry != null
|
||||
&& !(entity instanceof EntityWeapon)
|
||||
&& !visible.contains(spawnEntry)) {
|
||||
toRemove.add(entity);
|
||||
spawnedEntities.remove(spawnEntry);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user