public class Village
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
Village.VillageAggressor |
Modifier and Type | Field and Description |
---|---|
private BlockPos |
center
This is the actual village center.
|
private BlockPos |
centerHelper
This is the sum of all door coordinates and used to calculate the actual village center by dividing by the number
of doors.
|
private int |
lastAddDoorTimestamp |
private int |
noBreedTicks
Timestamp of tick count when villager last bred
|
private int |
numIronGolems |
private int |
numVillagers |
private java.util.TreeMap<java.lang.String,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 |
worldObj |
Modifier and Type | Method and Description |
---|---|
void |
addOrRenewAgressor(EntityLivingBase entitylivingbaseIn) |
void |
addVillageDoorInfo(VillageDoorInfo doorInfo) |
void |
endMatingSeason()
Prevent villager breeding for a fixed interval of time
|
EntityLivingBase |
findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn) |
private boolean |
func_179861_a(BlockPos p_179861_1_,
BlockPos p_179861_2_) |
private Vec3 |
func_179862_a(BlockPos p_179862_1_,
int p_179862_2_,
int p_179862_3_,
int p_179862_4_) |
boolean |
func_179866_a(BlockPos pos) |
BlockPos |
getCenter() |
VillageDoorInfo |
getDoorInfo(BlockPos pos)
Returns
VillageDoorInfo from given block position |
VillageDoorInfo |
getExistedDoor(BlockPos doorBlock)
if door not existed in this village, null will be returned
|
VillageDoorInfo |
getNearestDoor(BlockPos pos) |
EntityPlayer |
getNearestTargetPlayer(EntityLivingBase villageDefender) |
int |
getNumVillageDoors()
Actually get num village door info entries, but that boils down to number of doors.
|
int |
getNumVillagers() |
int |
getReputationForPlayer(java.lang.String p_82684_1_)
Return the village reputation for a player
|
int |
getTicksSinceLastDoorAdding() |
java.util.List<VillageDoorInfo> |
getVillageDoorInfoList() |
int |
getVillageRadius() |
boolean |
isAnnihilated()
Returns true, if there is not a single village door left.
|
boolean |
isMatingSeason()
Return whether villagers mating refractory period has passed
|
boolean |
isPlayerReputationTooLow(java.lang.String p_82687_1_)
Return whether this player has a too low reputation with this village.
|
private boolean |
isWoodDoor(BlockPos pos) |
void |
readVillageDataFromNBT(NBTTagCompound p_82690_1_)
Read this village's data from NBT.
|
private void |
removeDeadAndOldAgressors() |
private void |
removeDeadAndOutOfRangeDoors() |
void |
setDefaultPlayerReputation(int p_82683_1_) |
int |
setReputationForPlayer(java.lang.String p_82688_1_,
int p_82688_2_)
Set the village reputation for a player.
|
void |
setWorld(World worldIn) |
void |
tick(int p_75560_1_)
Called periodically by VillageCollection
|
private void |
updateNumIronGolems() |
private void |
updateNumVillagers() |
private void |
updateVillageRadiusAndCenter() |
void |
writeVillageDataToNBT(NBTTagCompound p_82689_1_)
Write this village's data to NBT.
|
private World worldObj
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 java.util.TreeMap<java.lang.String,java.lang.Integer> playerReputation
private java.util.List<Village.VillageAggressor> villageAgressors
private int numIronGolems
public Village()
public Village(World worldIn)
public void setWorld(World worldIn)
public void tick(int p_75560_1_)
private Vec3 func_179862_a(BlockPos p_179862_1_, int p_179862_2_, int p_179862_3_, int p_179862_4_)
private void updateNumIronGolems()
private void updateNumVillagers()
public BlockPos getCenter()
public int getVillageRadius()
public int getNumVillageDoors()
public int getTicksSinceLastDoorAdding()
public int getNumVillagers()
public boolean func_179866_a(BlockPos pos)
public java.util.List<VillageDoorInfo> getVillageDoorInfoList()
public VillageDoorInfo getNearestDoor(BlockPos pos)
public VillageDoorInfo getDoorInfo(BlockPos pos)
VillageDoorInfo
from given block positionpublic VillageDoorInfo getExistedDoor(BlockPos doorBlock)
public void addVillageDoorInfo(VillageDoorInfo doorInfo)
public boolean isAnnihilated()
public void addOrRenewAgressor(EntityLivingBase entitylivingbaseIn)
public EntityLivingBase findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn)
public EntityPlayer getNearestTargetPlayer(EntityLivingBase villageDefender)
private void removeDeadAndOldAgressors()
private void removeDeadAndOutOfRangeDoors()
private boolean isWoodDoor(BlockPos pos)
private void updateVillageRadiusAndCenter()
public int getReputationForPlayer(java.lang.String p_82684_1_)
public int setReputationForPlayer(java.lang.String p_82688_1_, int p_82688_2_)
public boolean isPlayerReputationTooLow(java.lang.String p_82687_1_)
public void readVillageDataFromNBT(NBTTagCompound p_82690_1_)
public void writeVillageDataToNBT(NBTTagCompound p_82689_1_)
public void endMatingSeason()
public boolean isMatingSeason()
public void setDefaultPlayerReputation(int p_82683_1_)