Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -6,43 +6,38 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BMWorldSavedData extends WorldSavedData
|
||||
{
|
||||
public class BMWorldSavedData extends WorldSavedData {
|
||||
public static final String ID = "BloodMagic-SoulNetworks";
|
||||
|
||||
private Map<UUID, SoulNetwork> soulNetworks = new HashMap<UUID, SoulNetwork>();
|
||||
|
||||
public BMWorldSavedData(String id)
|
||||
{
|
||||
public BMWorldSavedData(String id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
public BMWorldSavedData()
|
||||
{
|
||||
public BMWorldSavedData() {
|
||||
this(ID);
|
||||
}
|
||||
|
||||
public SoulNetwork getNetwork(EntityPlayer player)
|
||||
{
|
||||
public SoulNetwork getNetwork(EntityPlayer player) {
|
||||
return getNetwork(PlayerHelper.getUUIDFromPlayer(player));
|
||||
}
|
||||
|
||||
public SoulNetwork getNetwork(UUID playerId)
|
||||
{
|
||||
public SoulNetwork getNetwork(UUID playerId) {
|
||||
if (!soulNetworks.containsKey(playerId))
|
||||
soulNetworks.put(playerId, SoulNetwork.newEmpty(playerId).setParent(this));
|
||||
return soulNetworks.get(playerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
NBTTagList networkData = tagCompound.getTagList("networkData", 10);
|
||||
|
||||
for (int i = 0; i < networkData.tagCount(); i++)
|
||||
{
|
||||
for (int i = 0; i < networkData.tagCount(); i++) {
|
||||
NBTTagCompound data = networkData.getCompoundTagAt(i);
|
||||
SoulNetwork network = SoulNetwork.fromNBT(data);
|
||||
network.setParent(this);
|
||||
|
@ -51,8 +46,7 @@ public class BMWorldSavedData extends WorldSavedData
|
|||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
|
||||
NBTTagList networkData = new NBTTagList();
|
||||
for (SoulNetwork soulNetwork : soulNetworks.values())
|
||||
networkData.appendTag(soulNetwork.serializeNBT());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue