MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / init

Method init

src/main/java/net/minecraft/world/WorldServer.java:117–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 }
116
117 public World init()
118 {
119 this.mapStorage = new MapStorage(this.saveHandler);
120 String s = VillageCollection.fileNameForProvider(this.provider);
121 VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s);
122
123 if (villagecollection == null)
124 {
125 this.villageCollectionObj = new VillageCollection(this);
126 this.mapStorage.setData(s, this.villageCollectionObj);
127 }
128 else
129 {
130 this.villageCollectionObj = villagecollection;
131 this.villageCollectionObj.setWorldsForAll(this);
132 }
133
134 this.worldScoreboard = new ServerScoreboard(this.mcServer);
135 ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard");
136
137 if (scoreboardsavedata == null)
138 {
139 scoreboardsavedata = new ScoreboardSaveData();
140 this.mapStorage.setData("scoreboard", scoreboardsavedata);
141 }
142
143 scoreboardsavedata.setScoreboard(this.worldScoreboard);
144 ((ServerScoreboard)this.worldScoreboard).func_96547_a(scoreboardsavedata);
145 this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ());
146 this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock());
147 this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone());
148 this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance());
149 this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime());
150
151 if (this.worldInfo.getBorderLerpTime() > 0L)
152 {
153 this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime());
154 }
155 else
156 {
157 this.getWorldBorder().setTransition(this.worldInfo.getBorderSize());
158 }
159
160 return this;
161 }
162
163 /**
164 * Runs a single tick for the world

Callers

nothing calls this directly

Calls 15

fileNameForProviderMethod · 0.95
setScoreboardMethod · 0.95
setWorldsForAllMethod · 0.80
func_96547_aMethod · 0.80
setCenterMethod · 0.80
getBorderCenterXMethod · 0.80
getBorderCenterZMethod · 0.80
setDamageAmountMethod · 0.80
setDamageBufferMethod · 0.80
getBorderSafeZoneMethod · 0.80
setWarningDistanceMethod · 0.80

Tested by

no test coverage detected