public class Village extends java.lang.Object implements ICapabilitySerializable<NBTTagCompound>
Modifier and Type | Class and Description |
---|---|
(package private) class |
Village.VillageAggressor |
Modifier and Type | Field and Description |
---|---|
private CapabilityDispatcher |
capabilities |
private BlockPos |
center |
private BlockPos |
centerHelper |
private int |
lastAddDoorTimestamp |
private int |
noBreedTicks |
private int |
numIronGolems |
private int |
numVillagers |
private java.util.Map<java.util.UUID,java.lang.Integer> |
playerReputation |
private int |
tickCounter |
private java.util.List<Village.VillageAggressor> |
villageAgressors |
private java.util.List<VillageDoorInfo> |
villageDoorInfoList |
private int |
villageRadius |
private World |
world |
Modifier and Type | Method and Description |
---|---|
void |
addOrRenewAgressor(EntityLivingBase entitylivingbaseIn) |
void |
addVillageDoorInfo(VillageDoorInfo doorInfo) |
void |
deserializeNBT(NBTTagCompound nbt) |
void |
endMatingSeason() |
EntityLivingBase |
findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn) |
private Vec3d |
findRandomSpawnPos(BlockPos pos,
int x,
int y,
int z) |
private java.util.UUID |
findUUID(java.lang.String name) |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
BlockPos |
getCenter() |
VillageDoorInfo |
getDoorInfo(BlockPos pos) |
VillageDoorInfo |
getExistedDoor(BlockPos doorBlock) |
VillageDoorInfo |
getNearestDoor(BlockPos pos) |
EntityPlayer |
getNearestTargetPlayer(EntityLivingBase villageDefender) |
int |
getNumVillageDoors() |
int |
getNumVillagers() |
int |
getPlayerReputation(java.lang.String playerName)
Deprecated.
|
int |
getPlayerReputation(java.util.UUID playerName) |
int |
getTicksSinceLastDoorAdding() |
java.util.List<VillageDoorInfo> |
getVillageDoorInfoList() |
int |
getVillageRadius() |
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
boolean |
isAnnihilated() |
private boolean |
isAreaClearAround(BlockPos blockSize,
BlockPos blockLocation) |
boolean |
isBlockPosWithinSqVillageRadius(BlockPos pos) |
boolean |
isMatingSeason() |
boolean |
isPlayerReputationTooLow(java.lang.String playerName)
Deprecated.
|
boolean |
isPlayerReputationTooLow(java.util.UUID uuid) |
private boolean |
isWoodDoor(BlockPos pos) |
int |
modifyPlayerReputation(java.lang.String playerName,
int reputation)
Deprecated.
|
int |
modifyPlayerReputation(java.util.UUID playerName,
int reputation) |
void |
readVillageDataFromNBT(NBTTagCompound compound) |
private void |
removeDeadAndOldAgressors() |
private void |
removeDeadAndOutOfRangeDoors() |
NBTTagCompound |
serializeNBT() |
void |
setDefaultPlayerReputation(int defaultReputation) |
void |
setWorld(World worldIn) |
void |
tick(int tickCounterIn) |
private void |
updateNumIronGolems() |
private void |
updateNumVillagers() |
private void |
updateVillageRadiusAndCenter() |
void |
writeVillageDataToNBT(NBTTagCompound compound) |
private World world
private final java.util.List<VillageDoorInfo> villageDoorInfoList
private BlockPos centerHelper
private BlockPos center
private int villageRadius
private int lastAddDoorTimestamp
private int tickCounter
private int numVillagers
private int noBreedTicks
private final java.util.Map<java.util.UUID,java.lang.Integer> playerReputation
private final java.util.List<Village.VillageAggressor> villageAgressors
private int numIronGolems
private CapabilityDispatcher capabilities
public Village()
public Village(World worldIn)
public void setWorld(World worldIn)
public void tick(int tickCounterIn)
private void updateNumIronGolems()
private void updateNumVillagers()
public BlockPos getCenter()
public int getVillageRadius()
public int getNumVillageDoors()
public int getTicksSinceLastDoorAdding()
public int getNumVillagers()
public boolean isBlockPosWithinSqVillageRadius(BlockPos pos)
public java.util.List<VillageDoorInfo> getVillageDoorInfoList()
public VillageDoorInfo getNearestDoor(BlockPos pos)
public VillageDoorInfo getDoorInfo(BlockPos pos)
@Nullable public VillageDoorInfo getExistedDoor(BlockPos doorBlock)
public void addVillageDoorInfo(VillageDoorInfo doorInfo)
public boolean isAnnihilated()
public void addOrRenewAgressor(EntityLivingBase entitylivingbaseIn)
@Nullable public EntityLivingBase findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn)
public EntityPlayer getNearestTargetPlayer(EntityLivingBase villageDefender)
private void removeDeadAndOldAgressors()
private void removeDeadAndOutOfRangeDoors()
private boolean isWoodDoor(BlockPos pos)
private void updateVillageRadiusAndCenter()
@Deprecated public int getPlayerReputation(java.lang.String playerName)
public int getPlayerReputation(java.util.UUID playerName)
private java.util.UUID findUUID(java.lang.String name)
@Deprecated public int modifyPlayerReputation(java.lang.String playerName, int reputation)
public int modifyPlayerReputation(java.util.UUID playerName, int reputation)
@Deprecated public boolean isPlayerReputationTooLow(java.lang.String playerName)
public boolean isPlayerReputationTooLow(java.util.UUID uuid)
public void readVillageDataFromNBT(NBTTagCompound compound)
public void writeVillageDataToNBT(NBTTagCompound compound)
public void endMatingSeason()
public boolean isMatingSeason()
public void setDefaultPlayerReputation(int defaultReputation)
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
ICapabilityProvider
ICapabilityProvider.getCapability(Capability, EnumFacing)
.
Basically, this method functions analogously to Map.containsKey(Object)
.
Example: A Pipe getting a cover placed on one side causing it lose the Inventory attachment function for that side.
This is a light weight version of getCapability, intended for metadata uses.
hasCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.getCapability(Capability, EnumFacing)
must not return null.@Nullable public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
ICapabilityProvider
Basically, this method functions analogously to Map.get(Object)
.
getCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from,
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.hasCapability(Capability, EnumFacing)
would return true.public void deserializeNBT(NBTTagCompound nbt)
deserializeNBT
in interface INBTSerializable<NBTTagCompound>
public NBTTagCompound serializeNBT()
serializeNBT
in interface INBTSerializable<NBTTagCompound>