use of net.minecraft.village.VillageCollection in project DynamicSurroundings by OreCruncher.
the class EnvironmentService method tickEvent.
@SubscribeEvent
public void tickEvent(@Nonnull final TickEvent.PlayerTickEvent event) {
if (event.phase == Phase.END && event.side == Side.SERVER) {
final EntityPlayer player = event.player;
final VillageCollection villageCollection = player.getEntityWorld().getVillageCollection();
boolean inVillage = false;
final List<Village> villages = villageCollection.getVillageList();
if (villages.size() > 0) {
final BlockPos pos = player.getPosition();
for (final Village v : villages) if (v.isBlockPosWithinSqVillageRadius(pos)) {
inVillage = true;
break;
}
}
final PacketEnvironment packet = new PacketEnvironment(inVillage);
Network.sendToPlayer((EntityPlayerMP) player, packet);
}
}
use of net.minecraft.village.VillageCollection in project kull by Sxmurai.
the class WorldServer method init.
public World init() {
this.mapStorage = new MapStorage(this.saveHandler);
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollectionObj = new VillageCollection(this);
this.mapStorage.setData(s, this.villageCollectionObj);
} else {
this.villageCollectionObj = villagecollection;
this.villageCollectionObj.setWorldsForAll(this);
}
this.worldScoreboard = new ServerScoreboard(this.mcServer);
ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData) this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard");
if (scoreboardsavedata == null) {
scoreboardsavedata = new ScoreboardSaveData();
this.mapStorage.setData("scoreboard", scoreboardsavedata);
}
scoreboardsavedata.setScoreboard(this.worldScoreboard);
((ServerScoreboard) this.worldScoreboard).func_96547_a(scoreboardsavedata);
this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ());
this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock());
this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone());
this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance());
this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime());
if (this.worldInfo.getBorderLerpTime() > 0L) {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime());
} else {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize());
}
return this;
}
use of net.minecraft.village.VillageCollection in project kull by Sxmurai.
the class WorldServerMulti method init.
public World init() {
this.mapStorage = this.delegate.getMapStorage();
this.worldScoreboard = this.delegate.getScoreboard();
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollectionObj = new VillageCollection(this);
this.mapStorage.setData(s, this.villageCollectionObj);
} else {
this.villageCollectionObj = villagecollection;
this.villageCollectionObj.setWorldsForAll(this);
}
return this;
}
use of net.minecraft.village.VillageCollection in project UtilityClient2 by Utility-Client.
the class WorldServer method init.
public World init() {
this.mapStorage = new MapStorage(this.saveHandler);
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollectionObj = new VillageCollection(this);
this.mapStorage.setData(s, this.villageCollectionObj);
} else {
this.villageCollectionObj = villagecollection;
this.villageCollectionObj.setWorldsForAll(this);
}
this.worldScoreboard = new ServerScoreboard(this.mcServer);
ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData) this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard");
if (scoreboardsavedata == null) {
scoreboardsavedata = new ScoreboardSaveData();
this.mapStorage.setData("scoreboard", scoreboardsavedata);
}
scoreboardsavedata.setScoreboard(this.worldScoreboard);
((ServerScoreboard) this.worldScoreboard).func_96547_a(scoreboardsavedata);
this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ());
this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock());
this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone());
this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance());
this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime());
if (this.worldInfo.getBorderLerpTime() > 0L) {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime());
} else {
this.getWorldBorder().setTransition(this.worldInfo.getBorderSize());
}
return this;
}
use of net.minecraft.village.VillageCollection in project UtilityClient2 by Utility-Client.
the class WorldServerMulti method init.
public World init() {
this.mapStorage = this.delegate.getMapStorage();
this.worldScoreboard = this.delegate.getScoreboard();
String s = VillageCollection.fileNameForProvider(this.provider);
VillageCollection villagecollection = (VillageCollection) this.mapStorage.loadData(VillageCollection.class, s);
if (villagecollection == null) {
this.villageCollectionObj = new VillageCollection(this);
this.mapStorage.setData(s, this.villageCollectionObj);
} else {
this.villageCollectionObj = villagecollection;
this.villageCollectionObj.setWorldsForAll(this);
}
return this;
}
Aggregations