-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChunkProviderClient.java
More file actions
89 lines (76 loc) · 2.34 KB
/
ChunkProviderClient.java
File metadata and controls
89 lines (76 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.util.*;
public class ChunkProviderClient
implements IChunkProvider
{
public ChunkProviderClient(World world)
{
chunkMapping = new HashMap();
unusedChunkList = new ArrayList();
blankChunk = new EmptyChunk(world, new byte[32768], 0, 0);
worldObj = world;
}
public boolean chunkExists(int i, int j)
{
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
return chunkMapping.containsKey(chunkcoordintpair);
}
public void func_539_c(int i, int j)
{
Chunk chunk = provideChunk(i, j);
if(!chunk.func_21167_h())
{
chunk.onChunkUnload();
}
chunkMapping.remove(new ChunkCoordIntPair(i, j));
unusedChunkList.remove(chunk);
}
public Chunk func_538_d(int i, int j)
{
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
byte abyte0[] = new byte[32768];
Chunk chunk = new Chunk(worldObj, abyte0, i, j);
Arrays.fill(chunk.skylightMap.data, (byte)-1);
chunkMapping.put(chunkcoordintpair, chunk);
chunk.isChunkLoaded = true;
return chunk;
}
public Chunk provideChunk(int i, int j)
{
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
Chunk chunk = (Chunk)chunkMapping.get(chunkcoordintpair);
if(chunk == null)
{
return blankChunk;
} else
{
return chunk;
}
}
public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate)
{
return true;
}
public boolean func_532_a()
{
return false;
}
public boolean func_536_b()
{
return false;
}
public void populate(IChunkProvider ichunkprovider, int i, int j)
{
}
public String toString()
{
return (new StringBuilder()).append("MultiplayerChunkCache: ").append(chunkMapping.size()).toString();
}
private Chunk blankChunk;
private Map chunkMapping;
private List unusedChunkList;
private World worldObj;
}