mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-04 21:36:41 +00:00
kinda ugly but it works
inventory saving: complete
This commit is contained in:
@ -5,10 +5,12 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigInventory;
|
||||
import net.pravian.aero.base.ConfigLoadable;
|
||||
import net.pravian.aero.base.ConfigSavable;
|
||||
import net.pravian.aero.base.Validatable;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -37,6 +39,9 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean rideToggle = true;
|
||||
@Getter
|
||||
@Setter
|
||||
private ConfigInventory inventory = null;
|
||||
|
||||
public VPlayer(String name)
|
||||
{
|
||||
@ -59,6 +64,7 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
|
||||
tag = cs.getString("tag", null);
|
||||
clearChatOptOut = cs.getBoolean("clearChatOptOut", false);
|
||||
rideToggle = cs.getBoolean("rideToggle", true);
|
||||
inventory = new ConfigInventory(Bukkit.getPlayer(name).getInventory());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -72,6 +78,8 @@ public class VPlayer implements ConfigLoadable, ConfigSavable, Validatable
|
||||
cs.set("ips", Lists.newArrayList(ips));
|
||||
cs.set("clearChatOptOut", clearChatOptOut);
|
||||
cs.set("rideToggle", rideToggle);
|
||||
inventory.updateInventory(Bukkit.getPlayer(name).getInventory());
|
||||
inventory.save(cs);
|
||||
}
|
||||
|
||||
public List<String> getIps()
|
||||
|
Reference in New Issue
Block a user