initial commit

This commit is contained in:
Sen 2025-03-11 00:23:54 +01:00 committed by Sen
parent 3c9ee26b06
commit 22186c33b9
1458 changed files with 282792 additions and 0 deletions

View file

@ -0,0 +1,42 @@
package game.tileentity;
import game.nbt.NBTTagCompound;
public class LockCode
{
public static final LockCode EMPTY_CODE = new LockCode("");
private final String lock;
public LockCode(String code)
{
this.lock = code;
}
public boolean isEmpty()
{
return this.lock == null || this.lock.isEmpty();
}
public String getLock()
{
return this.lock;
}
public void toNBT(NBTTagCompound nbt)
{
nbt.setString("Lock", this.lock);
}
public static LockCode fromNBT(NBTTagCompound nbt)
{
if (nbt.hasKey("Lock", 8))
{
String s = nbt.getString("Lock");
return new LockCode(s);
}
else
{
return EMPTY_CODE;
}
}
}