-
Notifications
You must be signed in to change notification settings - Fork 497
/
BlueprintMeta.java
69 lines (50 loc) · 1.26 KB
/
BlueprintMeta.java
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
package buildcraft.builders.blueprints;
import buildcraft.core.network.NetworkData;
import net.minecraft.nbt.NBTTagCompound;
public class BlueprintMeta {
public final String version = "Blueprint-2.0";
@NetworkData
public BlueprintId id;
@NetworkData
public String name = "";
@NetworkData
public String creator = "";
public BlueprintMeta() {
}
protected BlueprintMeta(BlueprintId id, NBTTagCompound nbt) {
this.id = id;
name = nbt.getString("name");
creator = nbt.getString("creator");
}
protected BlueprintId getId() {
return id;
}
protected void setId(BlueprintId id) {
this.id = id;
}
protected String getName() {
return name;
}
protected void setName(String name) {
if (getId() != null) throw new IllegalStateException("modifying finalized blueprint");
this.name = name;
}
/**
* @return the creator
*/
protected String getCreator() {
return creator;
}
/**
* @param creator the creator to set
*/
protected void setCreator(String creator) {
if (getId() != null) throw new IllegalStateException("modifying finalized blueprint");
this.creator = creator;
}
protected void writeToNBT(NBTTagCompound nbt) {
nbt.setString("name", name);
nbt.setString("version", version);
nbt.setString("creator", creator);
}
}