移除多余属性

This commit is contained in:
Light_Quanta 2025-04-12 01:53:55 +08:00
parent 3a3b857f0d
commit d0ad586f71
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
2 changed files with 0 additions and 36 deletions

View file

@ -26,7 +26,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
public int shotgunAmmo = 0; public int shotgunAmmo = 0;
public int sniperAmmo = 0; public int sniperAmmo = 0;
public int heavyAmmo = 0; public int heavyAmmo = 0;
public boolean playerDoubleJump = false;
public boolean edit = false; public boolean edit = false;
public void sync(Entity entity) { public void sync(Entity entity) {
@ -59,7 +58,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
type.set(nbt, type.get(this)); type.set(nbt, type.get(this));
} }
nbt.putBoolean("DoubleJump", playerDoubleJump);
nbt.putBoolean("EditMode", edit); nbt.putBoolean("EditMode", edit);
return nbt; return nbt;
@ -70,7 +68,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
type.set(this, type.get(tag)); type.set(this, type.get(tag));
} }
playerDoubleJump = tag.getBoolean("DoubleJump");
edit = tag.getBoolean("EditMode"); edit = tag.getBoolean("EditMode");
return this; return this;
@ -84,7 +81,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
clone.shotgunAmmo = this.shotgunAmmo; clone.shotgunAmmo = this.shotgunAmmo;
clone.sniperAmmo = this.sniperAmmo; clone.sniperAmmo = this.sniperAmmo;
clone.heavyAmmo = this.heavyAmmo; clone.heavyAmmo = this.heavyAmmo;
clone.playerDoubleJump = this.playerDoubleJump;
clone.edit = this.edit; clone.edit = this.edit;
return clone; return clone;
@ -99,7 +95,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
&& shotgunAmmo == other.shotgunAmmo && shotgunAmmo == other.shotgunAmmo
&& sniperAmmo == other.sniperAmmo && sniperAmmo == other.sniperAmmo
&& heavyAmmo == other.heavyAmmo && heavyAmmo == other.heavyAmmo
&& playerDoubleJump == other.playerDoubleJump
&& edit == other.edit; && edit == other.edit;
} }

View file

@ -1,31 +0,0 @@
package com.atsuishio.superbwarfare.capability.player;
import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.player.Player;
import net.neoforged.neoforge.capabilities.ICapabilityProvider;
import net.neoforged.neoforge.common.util.INBTSerializable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnknownNullability;
public class PlayerVariablesProvider implements ICapabilityProvider<Player, Void, PlayerVariable>, INBTSerializable<CompoundTag> {
private final PlayerVariable playerVariables = new PlayerVariable();
@Override
public @Nullable PlayerVariable getCapability(@NotNull Player object, Void context) {
return playerVariables;
}
@Override
public @UnknownNullability CompoundTag serializeNBT(HolderLookup.@NotNull Provider provider) {
return playerVariables.writeToNBT();
}
@Override
public void deserializeNBT(HolderLookup.@NotNull Provider provider, @NotNull CompoundTag nbt) {
playerVariables.readFromNBT(nbt);
}
}