移除多余属性
This commit is contained in:
parent
3a3b857f0d
commit
d0ad586f71
2 changed files with 0 additions and 36 deletions
|
@ -26,7 +26,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
|
|||
public int shotgunAmmo = 0;
|
||||
public int sniperAmmo = 0;
|
||||
public int heavyAmmo = 0;
|
||||
public boolean playerDoubleJump = false;
|
||||
public boolean edit = false;
|
||||
|
||||
public void sync(Entity entity) {
|
||||
|
@ -59,7 +58,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
|
|||
type.set(nbt, type.get(this));
|
||||
}
|
||||
|
||||
nbt.putBoolean("DoubleJump", playerDoubleJump);
|
||||
nbt.putBoolean("EditMode", edit);
|
||||
|
||||
return nbt;
|
||||
|
@ -70,7 +68,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
|
|||
type.set(this, type.get(tag));
|
||||
}
|
||||
|
||||
playerDoubleJump = tag.getBoolean("DoubleJump");
|
||||
edit = tag.getBoolean("EditMode");
|
||||
|
||||
return this;
|
||||
|
@ -84,7 +81,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
|
|||
clone.shotgunAmmo = this.shotgunAmmo;
|
||||
clone.sniperAmmo = this.sniperAmmo;
|
||||
clone.heavyAmmo = this.heavyAmmo;
|
||||
clone.playerDoubleJump = this.playerDoubleJump;
|
||||
clone.edit = this.edit;
|
||||
|
||||
return clone;
|
||||
|
@ -99,7 +95,6 @@ public class PlayerVariable implements INBTSerializable<CompoundTag> {
|
|||
&& shotgunAmmo == other.shotgunAmmo
|
||||
&& sniperAmmo == other.sniperAmmo
|
||||
&& heavyAmmo == other.heavyAmmo
|
||||
&& playerDoubleJump == other.playerDoubleJump
|
||||
&& edit == other.edit;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue