TotalFreedomMod/src/me/StevenLawson/TotalFreedomMod/TFM_UserInfo.java

178 lines
3.6 KiB
Java
Raw Normal View History

2011-10-01 17:59:46 +00:00
package me.StevenLawson.TotalFreedomMod;
2011-10-10 12:09:19 +00:00
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Material;
2011-10-02 04:23:22 +00:00
public class TFM_UserInfo
2011-10-01 17:59:46 +00:00
{
private boolean user_frozen = false;
private int msg_count = 0;
2011-10-05 19:07:45 +00:00
private int block_destroy_total = 0;
private int freecam_destroy_count = 0;
private int freecam_place_count = 0;
2011-10-10 12:09:19 +00:00
2011-10-14 05:31:21 +00:00
private boolean forced_death = false;
2011-10-10 12:09:19 +00:00
// -- Start Cage
private boolean user_caged = false;
private Location user_cage_pos;
private List<TFM_BlockData> user_cage_history = new ArrayList<TFM_BlockData>();
private Material cage_material_outer;
private Material cage_material_inner;
2011-10-02 04:18:52 +00:00
2011-10-02 04:23:22 +00:00
public TFM_UserInfo()
2011-10-01 17:59:46 +00:00
{
}
2011-10-10 12:09:19 +00:00
public void setCaged(boolean state)
{
this.user_caged = state;
}
public void setCaged(boolean state, Location location, Material material_outer, Material material_inner)
{
this.user_caged = state;
this.user_cage_pos = location;
this.cage_material_outer = material_outer;
this.cage_material_inner = material_inner;
}
public boolean isCaged()
{
return this.user_caged;
}
public Material getCageMaterial(int layer)
{
if (layer == 1)
{
return this.cage_material_inner;
}
else
{
return this.cage_material_outer;
}
}
public Location getCagePos()
{
return this.user_cage_pos;
}
public void clearHistory()
{
this.user_cage_history.clear();
}
public void insertHistoryBlock(Location location, Material material)
{
this.user_cage_history.add(new TFM_BlockData(location, material));
}
public void regenerateHistory()
{
for (TFM_BlockData blockdata : this.user_cage_history)
{
blockdata.location.getBlock().setType(blockdata.material);
}
}
class TFM_BlockData
{
public Material material;
public Location location;
public TFM_BlockData(Location location, Material material)
{
this.location = location;
this.material = material;
}
}
// -- End Cage
2011-10-14 05:31:21 +00:00
public boolean getForcedDeath()
{
return this.forced_death;
}
void setForcedDeath(boolean forced_death)
{
this.forced_death = forced_death;
}
2011-10-01 17:59:46 +00:00
public boolean isFrozen()
{
return this.user_frozen;
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public void setFrozen(boolean fr)
{
this.user_frozen = fr;
}
public void resetMsgCount()
{
this.msg_count = 0;
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public void incrementMsgCount()
{
this.msg_count++;
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public int getMsgCount()
{
return this.msg_count;
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public void incrementBlockDestroyCount()
{
2011-10-05 19:07:45 +00:00
this.block_destroy_total++;
2011-10-01 17:59:46 +00:00
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public int getBlockDestroyCount()
{
2011-10-05 19:07:45 +00:00
return this.block_destroy_total;
2011-10-01 17:59:46 +00:00
}
2011-10-02 04:18:52 +00:00
2011-10-01 17:59:46 +00:00
public void resetBlockDestroyCount()
{
2011-10-05 19:07:45 +00:00
this.block_destroy_total = 0;
}
public void incrementFreecamDestroyCount()
{
this.freecam_destroy_count++;
}
public int getFreecamDestroyCount()
{
return this.freecam_destroy_count;
}
public void resetFreecamDestroyCount()
{
this.freecam_destroy_count = 0;
}
public void incrementFreecamPlaceCount()
{
this.freecam_place_count++;
}
public int getFreecamPlaceCount()
{
return this.freecam_place_count;
}
public void resetFreecamPlaceCount()
{
this.freecam_place_count = 0;
2011-10-01 17:59:46 +00:00
}
}